How do I make a teleporter that transports you to an "HQ" thoughout the whole game?

Jump to navigation Jump to search

The operation is rather complex so please read carefully the following example.

You have to know how to make an yes no questions. So please read the related question before you continue. This ploscript may only useful if you have a place on which you have to go and leave all along the game.

To be able to store your coordonates efficiently, we shall use global variable. The global variables should be included in your .hs file just after you have defined your file. The global variable will able to make the hero back to the party wherever he(or she) was in the party before he(or she)teleport

We will use 3 global variable yourM (your current map), yourX (your current X position on the map),and your Y (your current Y position on the map) We will also need 2 plotscripts and 2 tags.(You can also check wandering hamster plotscript to see how to organise the plotscript and where you can put the global variables in your plotscript).

Click on the link below and read the related questions to know how to use the tags in question with choices. Then launch custom go on the "edit text box" menu and in two separate text boxes key in the text below :

example text box 158:

  Would you like to go to HQ? (Yes/No)

and text box 148:

Would you like to go back to the party? (Yes/No)

See "How do I make choices in a dialogue box?" if you have problems to understand what to do


#Global variables

Global variable (0, yourM)
Global variable (1, yourX)
Global variable (2, yourY)

plotscript, teleport to the HQ, begin
 suspend Npcs
 suspend player
 supend caterpillar #(only if you use the caterpillar effect that enables that heroes 2,3 and 4 to follow the main hero)

 #(tag is ON is the answer to the text box 159 is yes)
 if (check tag (tag : go to the HQ)==ON) then, begin
   set variable (YourM, current map) #(register the current map)
   set variable (YourX, herox(me))   #(register your current X position)
   set variable (YourY, heroy(me))   #(register your current Y position)
   fade screen out (63,63,63)
   #(make a "teleport like" effect)
   teleport to map (54, 25, 26) 
   #(here there is the arrive location in the HQ)
   fade screen in
   wait for text box
   resume npcs
   resume player
   resume caterpillar #(resume caterpilar if the caterpillar effects are on)
 #(end of the tag)
#(end of the plotscript)
  1. Note: command prevents the text box 158 with the question to be asked without using the space or ctrl currently used to speak to the npcs)
  2. Note: If you have chosen that if the tag is OFF then you will go to a text box that says "please, not now" or any equivalent the "wait for text box" command is an option.
  3. Note: Feel free to see the related questions to tags and choices for more details.

plotscript, go back to the party, begin
 suspend player
 suspend npcs
 suspend caterpillar

 if (check tag (tag: go back to the party)==ON) then,begin
   fade screen out (63,63,63)
   teleport to map (YourM, YourX, YourY)#allows you to go back where you were in the game
   fade screen in
 #end of the tag

 wait for text box 
 #(prevent the question to be asked without typing on the space bar)
 resume player
 resume Npcs
 resume caterpillar  #(if caterpilar effects are on turn it off here )

Now that you have keyed in the 2 plotscripts in your hsi file compile it and attack the plotscript go to the HQ to an invisible step on Npc on a teleporter.

The hero will arrive on a teleporter. The invisible step on Npc in the HQ map will display the text box 148

The two plotscripts will be attack as if ON "run go to the HQ next" for the text box 158 ,and, for the text box 148 run " go back to the party " next.