How to have random choices appear when using "show choices"?

So in my game, you can go to an inn to recruit party members. I want the player to be given the choice between 3 possible party members and I want the game to randomly pick these 3 possible party members from 20 possible options if that makes sense. I also don't want the same party member showing up twice in the list. Whats the best way to go about this? I hope my question is not too confusing. Please let me know if I need to explain it better. Thanks 🙂
Basically you'll need a plugin for advanced choice options, most specifically for more choices (the 20 possible actors) and conditional choices (for disabling 17 of the 20 entries).

Thzen you need to make a calculation based on one or more random rolls to decide which of the actors to present.

The exact way on how to do that depends on what plugins you use for those conditional choices, and since I never used MZ I don't know what is available there.
What Andar describes would work, but I think this is also doable with pure eventing.

Text codes are eligible for use in Show Choices, and can be combined; e.g. \n[\v[5]] gets replaced with "the name of the actor with ID equal to the current value of game variable ID 5".

Randomly selecting 3 items from 20 without replacement is more complicated, but feasible without a script call; e.g.
  • Set variable A equal to Random 1 ~ 20.
  • Set variable B equal to Random 1 ~ 19.
  • If variable B >= A:
    • Add 1 to variable B.
  • Set variable C equal to Random 1 ~ 18.
  • If variable C >= A:
    • Add 1 to variable C.
  • If variable C >= B:
    • Add 1 to variable C.
  • If variable C = A:
    • Add 1 to variable C.
(The last check is to handle the case where B = A - 1 and B <= C.)

Obviously this quickly becomes cumbersome for more selections. You may prefer to use a single Script command to select the IDs, e.g.
JavaScript:
/** List of values available to select. */
const pool = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20];
/** IDs of game variables to store output values. */
const vars = [5,6,7];
// Select that many values without replacement.
for (let n = vars.length; n--;) {
  /** Random index to take from `pool`. */
  const r = Math.randomInt(pool.length);
  /** Value taken from `pool`. */
  const v = pool.splice(r, 1)[0];
  // Assign value to specified game variable.
  $gameVariables.setValue(vars[n], v);
}

Regardless, with this approach you would also need to check the corresponding variable value to react appropriately. E.g. \n[\v[5]] should add to the party (?) the actor with ID equal to variable 5.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-have-random-choices-appear-when-using-show-choices.170945/