Change player sprite with a script

Hi,


What is the function to change the player's sprite with a script?


I am used to RPG maker XP, where I would use $game_party.actors[0] to refer to the player, but I can't work out what that would be in MV JavaScript.


I have tried $gameParty.members(0).setCharacter(str, 0);


Where str is my image name as a string, however this does not work.


Also, what order do the indexes go in for the second parameter in setCharacter?
$gamePlayer._characterName = "filename"
$gamePlayer._characterIndex = number


Number is 


df974abdabb6457093ed492e67f05436.png



edit: Note that this only changes the sprite of the player on the map, it doesn't change the player's sideview battler or anything.
Perfect, thank you.

Original thread: https://forums.rpgmakerweb.com/threads/change-player-sprite-with-a-script.62576/