Script Call For Recognizing Party Members In Slots 1-4

Hey everyone, I'm looking for a solution to an specific issue that is sort of pivotal to the flow of my game.

Basically, there are various missions you can go on, but the missions available sometimes depend on who's in the immediate party. The issue I'm running into, is that there are 10+ playable characters in the game. But I only want to count the first 4 members as officially being within the party. So the conditional branch for checking who's in the party is out of the question.

The only consistent way I've gotten it to work, is by setting up a value with gamedata, that checks for the actor in slot 2. This would be fine but it's just kind of unnecessarily specific. And in order to check for all 4 slots, I'd have to make giant common event loops for.

So is there any possible way to use a script call for recognizing/checking the first 4 slots actor ID's?
generalizing,....

[A,B,C,D] ∩ [A,B,C,D] = [A,B,C,D]

[A,C,E,G] ∩ [A,B,C,D] = [A,C]

you can check for

[array] ∩ [A,B,C,D] == [A,B,C,D]

unless, you want something different.
that's what I understand from the question.
by using array-specific functions, you don't check sequentially, but the whole array at once.
Glad to know it's possible. The equations themselves make perfect sense! Sadly, I have no scripting knowledge by any means. So help with actually forming the script call with appropriate terms would be greatly appreciated!
If you just want to know "is Actor 6 in the battle party" (as the "battle party" is the first 4 members) you can do

$gameActors.actor(6).isBattleMember()

Put this in the Script line of a conditional branch, and the condition will evaluate to true if actor 6 is in the first 4, or false if they are later in the lineup or not in the party at all.
Hey, that works perfectly! Thanks so much!

Original thread: https://forums.rpgmakerweb.com/threads/script-call-for-recognizing-party-members-in-slots-1-4.88697/