Teleport to a same location on a diferent map (XP)

I tried to do a common event that when is on it goes to a diferent map with the same ID, but it doesn't work when I activate the event, ¿What could be the error? also sorry, but the text is in spanish. If you know how to solve the problem please leave a comment

HELOP 1.png

HELOP 2.png

HELOP 3.png

HELOP 4.png
I mean a same location on a diferent map
Gato Robot Con Hat, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


If you have something to add and your post is the last, please edit it.


That said, it is most probably a timing error - splitting commands between parallel processes is never a good idea. I suggest you follow the link to the bughunt tutorial in my signature to learn more about that.


Do not make the transfer command a parallel controlled by a switch, use call event directly on the event instead of a control switch, and change the event to no trigger.


Additionally, I would suggest using other variables (some scripts use the first variables for themselves, better use variables that are guaranteed not to be handled elsewhere) and make sure that the other map has the same size (transfer will fail if the coordinates don't exist).


Last option: have those variables in the first event been activated already? event only exist when the player is on their map, so he needs to have been at the event that sets the coordinates before he can teleport there from the other map.


And you need to update the player x and player Y at the moment of the teleport, the control variables only keep the numbers that were there when that event was triggered. The values inside will not change even if the player moves, they only change when the commands are repeated.
How do you want to transfer between the maps? Through an Item? If you want to use an item to transfer between two maps keeping the players location, have the item call a common event like this one. 

Code:
◆Control Variables:#0001 Player X = Map X of Player
◆Control Variables:#0002 Player Y = Map Y of Player
◆Control Variables:#0003 Map ID = Map ID
◆If:Map ID = 0
  ◆Control Variables:#0003 Map ID = 1
  ◆Transfer Player:{Map ID} ({Player X},{Player Y})
  ◆
:Else
  ◆If:Map ID = 1
    ◆Control Variables:#0003 Map ID = 0
    ◆Transfer Player:{Map ID} ({Player X},{Player Y})
    ◆
  :End
  ◆
:End
◆Text:None, Window, Bottom
:    :You can't use this here.

This common event just takes a snap of the characters current location and current map then uses basic conditional branches to check if the player is on one of the two maps that you can transfer between, in this example map with an id of 0 and a map with the id of 1. [not a terribly realistic setup] If your on map 0 it will set the mapID to the other map with id of 1 and then teleport you to that map to the same coordinants that you are already on. However fi you are not on either of these maps, the item will simply tell you that you are not able to use it right now.


For best results make sure the two maps are the same size, and if there are MORE maps you need to transfer between add additional step to the conditional branches to add additional maps to the list of places the item can move you between, but keep in mind the map layouts of these areas.
No sé si a esto te referías. You need something to activate the switch first, right?


floruro.JPG


floruro2.JPG


floruro3.JPG


floruro4.JPG


floruro5.JPG
I would rather use the "Call Common Event" instead of using a switch. Doing so, the common event is used at the right moment. Do not rely on Parallel Common Event for this. It means a lot of trouble if it interferes with other parallel processes.
I would rather use the "Call Common Event" instead of using a switch. Doing so, the common event is used at the right moment. Do not rely on Parallel Common Event for this. It means a lot of trouble if it interferes with other parallel processes.

Yea doing this with a parallel event would break a lot of things.

Original thread: https://forums.rpgmakerweb.com/threads/teleport-to-a-same-location-on-a-diferent-map-xp.66831/