JS to return the player location on the map?

I have this command for example:


$gameVariables.setValue(101,SceneManager._scene._spriteset._characterSprites[0].x);

...That I can use to find the screen coordinates of a specific event on the map.

Problem is, when it comes to locating the player on the map, the player is always assigned the last number on the sprite array.

I suppose I could bypass this by always having the same number of events on every map, but that would be a giant PITA and I'd prefer not to.

Is there a JS call that can identify the location of the player on the map through a means other than the SceneManager?

Thanks in advance.
Couldn't you use a common event instead? Using variables you can create a player location event.
PHP:
$gamePlayer.x
$gameMap.event(4).x
$gamePlayer._followers._data[1].x

Code:
https://docs.google.com/spreadsheets/d/1-Oa0cRGpjC8L5JO8vdMwOaYMKO75dtfKDOetnvh7OHs/edit#gid=0
Map coordinates:
Code:
$gamePlayer.x
Screen coordinates:
Code:
$gamePlayer.screenX()
Don't use scene manager for this at all.
Map coordinates:
Code:
$gamePlayer.x

Oh derp...

I tried this exact command, but with a capital "g".

Thanks for the help, all. 🙂
Oh derp...

I tried this exact command, but with a capital "g".

Thanks for the help, all. 🙂
you can tape
PHP:
window
in the debug console, you will have full lists of all master class variable to get what you need.
Is the core of rmmv
you can tape
PHP:
window
in the debug console, you will have full lists of all master class variable to get what you need.
Is the core of rmmv

Yeah, I had done that, then capitalized the "g" anyway.

This is what I get for skipping the coffee this morning. 😛

Original thread: https://forums.rpgmakerweb.com/threads/js-to-return-the-player-location-on-the-map.85309/