View previous topic :: View next topic |
Author |
Message |
Meatballsub Divine Bovine

Joined: 16 Jun 2003 Posts: 437 Location: Northwest Georgia
|
Posted: Fri May 30, 2008 10:53 am Post subject: Saving/Returning to a specific map? |
|
|
Is there a way to "save" the hero's map and position on the map and recall it for later use? For instance, I was wanting to add an area that you teleport to and allow the option of bringing you back to the exact location you were before you teleported. Any help on this would be greatly appreciated. |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Fri May 30, 2008 11:06 am Post subject: |
|
|
Use global variables to save the position. Something like this:
Code: | global variable(
1, temp x
2, temp y
3, temp map
)
plotscript, store position. begin
temp x := hero x (me)
temp y := hero y (me)
temp map := current map
end
plotscript, restore position, begin
teleport to map (temp map, temp x, temp y)
end |
_________________
|
|
Back to top |
|
 |
Meatballsub Divine Bovine

Joined: 16 Jun 2003 Posts: 437 Location: Northwest Georgia
|
Posted: Fri May 30, 2008 11:09 am Post subject: |
|
|
I'll give this a shot later on and see how it works, thanks  |
|
Back to top |
|
 |
|