Teleporting npc common event problem

Alright so i made a panic system and if it reaches x amount of variables, i want it to make a certain npc appear that chases you down.
I made it so it appears by random variable coordinates but thats just a temporary solution.
There are problems with it for example the npc "spawns" outside of the players perspective so it doesn't start chasing.
Also it often teleports outside of walkable tilesets so i had to make it either through or above player but neither works because
thatway he doesn't interact with the player just floats above or through. as it's interaction is through event touch
It's an event that persists through most of the maps so i made every map have event nr 10
Prepared for this.
Any ideas are welcome for improving it.
thanks in advance 🙂
Basically you need to check the coordinates before transfering the event there - that cen be done by "get location info" and several variables.


However, this will only work correctly if you prepare the map for it - which is difficult to do if you don't know the map the player currently is on.


I can think of two or three ways to make it, but they all require a lot of extra work.


1) mark the map with regions


Basically the event starts by checking the region the player currently is in and the event is only allowed to teleport to coordinates with the same region code.


That way you can keep inpassable tiles at region 0 and switch region at obstacles that would prevent a chase.


2) Store possible target coordinates map dependent - requires some form of storage script and a way to read coordinates for the map


3) us a pathfinding script to check if there is a path between the player and a random target coordinate.
Basically you need to check the coordinates before transfering the event there - that cen be done by "get location info" and several variables.

However, this will only work correctly if you prepare the map for it - which is difficult to do if you don't know the map the player currently is on.

I can think of two or three ways to make it, but they all require a lot of extra work.

1) mark the map with regions

Basically the event starts by checking the region the player currently is in and the event is only allowed to teleport to coordinates with the same region code.

That way you can keep inpassable tiles at region 0 and switch region at obstacles that would prevent a chase.

2) Store possible target coordinates map dependent - requires some form of storage script and a way to read coordinates for the map

3) us a pathfinding script to check if there is a path between the player and a random target coordinate.
Ooh thank you.

(I've used rpg makervx for years and never used get location info before 😛 )

Ill use the region version it ll solve all my troubles 🙂
I've moved this thread to Support RPG Maker VX Ace. Please be sure to post your threads in the correct forum next time. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/teleporting-npc-common-event-problem.41950/