MZ How do i get the vehicle x and y?

I'm trying to figure out how to get the X and Y map info for my airship.
I can't seem to figure out how.
I can get it for the player and any event on the map, but not the vehichles.
I'm trying to figure out how to get the X and Y map info for my airship.
I can't seem to figure out how.
I can get it for the player and any event on the map, but not the vehichles.

Hi, @MikePjr

You can retrieve the coordinates of the ships in game variables via a script call in an event:
Code:
$gameVariables.setValue(1, $gameMap.vehicle('airship').x); // Variable 1 = X of airship
$gameVariables.setValue(2, $gameMap.vehicle('airship').y); // Variable 2 = Y of airship
Replace 1 and 2 after $gameVariables.setValue( with the variables you want to use.
In my example, it's for the airship, replace it with the vehicle you want.

Code:
$gameMap.vehicle('boat')
$gameMap.vehicle('ship')
$gameMap.vehicle('airship')
Thankyou. I very much appreciate the assist.
If you want to use a Control Variables command instead (which I would personally recommend, because it'll show you the variable's name in the event list instead of just its number), just put this into the Script box:

Code:
$gameMap.vehicle('airship').x

Of course, replace x with y as needed, and substitute the name of the vehicle as needed.
I appreciate all the help, thankyou!

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-get-the-vehicle-x-and-y.179543/