How to make a teleport by region number to another map.
Or how to find the coordinates of the map by region number (variable with region number)
Or a script or plugin, please advise!
That's not it. There are definitely constant parameters set here.
I need the character to teleport from a changing specific region number to the same number but on a different map.
I can enter the region number into a variable on one map, but I can't find how to call the region number on another map, and assign it the coordinates of the map on which it is located. And then teleport the character there.
I'm not a programmer at all, but I think I need something like this 🙂
$gamePlayer.swap($gameMap.region($gameVariables.value(2)));
where variable 2 is the region number with the previous map.
If someone knows how to correct it, please tell me!
So you have marked the empty spots with no walls/furniture with region ids and you want to appear in a similar map to the same area in an empty space?
-when the player teleports save player x and player y in variables 1 and 2
-fade out screen
-transport the player to the new map in any random place
-start a loop checking the region id of tiles in the new map, starting from the coordinate that you saved earlier (subtract some number from it, so you'll check left and right), going forward some number in the x direction before changing the row)
-when you find the correct region id, save that tile coordinate and transport player there
-fade in screen
EDIT: You can put a failsafe, if you don't find a correct spot, transport player back to original map and show text: "this is a bad spot to teleport".
Well, maybe you can make it so that when you teleport you make the player transparent and immobile. Then you transport the player to the new map in the exact same coordinate as old map. Then you throw an event (through on) with player picture on top of the player and put a parallel event on where you can move the event with conditional button presses. And then with action button you can choose the spot to teleport. Before that you check the distance of the event to the transparent player and if it's too far, you show text "choose a closer location".
sorry, I don't know how to delete an empty post
Well, I suggest you do some tutorials before trying to make more complicated events. Learn to do loops for example.
How can i determine a teleport target inside that map?