Look at the middle and left screenshot. These both are common events (
not parallel process common events). On the right, you see one of the common events are called by a goblin event. That screenshot is of an event that is in parallel process mode. Let me explain the left screenshot. Once I explain that, the middle is a carbon copy with key differences I will explain.
As you know, you search for the X and Y of an event. If you noticed, in "Spawn 1 X-Coord" variable, it looks for "This event's Map X." If you look on the right screenshot of the goblin, you'll see that I'm calling the common event. "This event's Map X" makes it so the common event searches the X-Coord of whatever event that calls it. This way, the event knows what event to search for without you having to manually do it (AKA copy/paste the entire common event in every event that does a distance check).
Now, you might be wondering why it doesn't check for player X and Y and you might also wonder why Im subtracting Spawn 1's Y-Coord with Player's Y-Coord and doing the same for X.
Why the common events don't check for Player's position?
I have another common event (that is parallel process) that continuously checks the X and Y coord of the player.
I recommend doing this for what I'm currently teaching you.
Why are you subtracting the variables?
Subtracting gives you the difference in X and Y coord from the player and the spawn. Which way you subtract does not matter as it'll always be positive.
Positive?
I subtracted player's X-Coord from event's X-Coord. Thus, I will check if the event's X-Coord is less than 0 and if so, multiply it by -1 so that it will always be positive. It's a math rule - "Distance is always positive."
Now, continuing on...
Finally, I add the event's X and Y which, by this point, should give me the total distance in squares between the player and the event. I added the Y to the X, therefore, I check for the value of X-Coord.
I have it as equal to or less than 7. In place of 7, you could make another variable. If you look at the right screenshot, I could've made a variable equal to 7 and then replace 7 in my common event with the variable (sorry if I confused you with saying 7 a lot).
Where you would put this? Right before you call the common event.
Now for the middle screenshot
The only difference you need to know is to use different variables for the event's X and Y coord. The left and middle are two different common events. I copied it only once allowing me to check the distance of two events at a time, but I'm probably going to copy it about 10+ times by the end of my game's development.
Lastly, you might be curious about the self-switch
Self-Switch works like "This event's X-Coord." It turns on the self-switch of the event that calls it. In the context of my game, self switch A opens the 2nd tab of the goblin. Movement type is "Approach" and I personally put 2x speed with highest frequency. 1st tab is just put as "random" but you can edit either however you like.
I got too lazy to crop but there you go. "Erase Event" may be important depending on your goal with using this. The Trigger for the events depends on your goal, but for me, it is "Event Touch."
Hope this helps. Let me know if you have any questions.
Important note: This is from Rpg maker XP but it should look exactly like how I have it regardless if using Vx, Vx Ace, or MV (I think the color coding is different in MV tho).