State check of all active party members

There is a script that can check whether a state is applied to an ALL active party members?
Because i have 6 characters, and they are periodically joining or leaving the party.
Where are you trying to use this? I'd probably just do something like this:

Code:
var allState = true;
var party = $gameParty.allMembers();
for (i = 0; i < party.length; i++) {
    if (!party[i].isStateAffected(id)) {
        allState = false;
    }
}
if (allState) {
    do whatever you want to do if all members have the state
} else {
    do whatever you want to do if all members do not have the state
}

Replace id in the "!party.isStateAffected(id)" part with the id number of the state you're checking for.
Where are you trying to use this? I'd probably just do something like this:

Code:
var allState = true;
var party = $gameParty.allMembers();
for (i = 0; i < party.length; i++) {
    if (!party[i].isStateAffected(id)) {
        allState = false;
    }
}
if (allState) {
    do whatever you want to do if all members have the state
} else {
    do whatever you want to do if all members do not have the state
}

Replace id in the "!party.isStateAffected(id)" part with the id number of the state you're checking for.
In parallel common event (RPG Maker MV). By script in Conditional Branch.
P.S. Also, i wonder, how to do the same in VX Ace?
In parallel common event (RPG Maker MV). By script in Conditional Branch.
P.S. Also, i wonder, how to do the same in VX Ace?

Similar approach, use the script event command to run this script just before your conditional branch, replace id with the state id you're checking, and replace x on the last line with a switch id. In your conditional branch just check if the switch is on or off (On will mean everyone has the state).
Code:
var allState = true;
var party = $gameParty.allMembers();
for (i = 0; i < party.length; i++) {
    if (!party[i].isStateAffected(id)) {
        allState = false;
    }
}
$gameSwitches.setValue(x, allState)

All RPG Makers prior to MV use Ruby as their language - which I'm not knowledgeable in. I'd advise you make a separate post in a relevant forum to figure out how to do this in VX Ace
Similar approach, use the script event command to run this script just before your conditional branch, replace id with the state id you're checking, and replace x on the last line with a switch id. In your conditional branch just check if the switch is on or off (On will mean everyone has the state).
Code:
var allState = true;
var party = $gameParty.allMembers();
for (i = 0; i < party.length; i++) {
    if (!party[i].isStateAffected(id)) {
        allState = false;
    }
}
$gameSwitches.setValue(x, allState)
Okay.
And then, in Conditional Branch i checking that switch ON or OFF. If all members are affected by a state, then that switch is turning on. If it's turned ON, then events happened.
Like this?
screenshot.jpg
That should do the trick. Give it a shot and see how it goes. 🙂

EDIT: It might be worth adding a wait command at the end of the parallel event or the event will run 60 times a second and contribute a fair bit to lag. Ideally you want the wait command to be for as long as possible but I'd suggest a minimum of at least 60.

Original thread: https://forums.rpgmakerweb.com/threads/state-check-of-all-active-party-members.108031/