MZ Trying to make it so the player can choose a party member for a task

As the title says I'm trying to find a plugin or script or something that I can do to make it so at certain moments in the game the player will be asked to choose one of their party members to do a task, usually something that will raise their stats. Problem is that in my game you can get to these moments before having any party members or when having only a few, and there's no order to getting the party members.

I've tried a few things with some help from others but they all seem flawed in one way or another. One method would label the choices properly but with how party order was but if there wasn't a party member in a slot then the choices would appear as 0. Anyone know how I can accomplish my goal of making events that require you to choose a party member and raising that party member's stats? Also maybe as a bonus locking off the option to do anything if there isn't any party members besides the protagonist.

Here's an example of what I was trying before
image.png

image.png
I have moved this thread from RPG Maker MZ Support to JS Plugin Requests.
Check out HimeWorks' Hidden Choice Conditions.
For the record, this basic idea is doable with only event commands (up to 8 members), using:
  • Show Text: \P[n] for the name of the party member in position n (1 for leader);
  • Control Variables -> Game Data -> Other -> Party Members (gets current party size);
  • Control Variables -> Game Data -> Party (gets actor ID by position in party).
E.g. for a maximum party size of 4:
Spoiler: event example
◆Control Variables:#0030 = Party Members ◆Control Variables:#0031 = 0 ◆If:#0030 = 1 ◆Show Choices:\P[1] (Window, Right, #1, -) :When \P[1] ◆Control Variables:#0031 = Actor ID of party member #1 ◆ :When Cancel ◆ :End ◆ :Else ◆If:#0030 = 2 ◆Show Choices:\P[1], \P[2] (Window, Right, #1, -) :When \P[1] ◆Control Variables:#0031 = Actor ID of party member #1 ◆ :When \P[2] ◆Control Variables:#0031 = Actor ID of party member #2 ◆ :When Cancel ◆ :End ◆ :Else ◆If:#0030 = 3 ◆Show Choices:\P[1], \P[2], \P[3] (Window, Right, #1, -) :When \P[1] ◆Control Variables:#0031 = Actor ID of party member #1 ◆ :When \P[2] ◆Control Variables:#0031 = Actor ID of party member #2 ◆ :When \P[3] ◆Control Variables:#0031 = Actor ID of party member #3 ◆ :When Cancel ◆ :End ◆ :Else ◆Show Choices:\P[1], \P[2], \P[3], \P[4] (Window, Right, #1, -) :When \P[1] ◆Control Variables:#0031 = Actor ID of party member #1 ◆ :When \P[2] ◆Control Variables:#0031 = Actor ID of party member #2 ◆ :When \P[3] ◆Control Variables:#0031 = Actor ID of party member #3 ◆ :When \P[4] ◆Control Variables:#0031 = Actor ID of party member #4 ◆ :When Cancel ◆ :End ◆ :End ◆ :End ◆ :End ◆If:#0031 = 0 ◆Text:None, None, Window, Bottom : :No actor selected. ◆ :Else ◆Text:None, None, Window, Bottom : :Selected \N[\V[31]]! ◆ :End
This could be a common event, used whenever you want to ask the player to choose a party member.

If you want something more complicated, e.g. restrict party members in different situations based on their ID, I would recommend a plugin like Turan suggested. 👋

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-make-it-so-the-player-can-choose-a-party-member-for-a-task.161120/