MZ Changing an actor's battle portrait when a state is applied (VisuStella)

Hello,

I'm using RPG Maker MZ and VisuStella's plugins and I'm wondering if there's a command or code to change an actor's battle portrait when a state is applied (since I'm using the Portrait style for the Battle Layout). I've looked for it in both the plugin's help and the wiki but couldn't find anything. I'm a total noob when it comes to coding :elswt:

Zrzut ekranu 2024-03-31 193714b.png


My character uses a skill that changes him into a unicorn (adds Unicorn State) and while I have a working system to change the battler I have no idea how to change the Battle Portrait. I created a common event to switch his graphics when the state is applied and after it expires.

Zrzut ekranu 2024-03-31 193732b.png


This is the code I have for the Unicorn State:

Code:
<JS On Add State>
  $gameTemp.reserveCommonEvent(24);
</JS On Add State>
<JS On Erase State>
  $gameTemp.reserveCommonEvent(25);
</JS On Erase State>
<JS On Expire State>
  $gameTemp.reserveCommonEvent(25);
</JS On Expire State>
You did change the face in the common event, but it didnt update, right?

This is a shot in the dark, but did you try removing them from the party before changing the image, and then add them again straight after? Hopefully this reloads the image. Play an animation over the battler while you reload it, to hide that the actor is raking from the party for a few frames.

Its a total shot in the dark, but this is what I would try.

Edit: if the actor has high agility and attacked this round before the state got applied, it might be able tobattack again that round after you removed it from the party for a split second.
VisuStella action sequence has ANIM: Change Battle Portrait
You did change the face in the common event, but it didnt update, right?

This is a shot in the dark, but did you try removing them from the party before changing the image, and then add them again straight after? Hopefully this reloads the image. Play an animation over the battler while you reload it, to hide that the actor is raking from the party for a few frames.

Its a total shot in the dark, but this is what I would try.

Edit: if the actor has high agility and attacked this round before the state got applied, it might be able tobattack again that round after you removed it from the party for a split second.
I did change the actor's face in a common event and it works. The problem is that I'm using a battle portrait instead of a face image. Thank you for the suggestion though!
VisuStella action sequence has ANIM: Change Battle Portrait
Oh, thank you! I didn't know about that!

Original thread: https://forums.rpgmakerweb.com/threads/changing-an-actors-battle-portrait-when-a-state-is-applied-visustella.167352/