RPGM Change sprite help

LostWisdom

Member
Game Developer
Aug 3, 2017
179
380
I have one last feature I'm trying to add into my demo. Change the player actors sprite based on his equiped gear. I made it a common event using conditional branches. If he wears certain things the sprite changes properly but othertimes it doesn't. I'm sure I've just set it up poorly since I'm an artist not a code guy. It's not a huge problem. But if anyone had any advice I'd appreciate it.

event.png

In game testing recognizes the worn outfit alone, worn outfit and eyepatch, eyepatch alone, headband alone.
 

redknight00

I want to break free
Staff member
Moderator
Modder
Apr 30, 2017
4,528
19,892
You can save the item names in a variable (one for each kind of gear) and just make one common event running when you close the menu, change equip or whatever is most convenient with:

JavaScript:
$gameActors.actor(id).setCharacterImage("Actor"+$gameVariables.value(n)+...,1)
$gameActors.actor(id).setBattlerImage("Actor"+$gameVariables.value(n)+...,1)
$gamePlayer.refresh()
Of course, you could try a plugin, but personally I never investigated this kind of thing.
 
  • Like
Reactions: LostWisdom

LostWisdom

Member
Game Developer
Aug 3, 2017
179
380
You can save the item names in a variable (one for each kind of gear) and just make one common event running when you close the menu, change equip or whatever is most convenient with:

JavaScript:
$gameActors.actor(id).setCharacterImage("Actor"+$gameVariables.value(n)+...,1)
$gameActors.actor(id).setBattlerImage("Actor"+$gameVariables.value(n)+...,1)
$gamePlayer.refresh()
Of course, you could try a plugin, but personally I never investigated this kind of thing.
I'm gonna try this out, thank you for the reply : )