Greetings! I was just wonder what the syntax would be in a script call to set a variable to an events X-coordinate or Y-coordinate. I had the similar code for RMVX used a few times, but I am not good with scripting and am not sure how to do this in MV. Thanks for any help~
Setting variables to Event coordinates
RPG Maker MV SupportVery nice. Thanks for the clear quick reply. Am I just crazy, or is this new to MV? I feel like that used to require a script call..
I know you could do this in VX Ace, but i've never used VX so I wouldn't know.
Ah, alrighty. In any case, thanks a ton. But just in case anyone else is wondering, I just checked out the topic of script calls (totally forgot it was there!) and figured out how to do it with a script call (which is a bit simpler I guess.)
that would be to go into "Control Variables" and then choosing "Script" and entering: $gameMap.events[n].x ->To store the event's X value in the variable, or $gameMap.events[n].y ->To store the event's Y value in the variable. With [n] being replaced with the Event's ID (For example: $gameMap.events[001].x)
EDIT: Also, keep in mind that this would only apply to the current map. Since every map has its own Event 001, for example, you can't just put in an ID of an event on a different map from the player/the event pointing to the variable, and expect it to work.
If anyone knows a way to get the ID of an event from a specific map, though, I'm all ears.
DOUBLE EDIT: It appears I may be wrong on this >.> The coordinates seem to always be off by 1 or 2 when I use this method. I'll stick to Kirikaz's method for now haha.
Original thread: https://forums.rpgmakerweb.com/threads/setting-variables-to-event-coordinates.48031/