SCRIPT FOR "GET" CHARACTERIMAGE

Posts

Pages: 1
Using RPG Maker MV - I'm trying to use animations (shaking head, laughing, etc) for my party members, but my party members are going to be selected from a large pool of actors so I need to be able to do this without referencing specific files for the animations.

Is there a script that could return the filename and index number of a certain actors CharacterImage? Alternatively, is there a way to change the index number of an actors CharacterImage within the same file?



> Alternatively, is there a way to change the index number of an actors CharacterImage within the same file?


I think this is your best approach. Use one character sheet for each character and put the behaviour animations in the same place for each.

In Game_Actor, there are these functions:
characterName()
characterIndex()
setCharacterImage(characterName, characterIndex)

So for a script call you'd want:
const a = $gameActors.actor(id_of_actor);
a.setCharacterImage(a.characterName(), index_you_want);

And remember you can use $gameVariables.value(id_of_variable) to use variables to parameterize your script call.
Pages: 1