Checking the Formation

Here's the setup. In my game, like many, you can change the formation and switch out quite a few party members and choose your own group of 4 to fight with. HOWEVER, I have a boss fight that I want a specific character to be a part of for story reasons. The character will not be able to enter the boss room unless that character is in the formation.

THE QUESTION: I know there is a way to check if a player has a certain party member, but how do I check if a certain party member is in the current formation?
With a conditional branch (script):
$game_party.battle_members.include?($game_actors[actor_id])
Where actor_id is the ID of the required party member.
With a conditional branch (script):
$game_party.battle_members.include?($game_actors[actor_id])
Where actor_id is the ID of the required party member.

How exactly do you do conditionals in script format? I'm still a bit new with using the script format.
I'm still new myself, so please take my advice with a hefty pinch of salt, but if you're still Event-Driven like myself, you could use a Conditional Branch.

On Tab2 of the conditional branch, you can have the criteria as "Certain Actor" in Party.

So, for example, go to Event > Conditional Branch > Tab2 > Set Actor is In Party.

Have the boss encounter in the first section, and then have a message in the ELSE section saying that "Certain Actor needs to be in the Party."

That's how I'd do it, but whether it'd be right or not.... who knows (except these guys of course.)
On the fourth tab on your Conditional Branch command, there's a Script selection at the very bottom. That's what I was referring to. You select that option then enter the line of code I've given above within the blank area. This allows you to check if the actor is within your battle members; that is, the party members who appear in battle in case of an encounter.

Based on your inquiry, I'm assuming the player can travel with a lot of party members, but only 4 can enter battle based on their formation? Therefore you need to check if the actor in question is within those 4 members? Because otherwise, the default conditional branch command works fine on its own.

I suggested a script call to aid the eventing process because it's a easier and more reliable way of going about it.
Off the top of my head, the event-only version would be setup something like this:
Spoiler: Event
actorinparty00.PNG

Original thread: https://forums.rpgmakerweb.com/threads/checking-the-formation.79194/