I've done this before with a region common event plug-in. What you do is you mark all zones that are out of bounds with a region, then set it up so that if the player is ever there the engine will run a common event. Use the event to do what you need to do (teleport back).
The only thing is this requires the out of bounds tiles to still be visible and on the map, so you will have to map at least 1 tile of boundary drawn in the editor.
Hello bgillisp! Thank you for the advice, but I don't think its possible to draw regions outside the edge of the map.
If my map size is 10x10 and a enemy has pushed the player to 10x11
Right, you'll have to make the map 1 tile bigger in all directions and add the regions then. That's what I meant by draw the boundary too.
Outside of that there might be a parallel process you can code which will check the player X/Y and return them, then you can do something if they are invalid, but I have no idea if it will let you return values for outside the map completely.
Though...design note. Almost no one uses the edge of the map for anything but transfer to another map, so your player really should never be on tile 10 of a 10x10 map so that they can get pushed to tile 11. Failure to follow that rule will usually just confuse the player in the long run.
Its good to know, thank you. I appreciate 🙂
But in this case this wont work, it will only move my problem 1 tile.
Do you know of a way to check if player is not inside of the 10x10 map?
No. And why would it move the problem 1 tile anyways? Most maps put a boundary at the edge so all you'd need is a region check at the boundary. Unless you have your player walking on the trees, rivers and such that are usually at the map edge.
Well the good things about games is that they are not the same. 😉
I have just a plain field with grass ( no trees or rivers) with a standard map size, in this scenario. And because the enemies are walking towards hero and giving him a bounce of jump +1 in the attack direction resulting in hero being thrown out of the map unable to get back in again. I figured it must be a easy way to check this. I guess I must google around a little more 🙂
Anyways thanks for your feedback
Ahh nice Caethyril. I will try it. 🙂
Hope it suffices! I didn't realise the engine allowed jumping into impassable tiles or out of the map, good to know~ 😤
I tried and it was a great success! Thanks, I cant find out how I didnt though of that myself, it was genius simple 😀
Great! Happy RPG Making~ 🙏