Random quest system?

So I am wanting to create a random quest system for my project, and I have found a plugin that does just that [ Random Quest Generator for RPG Maker MZ ], but I want to see if I can make the system myself before buying plugins.

What I am wanting is a quest board/npc event where it will generate a random task like "go to [location] and retrieve [number] of [item]". It's on like the tip of my brain about how I could get this done but I end up staring blankly at my screen when I actually try. So I'd really appreciate any pointers about what I could do!
I couldn't resist.
I applaud you for being interested in trying to do this with events rather than a plugin. It is definitely worth learning how to do, even if a plugin turns out to be a better option.

There are different ways to approach this depending on your knowledge level of using scripts, arrays, and objects.

Personally, I would try to explore using an object, but since I am still learning how to use those, I will offer an option using arrays.

I would make separate arrays for Quest Numbers, Items, Quantity, Location, and Reward. Then, I would randomly remove a number from the Numbered Quests array and use that as the array position for the rest of the arrays. Then you can remove or just access the information from the other arrays depending on if you want the options to be one time only or possibly repeating.

For example::

QuestNumbers = [0, 1, 2, 3, 4]
Items = ["Logs", "Rocks", Strawberries", "Flowers", "Pelts"]
Quantity = [5, 10, 15, 20, 25]
Location = ["Lumberjack Camp", "Quarry", "Fairy Fields", "Secret Garden", "Wild Wilderness"]
Reward = [100, 50, 20, 15, 200]

When you engage with your event, you an randomly select a number from the QuestNumbers array. If you want to possibly repeat the quest, you wouldn't remove the number.

Of course, if you wanted the Quests to be always repeatable, you could skip the QuestNumber array and just generate a random number each time to select a quest.

You could then use that number as the position number (position numbers in arrays start at zero) for the remaining arrays to retrieve the data stored in that location. So, if you randomly select quest 3 and use that as the position number for the rest of the arrays, that would be that for Quest 3 the player needs to retrieve 20 flowers from the Secret Garden for 15 currency.

You would then need Events on the appropriate maps that only appear if the conditions are met, which could be set as the value of the variable for the quest number. You could also decide to set switches. And events can be set up with pages and conditions so the event covers multiple quests or some events could be unique to a specific quest.

If you want to get fancy, you can randomly place these events on the different maps so they appear randomly and you could also have them regenerate.

You could also make the quantity, location, and reward random if you wanted.

You just have to be careful that whatever you set up works with every option that as generated. And you have to account for if the player doesn't want to do the generated quest and how long you would wait to generate another quest.

And the NPC has different pages for the different quests for how to complete the quest and when quests get refreshed.

Anyway, that is kind of an outline of how I would approach it at first. There are lots of things to consider but I'm sure you will figure them out as you explore an option like this and test it.

I have a number of tutorials that go over different parts of this that might be helpful, but I am sure there are other ways to structure something like this.

I hope this helps and good luck!

EDIT: And if you aren't comfortable using arrays, you could make this simpler by just randomly selecting each piece of quest data. Randomly pick the item, number, location, and reward each time. But, of course, that can lead to unusual quest combinations. Or you could just use a series of conditional branch checks are you randomly select the quest to assign the correct values to variables for each piece of quest data.

Something like random number between 1 - 10.

If Number is 1 then Variable 100 is "Logs", Variable 101 is 20, Variable 102 is "Forest", and Variable 103 is 50.

Repeat logic for each quest number option.

Original thread: https://forums.rpgmakerweb.com/threads/random-quest-system.179636/