MV Actor face change when getting hit in battle

I want the actor face to change into either 'ouch' face for a sec or just flashing red.
Some say it's doable with waynee95's custom face img eval plugin. Can anyone help me please?
changing the face at least is possible with the plugin. I'm not sure about flashing red tho. hmmm if you only want it for a second, you might have to make a dummy state and use something like Yanfly Action sequences to remove the state after the hit, but before the state ends...


<Custom Face Image Eval>

if (user.isStateAffected(31)) {

faceName = 'Actors';

faceIndex = 15;

}

</Custom Face Image Eval>

like this would be the eval though, just add a state when they get hit and say the filename which is faceName, and then the index which is whatever the face on the picture you want to use, remembering that it starts from 0. BUT, if you want it health based and don't mind if the face stays as long as the health is a certain amount...

if (user.hp / user.mhp <= 0.5) this makes is so if the player is at 50% or lower, the face changes.
changing the face at least is possible with the plugin. I'm not sure about flashing red tho. hmmm if you only want it for a second, you might have to make a dummy state and use something like Yanfly Action sequences to remove the state after the hit, but before the state ends...


<Custom Face Image Eval>

if (user.isStateAffected(31)) {

faceName = 'Actors';

faceIndex = 15;

}

</Custom Face Image Eval>

like this would be the eval though, just add a state when they get hit and say the filename which is faceName, and then the index which is whatever the face on the picture you want to use, remembering that it starts from 0. BUT, if you want it health based and don't mind if the face stays as long as the health is a certain amount...

if (user.hp / user.mhp <= 0.5) this makes is so if the player is at 50% or lower, the face changes.
Flashing red is fine since I can just change the face into a red tinted graphics. I was just giving an example lol
Does the damage happen before or after the state's application? If before, maybe it'll work with "removal by damage" option otherwise the face graphic will get stucked there for a whole turn.
So it's better to detect the reduction of current hp and set a timer for it? I'm not sure coz I suck with proper programming 🙁
I know my face changes when I get hit in combat. It gets dented...and scratched...and turns yellow and purple...

But seriously.

I think I would write a plugin extension that ties it into the gainHp function.

If that's too advanced (as you say you suck with proper programming), I think my next bet would be Action Sequences. You'd have to copy it between your skills, but that's just copy and pasting...it would be easy to implement there, and you wouldn't need the custom face plugin.

My next go to would be to make a passive state with a Custom Respond Effect that changes the face index (and if you set it up the right way, you should be able to use the same state/code for each actor). The only reason I list this after Action Sequences is because I would have to look up how to try to make the face stay for a moment before changing back. Maybe give it a Turn Start condition to change it back, if you're okay with the damage face sticking around for that long.

I'm really not sure how you would use that listed plugin to do this. That will change the face automatically when conditions evaluate as true, and I'm not sure how you'd achieve that at the moment of getting hit.
I know my face changes when I get hit in combat. It gets dented...and scratched...and turns yellow and purple...

But seriously.

I think I would write a plugin extension that ties it into the gainHp function.

If that's too advanced (as you say you suck with proper programming), I think my next bet would be Action Sequences. You'd have to copy it between your skills, but that's just copy and pasting...it would be easy to implement there, and you wouldn't need the custom face plugin.

My next go to would be to make a passive state with a Custom Respond Effect that changes the face index (and if you set it up the right way, you should be able to use the same state/code for each actor). The only reason I list this after Action Sequences is because I would have to look up how to try to make the face stay for a moment before changing back. Maybe give it a Turn Start condition to change it back, if you're okay with the damage face sticking around for that long.

I'm really not sure how you would use that listed plugin to do this. That will change the face automatically when conditions evaluate as true, and I'm not sure how you'd achieve that at the moment of getting hit.
Looks like i can cheat it out with a dummy state and action sequence. Thanks mate.

Original thread: https://forums.rpgmakerweb.com/threads/actor-face-change-when-getting-hit-in-battle.142352/