Checking Player Proximity to an Event

I really appreciate all the helpful tips!!

This is what I found that was simplest and accomplished exactly what I was looking to do:

View attachment 241469

Referenced thread: https://forums.rpgmakerweb.com/index.php?threads/how-to-check-player-proximity-to-event.146996/post-1302915

This is exactly what I was looking for, and I translated it into XP's commands. Unfortunately It isn't running for me. No errors appear when starting up, but the sound does not cue when I approach the event, and the self switch doesn't happen. Am i missing something? Does a significant change have to happen to work in XP?

Please let me know if this is in the wrong place, this is my first time posting to the rpg maker forums.
1748484337806.png
1748484364706.png
This thread was moved from RPG Maker MV Support to RPG Maker XP Support. Welcome to the forum, have fun and good luck!
@St4rG0re

Don't know if you already solved your problem but if not, here is your solution:

You have 3 errors in your code.

1. After assigning the player's X/Y coordinates to your variables ("0010 - Player X" and "0011 - Player Y"), you immediately assign the current event's X/Y coordinates to the same variables. Instead, you need to subtract your variables with the current event's X/Y coordinates.

2. In your first 2 conditional branches, you are checking if your variables are equal to 0. Instead, you need to check if your variables are lower (<) than 0. Otherwise, the "multiply by -1"command doesn't make sense. The whole point of it is to transform a negative number to a positive one, in case the coordinates of your player are lower than the ones of your current event (player is on the left to and/or above the event on the map). Because in the last conditional branches, only a positive number is checked. If you wouldn't make the steps with the "multiplay by -1", then the code, without additional checks for negative numbers, would only work if the player is on the right to and/or below the event on the map.

3. In your last conditionals branches, you check if your variables are equal to 3. You have to check if they are lower or "equal or lower" than 3, depending on what your goal is. Otherwise, your code will only work if the player has a distance of 3 tiles (X and Y) to the event. This is bad because it will not work in some constellations like if the player approaches the event with an already smaller distance than 3 tiles on one axis.

Hope that helps.
I didn't find any script for RMXP that has the terms of use included, so I'll just pass on the method made by events:

Here is the same logic, but applied to Rm2k/2k3, so just redo it on RMXP:

Here is a method made with RMVXAce events, also just redo it in RMXP:

Original thread: https://forums.rpgmakerweb.com/threads/checking-player-proximity-to-an-event.178002/