How do I use string to update dialogues?

From OHRRPGCE-Wiki
Jump to: navigation, search

In this article, we'll see how to use strings to update dialogues! It seems not to very useful at first side because the example use a text boxes and you have 32767 text boxes but I wrote this as an introduction to strings for newbies

simple text[edit]

Anyway, in the first part of this article, we're going to see how to use strings to update simple dialogues. By simple dialogue I intend basic text box.

First choose a string number to use. In this example it will be 6. Then go under custom.exe and pick up a free text box. (In this example it will be text box 17).,Write $={s6} in it.

To update dialogues, we'll use a tag. It will be named tag:quest1 (Why this name? Well because Npcs dialogues have to be updated most of the time when a quest ends.

Edit the hsi file and then go under windows without leaving custom.exe (if possible). Now, you open your hss file and include the following script

plotscript, dialogue using strings, begin


suspend player
suspend npcs

$6="Hello! How are you?"
set tag (tag: quest1, on)

if (check tag (tag: quest1)==on) then, begin
$6= "No; I haven't seen him"
end# end for the tag

show text box (17)
wait for text box

resume player
resume npcs
end #end of the script

Compile the .hss file and import it. Edit one of the npc on the testing map and make him/her run "dialogue using strings" (it's one the bottom). Then save your game datas and test the whole thing! The first time you'll see "How are you?" and the second time (because the tag have been turned on, you'll see "No; I haven't seen him"

You may have notice that the main difference between is that dialogues in the script follows the chronological order. To get the same things with the show text box command you would have to use the end, else function that comes with the if check tag

Compare this with the one above

plotscript, dialogue using textbox, begin


if (check tag (tag: quest1)==on) then, begin

show text box (18) #contains "No; I haven't seen him"
wait for text box
set tag (tag: quest1, on)

end, else, begin
show text box (17)  #contains "Hello! How are you?"
wait for text box
end #end for the if check tag

end #end of the script


complexe dialogues[edit]

-To come-




See Also[edit]