Quest System like Mystery Dungeon series help

Hi, I'm back with another cry for help. The title says it all, but for those who probably never have played the games, the Mystery Dungeon quest system is very complicated. It boils down to three types of quests:

1. Person A is trapped in Dungeon B on Floor C

2. Person A lost item in Dungeon B on Floor C and

3. Outlaw A escaped to Dungeon B and is on Floor C

While the quests themselves aren't horribly complicated, it's the randomizing part, the A, B, and Cs in my examples, that I'm struggling with (Though I could be overthinking it like I did with my last post)

I figured I would need Yanfly's Questbook plugin and a lot of variables and switches to pull this off, I just don't know how to start.
You can store arrays in a gameVariable, so, you can make 3 variables to store all the available persons, dungeons and floors

for example in variable 100 you can store an array of actor IDs like this:
Code:
Control Variables : #100 = [1,2,3,4,7,9]

And you can select a random position picking a random number this way:
Code:
Control Variables : #099 = Math.floor(Math.random()*$gameVariables.value(100).length)

Then select that position in the array you wrote in variable #100:
Code:
Control Variables #98 = $gameVariables.value(100)[$gameVariables.value(99)]

This way you get a random hero using 3 variables:

1611007548714.png


1611007564630.png


The same for dungeon (using the maps id and name), for example these are the maps ID and names in variables 101 and 102:
Code:
Control Variables : #101 = [11,12,13,24,27,29]
Control Variables : #102 = ["Lava cave","Ice temple","Dark forest","Waterfall","The maze","Other world"]

And get the ID and Name using a random (99 again)
Code:
Control Variables : #099 = Math.floor(Math.random()*$gameVariables.value(101).length)
Control Variables : #98 = $gameVariables.value(101)[$gameVariables.value(99)]
Control Variables : #97 = $gameVariables.value(102)[$gameVariables.value(99)]
Message : Random is \V[99]
    Map id is \V[98]
    Map name is \V[97]

1611008360145.png


For the floor you can simply use the random variable:

1611008509262.png


I hope this help you to make your idea easier

Original thread: https://forums.rpgmakerweb.com/threads/quest-system-like-mystery-dungeon-series-help.132340/