MV Nested randomized variables to create different choices

I'm trying to implement a system where the game randomizes 3 sets of 3 enemies for the player to choose and try to beat. Ideally, it would select a random enemy and have that be enemy 1 of set 1, then enemy 2 of set 1 and so on until the third enemy of set 3 along with a difficulty indicator at the bottom (but thats more of an extra than anything). Im using SRD's HUDMaker and Picture Choices plugins to try to achieve this.

I made a rough mock-up just to show how it would be organized and displayed:
Spoiler: Mock-up
Mockup.png

And this is what I started eventing, though I kinda got lost in the logic and how to organize it so it runs as intended
Spoiler: Event Page
Screenshot 2025-03-11 182923.png
Screenshot 2025-03-11 182940.png

I'm having trouble visualizing the nests I need to made to code this right and how to make the game sequence the battle set that the player chooses as it won't be a gauntlet rush but just predetermined battles with a rest between them, similar to the Glitzpit from Thousand-Year Door or the Corneo Colosseum from Final Fantasy 7.
It's difficult to tell from your event screenshot; what is the actual pool of potential enemies you're drawing from?
i just use pictures, array and variables. don't really need plugin. oh since im using pictures, i use triacontane's Picturecallcommon plugin so when the picture/icon is clicked the event activates.

you can use variable to show pictures.

1741737042646.png
It's difficult to tell from your event screenshot; what is the actual pool of potential enemies you're drawing from?
As of now I have 8 troops set up, but I would like to have the easier ones show up for the first round and getting progressively harder as it goes. The screenshot was just my trying to concept some nested array using the RNG variable to pick a number and then have that set which troop would be stored for that section (i.e. if RNG <4 then it picks 1, which would mean fighting the "Chains" troop)

It's pretty messy but thats exactly my issue, being able to visualize how to nestle these arrays together 😅
i just use pictures, array and variables. don't really need plugin. oh since im using pictures, i use triacontane's Picturecallcommon plugin so when the picture/icon is clicked the event activates.

you can use variable to show pictures.
Could you post an example? Just a mock template to follow. I'll check the plugin you mentioned as well, seems like it could be useful to this too!
As of now I have 8 troops set up, but I would like to have the easier ones show up for the first round and getting progressively harder as it goes. The screenshot was just my trying to concept some nested array using the RNG variable to pick a number and then have that set which troop would be stored for that section (i.e. if RNG <4 then it picks 1, which would mean fighting the "Chains" troop)

It's pretty messy but thats exactly my issue, being able to visualize how to nestle these arrays together 😅

Could you post an example? Just a mock template to follow. I'll check the plugin you mentioned as well, seems like it could be useful to this too!
Ah okay, so you basically just want to pick 3 random troops from a list of 8 of them?
So, you want to select nine random enemies, and based on that give the player a choice of three troops to fight? So, some questions:
How many enemies (not troops) do you have to select from?
Are you giving certain enemies weighting in the randomiser? I see from your screenshot you've been using a 1/5 chance of getting one enemy, and a 4/5 chance of the other.
Can the same enemy be selected multiple times? Either in multiple troops, or multiple times within the same troop?

As I understand, all you'd really need to do is select 9 random enemies to display to the player, then based on their selection of which troop to fight you store the selected enemy 1, 2 and 3; then when the fight starts, use the Transform Enemy to change the three placeholder enemies in the fight into the three selected ones. (Using Transform will save you having to programme in every single combination of troops!) You'll want to use the Script version of Enemy Transform (on turn 0 of the fight) rather than the evented version, so that you can easily change to whatever your three saved variables are. For example, if you have the enemy IDs you want to be in the troop stored in variables 18, 19 and 20, you'd run:

Code:
$gameTroop.members()[0].transform($gameVariables.value(18));
$gameTroop.members()[1].transform($gameVariables.value(19));
$gameTroop.members()[2].transform($gameVariables.value(20));
$gameTroop.makeUniqueNames();
Ah okay, so you basically just want to pick 3 random troops from a list of 8 of them?
Yes! and create 3 sets of 3 random troops depending on progress so for the first few rounds the sets would only pick from troops 1-3, then it starts picking from 2-4 and so on...
So, you want to select nine random enemies, and based on that give the player a choice of three troops to fight? So, some questions:
How many enemies (not troops) do you have to select from?
Are you giving certain enemies weighting in the randomiser? I see from your screenshot you've been using a 1/5 chance of getting one enemy, and a 4/5 chance of the other.
Can the same enemy be selected multiple times? Either in multiple troops, or multiple times within the same troop?
Funny enough I also have 8 enemies, however, they are already set up in the troops with duplicates and what not, so just randomly selecting a troop to be the first encounter of a set, then doing the same for the second encounter and so on to create 3 choices of a sequence of 3 troop encounters.

With the troops preset it also helps to better control the difficulty and weigh the enemies as the game progresses!
As I understand, all you'd really need to do is select 9 random enemies to display to the player, then based on their selection of which troop to fight you store the selected enemy 1, 2 and 3; then when the fight starts, use the Transform Enemy to change the three placeholder enemies in the fight into the three selected ones. (Using Transform will save you having to programme in every single combination of troops!) You'll want to use the Script version of Enemy Transform (on turn 0 of the fight) rather than the evented version, so that you can easily change to whatever your three saved variables are. For example, if you have the enemy IDs you want to be in the troop stored in variables 18, 19 and 20, you'd run:

Code:
$gameTroop.members()[0].transform($gameVariables.value(18));
$gameTroop.members()[1].transform($gameVariables.value(19));
$gameTroop.members()[2].transform($gameVariables.value(20));
$gameTroop.makeUniqueNames();
Would this create 1 troop from 3 random enemies? Its a similar idea, but instead of doing individual enemies to make a troop, it would be 3 random troops to create a set and repeat that 2 more times store those 3 sets somewhere that I can then display to the player!
Can the same troop be picked multiple times or does it have to be unique?
They do not have to be unique, it would be something like for the first round, only troops 1-3 will be picked at random to create all 3 encounters in all 3 sets. So maybe for the first encounter its between troops 1 and 2 and for the other two encounters is from troops 2 and 3.
okay so here's the flow.

when using pictures, define the coordinates where the images will appear. then show picture at 0 opacity, then move them to 100 opacity.
1742005347703.png


always set the picture names to "troop_X" where X is the variable value, in the example above, the "advX" will be changed, since this was still testing the layout and determining the coordinates of the pictures

then use the actual script for showing pictures with variable values

Code:
$gameScreen.showPicture(97, $gameVariables.value(121).padZero(3), 0, 90, 150, 100, 100, 0, 0);

here is an example of randomizing using arrays, for random shop
1742005153058.png

on array building
1742005250425.png

picking a value from the ifs
1742005266972.png
Oh wow! Thanks for taking the time to build all that!

I'm a bit overwhelmed by the amount of information 😅 but could you go in more detail about this
Code:
$gameScreen.showPicture(97, $gameVariables.value(121).padZero(3), 0, 90, 150, 100, 100, 0, 0);
What is this script exactly executing? Would that be used after the array is set up to show the options?
you can view the script calls here

yes, create the array first. then pick a random value from there. that value will be assigned as the value of the variable as a string. if its a string, you can use the script call via show picture.

$gameScreen.showPicture(pictureId, name, origin, x, y, scaleX, scaleY, opacity, blendMode);

Original thread: https://forums.rpgmakerweb.com/threads/nested-randomized-variables-to-create-different-choices.176162/