Command Options Depending on Members

I have a question about commands. Say for example I have 4 sets of commands:

add_command("Work", :work, true)add_command("Relax", :relax, true)add_command("Run", :running, true)add_command("Talk", :talking, true)the issue about this is that they exist in the command permanently, right? If I were to customize it and say:

add_command("Work", :work, condition_walk)def condition_walk$game_variables[1] = 5end not until variable 001 is equal to 5, Work option would not be available. However, I wanted to implement a command that bases on what you have.

For example, in my party, I have...

Eric, Natalie, Terence and Ryoma...

so what i want to appear in the command are:

Eric

Natalie

Terence

Ryoma

since the 4 party members exist, they'd be the only ones to show. But in case I removed Eric and changed him to Isabelle, then the command should say:

Isabelle

Natalie

Terence

Ryoma

aside from using if conditions, are there are ways?

Thanks! 
You can assign commands to each actor and then when you need to build your command list, simply collect all of the party members' commands.
This:

add_command("Work", :work, condition_walk)makes the command visible still. You just can't select it.To remove it from the menu altogether, you'd do it like this instead:

add_command("Work", :work) if condition_walkAnd that's how you'll need to do it if you only want certain commands to show up depending on who's in your party.

So if you want commands for all your "present" actors, you'd do something like this:

add_command("Eric", :eric) if $game_party.members.include?($game_actors[1])add_command("Natalie", :natalie) if $game_party.members.include?($game_actors[2])add_command("Terence", :terence) if $game_party.members.include?($game_actors[3])and so on.You can still set up the handlers for all of them in the scene, without worrying about the conditions. Only those that are listed in the window (those who are in your party) can actually be selected, so the rest are kind of disabled in the scene anyway.
I see. So basically they won't appear as they are not in the party...but they would if they are, right?

That makes one of my issues cleared. I was having problems because they keep to be visible on the command. I wanted to have a command for my party if they are inside my party.

So if I only have Eric, only a single command about Eric would appear, yet if I have Eric and Natalie, I would have 2 commands.

That's a big help, Tsukihime and Shaz! 🙂

Original thread: https://forums.rpgmakerweb.com/threads/command-options-depending-on-members.23193/