I'm trying to work out a teleportation skill for my game, and I was wondering if it's possible to detect whether or not a given set of coordinates in a given map contains a 'passable' terrain type. This is an issue, because currently it is very easy to get stuck inside of a wall or outside the boundary of the map, being unable to move on account of the terrain not being passable.
If it's at all possible, I want to have the teleportation event detect whether or not the targeted tile is passable, and refuse to teleport the player if it isn't. Is there a way, perhaps with a plugin, that this can be accomplished?
it will require a plugin because by default only the current map is loaded into memory.
you'll need a plugin that is capable of loading the data from other maps to be able to check them.
however, it might help if you tell us how you plan to target the teleport anyway - because usually teleports work with fixed coordinates exactly to prevent this hassle, and there are already several other solutions around this available.
With help of the above Scriptline he could do:
If he manualy fades out the screen and make a teleport without fade, than just check the passability after the teleport,
and teleport back to other map if its not passable, or check the tiles next to that position and teleport player to there instead.
Than "Fade in" the Screen again.
Okay, so I just fade out the screen, send the player on their way, run that script, and just send them back if they are inside a wall, and fade it in again. Thanks.
If you're curious, the way I'm handling this teleport skill is really unusual. When it's used, the player gets transferred to a separate little map with a space background, where they need to configure a bunch of stars which translate to a map ID and coordinates via ternary code. (no star, small star, big star.) Then they enter the portal on the bottom right of the screen, and get teleported to wherever the configuration of stars points to.
Yes, I know it's a really convoluted way to do it. It's supposed to be.