How to check current location of event?

Hi,

I'm very new to RPG maker, but I'm trying to create a little puzzle where the player has to move a crate into the correct spot on the map. The crate is an event that the player can either push or pull in any direction. This portion works well, however there doesn't seem to be a built in method of checking the current location of an event (the crate) to see if it has reached the correct position.
See my uploaded file for the event handler.

Does anyone have a suggestion on how I can achieve this?
there is a build-in method - use control variable to get the X and Y coordinates of any event into the variable, then use conditional branch to check the value of the variable
Code:
$gameMap.event(this.eventId()).x
$gameMap.event(this.eventId()).y

$gamePlayer.x
$gamePlayer.y
Thanks guys! I ended up using one of GALV's plugins to resolve the issue. I see those use much the same script as you were referring to. Andar; thanks for the links in your signature, there is a lot of useful information there to sift through.

Issue resolved🙂

Original thread: https://forums.rpgmakerweb.com/threads/how-to-check-current-location-of-event.75531/