How to dynamically access the original position of an event?

After a map is loaded and its events have moved around, is it possible to get a given event's original position (the coordinates it is placed at on the map) through scripting and referring to it by ID? For example, to reset it back to its original position.

I'm aware this can be done beforehand through Set Event Location but I'm curious if it can be done dynamically as I wasn't able to find a corresponding function in the script master list.
$dataMap.events[ID].x or .y should be the coordinates assigned to the event as saved in your database.
not directly, because old positions are never stored.

you could either manually store the position into two variables before moving the event (this is pure eventing), or you could load the map into a new structure and read it from there (plugin needed), or you could implement a plugin for a movement history.

as far as I know neither such plugin exists, and they wouldhave to be written.

EDIT: or the solution above if it works...
$dataMap.events[id of event].x/y
They're not stored in the event object or the map object, but they can be accessed with these script calls:

Code:
$dataMap.events[id].x
$dataMap.events[id].x

replace id with the eventId of your event
not directly, because old positions are never stored.
Well, without using any event saving plugins, they always reset to their default position when you reload the map, right? Which means it must be stored someplace.
Well, without using any event saving plugins, they always reset to their default position when you reload the map, right? Which means it must be stored someplace.
I assumed that event starting locations were stored in the map json files but I didn't actually check.
I assumed that event starting locations were stored in the map json files but I didn't actually check.
That's what $data-anything is, the values read in from the JSON (database) files.
That's what $data-anything is, the values read in from the JSON (database) files.
Thanks sm. This should work, I think I was overly fixated on the $gameMap that I didn't think to check $dataMap!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-dynamically-access-the-original-position-of-an-event.164263/