How to make a teleport by region number to another map.

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!
You can use script calls:
Something like this?

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!
I haven't watched this for a long time, but does this video tutorial help?



I recreated this entire series of tutorials and I learned a TON!
I need the character to teleport from a changing specific region number to the same number but on a different map.
that is basically impossible, you need to add a specification there.

Only the current map exists in memory, no other map. that means you cannot analyse the target map to determine a target point.

you can make a list somewhere which region on the current map has which destination on a different map. But that needs a predetermined coordinate, NOT a condition "same region".

You can split the function however - once the player is on the target, an event there can teleport it inside the map again before the player gets control (and a fadeout /fadein can hide the second teleport).
that is basically impossible, you need to add a specification there.

Only the current map exists in memory, no other map. that means you cannot analyse the target map to determine a target point.

you can make a list somewhere which region on the current map has which destination on a different map. But that needs a predetermined coordinate, NOT a condition "same region".

You can split the function however - once the player is on the target, an event there can teleport it inside the map again before the player gets control (and a fadeout /fadein can hide the second teleport).
If I have two identical maps, I can save the coordinates and move to the same point from where I teleported, but to another map.
But the fact is that the maps are different and I can teleport into a wall or furniture.

Therefore, I need to split into regions and appear approximately in the area from where I teleported. Let's say I can switch to another map and I have the number of the region to jump to.
But for that, I need the coordinates of the map. How can i get location info (Tile ID) from region ID????
I haven't watched this for a long time, but does this video tutorial help?



I recreated this entire series of tutorials and I learned a TON!

Thanks, but that's not exactly what I need!
I move to another map and try to move the character according to the coordinates assigned to the variables by this script,

x = $gameMap.regionId($gameVariables.value(0002)).x
y = $gameMap.regionId($gameVariables.value(0002)).y
but it moves me to 0,0. it does not recognize variable 2, although I check the text there is a value there.
How can i get location info (Tile ID) from region ID????
You can get tile region id's by event command "Get Location Info...", but still you need to check the tile or coordinates of event or by variables, you can't just "find" on which coordinates is region = X.
You can get tile region id's by event command "Get Location Info...", but still you need to check the tile or coordinates of event or by variables, you can't just "find" on which coordinates is region = X.
It is sad. You can pack the map coordinates into the region, but you cannot unpack them)
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".
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".
I think players will like to take small steps around the room and look for a good place 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".
that's what happens if I teleport to the coordinates of the map.

I do not know how to make loops, unfortunately I am not a programmer. I was just trying to randomly assemble a script from the Archeia script calls suggested above)
You need to teleport from 15 to 15
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.
Yes, it's probably too early for me to do this yet. thank you!
But for that, I need the coordinates of the map.
as I said, you don't.

you can read off the coordinates in the editor and store it somewhere else to use, because you don't have any access to the other maps.

you can fade out, store whatever current coordinates you want in variables, teleport to a fixed point on the other map and have an event run on the other map to determine a teleport tatget inside that map and teleport there before fading in.

or you can program a plugin that can read other maps, but that would be an extreme resource hog as two maps would have to be loaded at the same time. and you could only access that other map by scriupt commands, not by event commands.
How can i determine a teleport target inside that map?

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-a-teleport-by-region-number-to-another-map.164656/