I think this is possible but I am not sure how to. How do I set this up?
How to make variable that tracks location of player?
RPG Maker MV SupportYou use a parallel process event with a control variables event. It is all already in there. You just have to assign the player position to the variables.
for one-time checks (like checking before a specified common event is triggered or so), you'll simply use control variable command (game data option) directly before the part where the position is needed.
To keep track of the position permanently, you should place two control variable command (for X and Y) and a wait command into a common event parallel process.
The number of waits on that parallel process is something you need to experiment with - probably around 10 frames or so.
Without waits, the parallel process is executed sixty times per second - faster than the player can move, and that will create a lot of lag.
Too many waits, and it might be that the changing position is not update in time for whatever needs the info.
To keep track of the position permanently, you should place two control variable command (for X and Y) and a wait command into a common event parallel process.
The number of waits on that parallel process is something you need to experiment with - probably around 10 frames or so.
Without waits, the parallel process is executed sixty times per second - faster than the player can move, and that will create a lot of lag.
Too many waits, and it might be that the changing position is not update in time for whatever needs the info.
Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-variable-that-tracks-location-of-player.79168/