MaptrixAdvanced: Teleport at the edges of the map;


​

License: Free for personal or commercial use.

Context: Teleportation between two maps requires the developer to create events in the exact locations where he wants the player's teleportation to take place. This proves to be quite laborious when it is necessary for the same teleporter to happen at various points on the map.

Description: This script automates teleportation at the ends of pre-configured maps. When it reaches the edge of the map, the player is teleported to the new map in a relative position. You do not need the maps to be the same size.

Initial configuration: the developer needs to make an initial configuration of the plugin and define the type of transition he wants for teleportation at the ends of the map.




telaplugin.jpg


In addition to the possibility to choose the type of transition, the developer must define 4 database switches to control when the teleportation of each end of the map (top, bottom, right and left) will be enabled or disabled.




maptrix.jpg


The developer will have to use tags for each of the 4 ends where he wants the teleportation to work. The tags are as follows:


<mapUp: mapId> teleports the player when he reaches the top edge.

<mapDown:mapId> teleports the player when he reaches the lower end.

<mapLeft:mapId> teleports the player when he reaches the left edge.

<mapRight:mapId> teleports the player when he reaches the right end.​


NOTE 1: In each of the 4 examples above, replace mapId with the destination map number.

NOTA 2 : If the map does not have a tag in a certain direction, when the player reaches the end of that tag, NOTHING WILL HAPPEN.

NOTA 3: A map can have more than 1 tag, as long as they are different from each other. If there are two identical tags, only the first will work.


Extra functions!

It is possible to make the player teleport to a specific coordinate when reaching the end of a map. To do this, you must add the x, y coordinates to the tag:

<mapLeft:mapId,x,y>




1.jpg


Optionally in addition to the coordinates, it is possible to determine the player's direction after teleportation. To do this, add the direction just after the coordinate:

<mapLeft:mapId,x,y,direction>​

Direction code:

  • 2 = low;
  • 4 = left;
  • 6 = right;
  • 8 = above;

If you want to disable teleportation on one end of the map (or all), the developer can use the plugin's commands to do so.




comandosplugin.jpg






Setting the teleportation range: By default, the player is teleported to another map whenever he reaches the edge of the map he is on. In some cases, it may be interesting for the player to be teleported before reaching the edge of the map. When this is the case, the developer can define a distance from the edge of the map at which the player's teleportation to the next map is activated.




margin.jpg


When the player reaches the edge of a map, he is transported to the next map at a distance equal to the edge of the map to which he was teleported. If there is no defined margin on this new map, it is teleported to the edge of this map.
This is too good! Can you make also a new effect transition like some Zelda games? So if you touch an edge, you see how you are moving to the next map and both maps scrolls to the direction the player touched.

And about the plugin itself, I think there can be an inconsistence for diagonal movement, what if you touch a corner of a map? Following your example, if the player moves diagonally from the map of the center to NE corner, it should be teleported at the SW corner of the NE map, do you know what I mean?

I'm sorry since I can't test it right now, just giving my feedback, sorry if already exists that 🙂
This is too good! Can you make also a new effect transition like some Zelda games? So if you touch an edge, you see how you are moving to the next map and both maps scrolls to the direction the player touched.

And about the plugin itself, I think there can be an inconsistence for diagonal movement, what if you touch a corner of a map? Following your example, if the player moves diagonally from the map of the center to NE corner, it should be teleported at the SW corner of the NE map, do you know what I mean?

I'm sorry since I can't test it right now, just giving my feedback, sorry if already exists that 🙂

This code should not work for diagonal movement. It would be necessary to create at least 4 new tags. It is not difficult to do.

The Zelda-style transition is quite interesting. I thought about doing that at the beginning of this project, but I discovered that something like this already exists.

Thanks for the feedback. I will think of your ideas for a future update!
I just use common events with regions for that sort of transfer but you definitely have an interesting option to use instead. I'll keep this in mind 🙂
I just use common events with regions for that sort of transfer but you definitely have an interesting option to use instead. I'll keep this in mind 🙂

I'm happy for that. I also had this kind of situation before creating this script. Using too many events for something like this is not practical.

If it is of interest to you there is another script that addresses this subject in a more punctual and flexible way: teleportation by regions.

Original thread: https://forums.rpgmakerweb.com/threads/maptrixadvanced-teleport-at-the-edges-of-the-map.128320/