RMRK is retiring.
Server is paid up for the rest of 2026, but the forum may go after that. See here for more information. Please archive or save anything you would like to keep before 2027.
Main Menu

transfer to other map location based on current x/y

Started by Sabre_of_Pain, May 20, 2008, 07:46:15 PM

0 Members and 1 Guest are viewing this topic.

Sabre_of_Pain

i need to transfer the player to another map. but the coords are based on the current coords of the player. i could just make an event on every square, but that would suck ass. i want to use a variable to do it, but have no idea how.
"screaming out the mating call. i've become the lord of love"

caramelldansen forever!

ceegamus

Try this:

Set Variable:[Player X] to Player's Screen X.
Set Variable:[Player Y] to Player's Screen Y.
Subtract Variable:[Player X] by [Next Map Width - 1]    (ex.  20-wide map, subtract 19)
Set Variable:[Map ID] to Constant(whatever the next map id is) {found by map number, or hitting space on a map and getting the ID}

Teleport to [Player X], [Player Y], [Map ID]


You'd put this into one event and then copy it to every teleport square.  The maps have to be the same height or correspond (Map 1 Upper right hand corner is next to Map 2 Upper Left hand corner).

I'm on my dad's laptop, so I can't test if it works yet.
This is a signature.