[SOLVED] Scripted actor spriteset change

Hello everyone,

I recently switched from RPG Maker VX Ace to MV. In VX Ace I could use a script call in an event to change the sprite sheet for an actor, allowing me to dynamically change sprite sheet using variables. Like this:

In one event I call this script.
Code:
$newSprite = newSpriteFile

And then, in an event later I could change the actor's sprite sheet to the one defined in the $newSprite variable (and leave the face graphic unchanged) like this.
Code:
$game_actors[1].set_graphic($newSprite,0,$game_actors[1].face_name, $game_actors[1].face_index)

And now I was wondering, is there a JavaScript variant of this code to change actor sprite sheet for MV?

Thanks!
It's an option in the event panel, page three. Change actor image. It's in the move route options too, change image. (it doesn't HAVE to be an actor image either, if I recall it works for the event too in the move route)
It's an option in the event panel, page three. Change actor image. It's in the move route options too, change image. (it doesn't HAVE to be an actor image either, if I recall it works for the event too in the move route)
Thanks for your reply. But this isn't quite what I want to achieve. This method only allows me to statically change the graphic to a single new file. (The only way around this is using a lot of nested conditional branches, what gets very messy and confusing quickly).

Like I explained in my post, I wish to find a JavaScript version of this VX Ace RGSS3 code for MV.
Code:
$game_actors[1].set_graphic($newSprite,0,$game_actors[1].face_name, $game_actors[1].face_index)

Code that I can call using this button:
wGebf7N.png
In MV, It's really similar!
Well, we have two methods!

Code:
$gameActors.actor(id).setCharacterImage(characterName, index)
$gameActors.actor(id).setFaceImage(faceName, index)

One for faces and one for the character sheet!
So, if you want to change the image of the actor 3:

Code:
$gameActors.actor(3).setCharacterImage('Actor2', 5)
$gamePlayer.refresh()

Remember the $gamePlayer.refresh() at the end of the script!
In MV, It's really similar!
Well, we have two methods!

Code:
$gameActors.actor(id).setCharacterImage(characterName, index)
$gameActors.actor(id).setFaceImage(faceName, index)

One for faces and one for the character sheet!
So, if you want to change the image of the actor 3:

Code:
$gameActors.actor(3).setCharacterImage('Actor2', 5)
$gamePlayer.refresh()

Remember the $gamePlayer.refresh() at the end of the script!
Perfect! This is exactly what I was looking for. Thank you so much!
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/solved-scripted-actor-spriteset-change.82369/