MZ how to make a sprite/face change when under a state?

when a character is poisoned or sleeping or whatever i want their portrait to change to reflect that. originally i was going to have a common variable that changed their portrait whenever they were under a state but that doesn't seem to be an option. i would also like to have this available for enemies but i think those would be two different problems. anyway, advice on how to do this or if there is a more efficient way to do this would be helpful
Moved to: Plugin Requests
Check out Yanfly's Buffs & States Core, you can use Custom Apply and Custom Remove effects to change the actor's portrait.
Check out Yanfly's Buffs & States Core, you can use Custom Apply and Custom Remove effects to change the actor's portrait.
That's a plugin meant for RPGmaker mv, I'm using MZ.
That's a plugin meant for RPGmaker mv, I'm using MZ.
So you are. Well, you could either try it via FOSSIL, or look at the VisuStella equivalent.
So you are. Well, you could either try it via FOSSIL, or look at the VisuStella equivalent.
well this is embarrassing, it seems like fossil will let me use the yanfly plugin but i don't actually know what code to put in to change the portraits.
user.setFaceImage("filename", index);

The easiest way to do it would be to make everyone's unhappy poisoned face be in the same faceset as their original portrait, in the same position (index) as each other. Then you can do:
Code:
user.setFaceImage(user._faceName, index);
and just have to specify the index, and it will work for all actors.

I haven't looked up that function in the MZ library, so I'm presuming it didn't change. If you get an error, you may have to just look up the MZ equivalent.
user.setFaceImage("filename", index);

The easiest way to do it would be to make everyone's unhappy poisoned face be in the same faceset as their original portrait, in the same position (index) as each other. Then you can do:
Code:
user.setFaceImage(user._faceName, index);
and just have to specify the index, and it will work for all actors.

I haven't looked up that function in the MZ library, so I'm presuming it didn't change. If you get an error, you may have to just look up the MZ equivalent.
thanks! this works

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-a-sprite-face-change-when-under-a-state.140989/