How do I link plotscripts together?

From OHRRPGCE-Wiki
Jump to navigation Jump to search

So you've done the How To but still don't see very well how to link plotscprits together, well let's start again from the beginning!

Sometimes you need to launch a plotscript after another one. For example the party arrives in the village and a cutscene starts. You see the final boss complaining that one of his minion has been beaten. Then you have one the villagers who has fighting skills and who agreed while the cutscene to join the party.

You need to launch the script and add him to party (with its equipement and a a text box saying "John Doe" joins the party. Then you just have to add the name of the script at the end of the first script. I explain


#------------------------------------------------------------------------------
plotscript, arriving in village Y, begin

# text box with dialogues

# teleport to map (boss HQ)

# text box and wlk npc : the final boss complains about the previous beaten boss
# eventually flash (final boss hurts its minion because they're  worthless)

# teleport to again (village)
# hero meets a new friend john Doe

John Doe joins # launch next script

end #end of the script

#------------------------------------------------------------------------------
plotscript, john doe joins, begin

# add hero
# make disapear the npc

end #end of the script

#------------------------------------------------------------------------------

You can even add another script in which John Doe's little appear crying and try to convince him to stay in the village.

As you can see it is very very easy to link plotscript together. Another main use (not to say the most important) of plotscript linking is to divide big scripts if several sub-scripts and make coding lighter and compiling more efficient (and quicker).

Let's say that you have a big intro script in which you present the heroes' world and the main history event that will determine the main quest of the party (typically a very very bad guy beaten a long ago comes back to life and threaten the peace of the world)

To prevent bugs and Hspeak.exe from having problems with compiling (even more true if you intend to add mini- games later on or big cutscenes) I suggest to divide your big intro script into 2. The fact that there are 2 scripts instead of one won't have any effect on player controls or create bugs... as long as you don't forget to link them simply adding the name of script that should come next at the end.


#------------------------------------------------------------------------------
# first part of the game intro
plotscript, game intro p1, begin

suspend npcs
suspend player


resume npcs
resume player

game intro p2
end #end of the script

#------------------------------------------------------------------------------
plotscript, game intro p2, begin

# add hero
# make disapear the npc

end #end of the script

#------------------------------------------------------------------------------

To conclude

  1. Linking and diving big plotscripts into several parts is the basis to became a OHRRPCE game maker. Don't be afraid to ask for help on the forum and try to master plotscript linking
  2. It is very easy to do (... as long as the scripts names are spelt correctly) and prevents bugs !
  3. Around 50 lines of codes makes your script a big one, so if you have some scripts that big I strongly advise you to divide them.


See Also[edit]