Attempting to change character portrait on state change and it feels impossible.

I do apologize as i am brand-new to this site apart from the occasional visit for a solution to my problem.
But im attempting to make a system that auto updates a characters portrait when they receive a state. In my use case it is when they 'die'. Figured out quickly that it can't be done in the default engine and i found this Yanfly tip which is exactly what im looking for but i cant get it working. Am i doing something wrong or am i cooked.
I would greatly appreciate any/all help
well... what have you done?
we cant know where you may have went wrong if you dont show what you did

show what changes have you made. then say what exactly were you expecting from it and what happened afterwards
There have also been a lot of threads about this - have you Googled it, read through any of them?

But yes, step one would be showing us what you have.
I have googled it to limited success, i mean it did get me this far which isn't nothing. Its probably just me not being the brightest tbh. The first time i tried was running a parallel common event in a battle. I set the span to moment and made it active when the first party member is at or below 100% Hp.
I was bumping into freezing but now nothing happns. This is the common event, dont mind how theres two of everything i have two different sets of the same characters that are in the party at specific times.

1000000081.png
1000000082.png


Then after finding no success elsewhere i tried setting it up how Yanfly did it. I probably messed up the code but i haven't been able to get that too work.
I have attatched a pdf below that shows the code that im running in the note tag of the state that gets applied when a character is KO'd. Sorry for any confusion
The first time i tried was running a parallel common event in a battle
parallel common events do not run in battle without a plugin to enable it actually.
I set the span to moment and made it active when the first party member is at or below 100% Hp.
parallel event? or troop event? is a troop event calling the common event? common events do not have spans, and judging the size of the contents area what you haven isnt a troop event.

I have attatched a pdf below that shows the code that im running in the note tag of the state that gets applied when a character is KO'd. Sorry for any confusion
if you click the toolbar at the top of the text area, theres an option for code. theres no need to share it as a pdf. use that in the future

you have 8 actors and theyre sharing sprite sheets? in my opinion, it would be easier to manage it by giving each actor their own sprite sheets named with the actor's name. then instead of using all of those else-if statements for each actor, you can change it to use the file that has the actor's name and use the correct index for for the state.

The more you interact with yanfly's "custom" notetags, the more it becomes a better idea to familiarize yourself with javascript as well as MV's script calls. if you need an example of what i described, you can ask for it
The first time i tried was running a parallel common event in a battle. I set the span to moment and made it active when the first party member is at or below 100% Hp.
You seem to be mixing up some terminology. You can't run parallel common events in battle. Troop events are not common events, and they're not parallel.

When posting screenshots of events, please don't crop off all the settings - you may want to read through the pinned rules thread for this section, which has good advice on how to get good help:

I have attatched a pdf below that shows the code that im running in the note tag of the state that gets applied when a character is KO'd.
Why? Just paste it into your post - who wants to download a separate file and open it up in another window for that? 😛

That's horrible overkill for what you want to do. But it also doesn't look like you're doing anything. You're just setting them to the default faces, only in a different order than they are by default. You don't have some specific dead face image you want to use?

Like, your event up there shows you changing them to the first face of Actor0, but that's not in your code anyplace.

There's no reason for you to be changing the battlers and character sprites, and no reason for all of those extraneous variables.

The code to do what you want should be pretty short - what's the correspondence between the actor ID and their index in the Actor0 face sheet? We can't see from your event what the actor IDs for each name are.

Original thread: https://forums.rpgmakerweb.com/threads/attempting-to-change-character-portrait-on-state-change-and-it-feels-impossible.172041/