I assume this is possible via JavaScript; I want to ask an event to get its own X position and own Y position, and store those in variables.
I can't say "get X and Y of event #24"; this is a script page within event #24 and I want to be able to say something like:
Variable 250 = self.x
or something to that effect.
Can that be done?
$gameMap.event(eventId).x
$gameMap.event(eventId).y
with those two script calls you can get x and y (position of event) - set to your game variables and done.
or $gameMap.event(this._eventId).x, but basicly it's the same, but looks more nice.
I understand what you're getting at - it just confused the issue when you said explicitly "this is a script within event #24" as opposed to "this script can be called by different events" or something.
But it's all good, you should be set 🙂
Um ...
Control Variables > Game Data > Character [This Event]'s > Map X
Control Variables > Game Data > Character [This Event]'s > Map Y
No need for script calls at all.
Note, if you are storing it into variables, you'd only want to do it (via either method) on a single event, or if multiple events, don't have them on parallel process. Otherwise one event will set them and another may override them before the first event actually uses them.
They will run parallel in that one command in one event will be processed, then one command in the next event, and the next event and so on until all parallel events have had one command processed. Then the next command in each will be run, then the next command in each.
Things that might alter this is if an event has a command that has to wait for something, such as a wait command, a move route that has to wait for a step to be completed before taking the next step, etc. In that case, the event will not run its next command until the previous command has completed.
If an event has a Common Event command, it will be as if all the events in that common event were copied and pasted into the event that is calling it, so those commands will be run in turn, and after that the calling event's commands will resume.
Multiple autorun events will queue up, so if you have two of them, the one with the lowest event id will run first, and when it is disabled, the next one will run.
And that is more than you ever wanted to know about parallel events 😀