VXAce check if non-specific party member has state?

For my project, I am currently using a common event in combat to save the party's actor IDs as variables, which maintains their order in the party.

For use in conditional branches, I am able to check if a specific party member has a state applied, but I can't seem to find a way to determine if these variables are inflicted with a state, (example: finding if party member 3 has the sleep state, regardless of which character is third in the party)

Is there a way to do this without scripting? and if not, how would I go about scripting this? I am very new to all of this stuff lol.
Hello and welcome,

The only way I could think of that would not use any script call would be to do a conditional branch for each value of the variable, which can be tedious. (if third party id is 1, then check actor 1, if it's 2, then check actor 2 etc.)

As such, I would recommend using this script call instead in your conditional branch:
$game_party.members[x].state?(id)
With x the position in the party (here 3), and id the id of the state you want to check.
Thank you so much for your help!

I tried out your script call and it works exactly as you said! However, but it doesn't seem to ever run the "Else" when the condition is not met. Is there something I would have change in the script to make it do that?
I tried out your script call and it works exactly as you said! However, but it doesn't seem to ever run the "Else" when the condition is not met. Is there something I would have change in the script to make it do that?
I don't have such issue, can you show a screenshot of your event commands?
I don't have such issue, can you show a screenshot of your event commands?

To my understanding, this should check if party member 1 has state 3. If so, it should apply the state "state 9", and if not, it should deal damage to the party. Yet no matter what it never ends up dealing damage to the party, regardless of outcome.
My bad, I forgot to tell you that the position in the party starts at 0 (for programming reasons).
So you should do:
$game_party.members[x].state?(id)
With x being your member's position -1.
0 for leader, 1 for second member, 2 for third member and so on
woohoo! it works perfectly! thank you so much for your help. You're a hero.

Original thread: https://forums.rpgmakerweb.com/threads/check-if-non-specific-party-member-has-state.182394/