MV How do I make a conditional branch that...

- Checks if Actor X is in the active battle party
- Checks if exactly 2 party members are dead
- Checks if Actor X is alive

all at the same time?
try and replace the x's for the actor's id
Code:
$gameActors.actor(x).isBattleMember()
  $gameParty.deadMembers().length == 2
    $gameActors.actor(x).isAlive()
mind you, these are split up to be separate conditions for separate nested branches. its a bit more readable than having it be one line, but the effect would be the same
Thank you!
To do this with in game events:

Set a variable to 0
check each party member using a conditional loop (no need to nest): if that actor is dead, increase the variable by 1
Now, just nest three conditional statements:
if variable = 2
if actor is in party
if actor is KO
ELSE (here is where you put the thing you want to happen)
if actor is in party
just as a note, this bit doesnt necessarily work all the time. if this is from some event being ran during a battle, then its fine. but once youre outside of battle, the engine's event command for it only checks if theyre in the party and not if theyre a member designated for battle.
I found that out the hard way earlier while making a boss fight that would not initiate if you had any less than 3 members in the active party, lol.
yeah, the results of the function behind that event command changes based on if the party is in battle or not. if it is, it uses the battle party. if it isnt, it uses the full party member list.
if you are trying to make something to consider the only the full party member group or only the battle group in all situations youll sometimes need to use script
True. This is context dependent, and OP hasn't really said what this is for. But I think we covered the basics.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-a-conditional-branch-that.178407/