Returning the X,Y Coordinates of an event on the map? (Get Location help)

I'm trying to find the coordinates of an event on the map (and ideally assign them to variables as X,Y as well).

But I'm very confused as to how to do this using the "Get Location" command.

Alternatively, is there a JS call that can assign the X,Y coords to variables? I found this:

"$gameMap.eventIdXy(x, y);"

...but I'm not sure how to turn that into usable coordinates.

Thanks in advance!
But I'm very confused as to how to do this using the "Get Location" command.
That is no wonder, because you can't get the coordinates of an event with "get location info". For get location info you need to have the XY and can then check what is there, but not the other way around.

You need to use control variable for what you want.
1) Make two variables for event x and event y
2) use control variable on event x variable, select "game data" from the data options (it defailts to map id, but that is not what you want).
3) hit the button to the right of "map data" to open up the game data options, select "character" as the next step
4) change from player to the event you want the data from, select map x as the detail
5) repeat 2-4 for "Map Y"
Use:
Control variables > Game Data > Character > Select your event in the drop down menu > Map X
The get location event command cannot do that.

The script call you're trying to use will give you the ids of the events that are at x,y. Not their coordinates.
If you need to do it with a script call, you can use:
Code:
$gameMap.event(eventId).x
$gameMap.event(eventId).y

Edit: ninjas everywhere I tell you.
Thanks, both!

I had completely forgotten about the game data dropdown menu!
That is no wonder, because you can't get the coordinates of an event with "get location info". For get location info you need to have the XY and can then check what is there, but not the other way around.

You need to use control variable for what you want.
1) Make two variables for event x and event y
2) use control variable on event x variable, select "game data" from the data options (it defailts to map id, but that is not what you want).
3) hit the button to the right of "map data" to open up the game data options, select "character" as the next step
4) change from player to the event you want the data from, select map x as the detail
5) repeat 2-4 for "Map Y"
I know this was 2 years ago, but once I've done this, how do I go about putting in a conditional branch to check if an event hits those coordinates it will be destroyed? Thanks in advance

Original thread: https://forums.rpgmakerweb.com/threads/returning-the-x-y-coordinates-of-an-event-on-the-map-get-location-help.78134/