The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Tutorials and Eventing => Topic started by: Sabre_of_Pain on May 20, 2008, 07:46:15 PM

Title: transfer to other map location based on current x/y
Post by: Sabre_of_Pain on May 20, 2008, 07:46:15 PM
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.
Title: Re: transfer to other map location based on current x/y
Post by: ceegamus on May 29, 2008, 09:11:55 PM
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.