Is it possible to have Unlimited randomized quests that NPC’s can share?

Hello! I could use some help as I’ve been trying to get this feature to work these past few days and it seems that no matter what I try to do with my current events: it’s impossible, so I may start it from scratch.

I’m working on a new project that is heavily inspired off the original animal crossing when it comes to gameplay! The game is going to have quests.

The main focus of the game is that the player will be able to design their own neighbors, choose their voice, window skin color and personality etc.

This feature is working great, but I’m struggling with the quests quite a lot currently.

I want to be able to have a select pool of quests that each personality type can have. There are 5 personalities and 10 neighbors, so there’s obviously going to be some repeats on personality type. This could range from having 2 of the same, or all neighbors having the same exact personality, it’s up to the player really.

Anyways, since the quest will be random, I want it to be possible that 2 or more neighbors of the same personality type can roll for the same quest, or a different one of course. Meaning that there could be 2 or more instances of the same quest happening at once, but they each have a different level of completion depending on the neighbor and player.

These quests are pretty simple, with things such as “catch me a specific fish!” Or “get me a specific fruit!” There’s only 3 steps: Accept/deny quest, quest in progress and quest complete.

For example, imagine all 5 of these guys have the same personality, giving them specific special quests based off of it:

Neighbor 1: “get me a cherry quest” finished, when the player talks to them again asking for a new quest, it will reroll from the randomized pool again based off personality type

Neighbor 2: “get me a fish quest” is in progress, meaning the player accepted but hasn’t given a fish yet to complete the quest. This NPC cannot generate a new quest until this is finished UNLESS the player cancels it on them.

Neighbor 3: “get me an orange quest” is in progress. Same as above.

Neighbor 4: The player asks for a quest, they roll a random “get me a blueberry” quest, the player declines and they are allowed to reroll the quest randomizer

Neighbor 5: “get me an orange quest” was randomized and requested when the player asked if this npc has a quest for them. They accept and it’s now in progress at the same time as neighbor 3, however they are separate. If the player gives an orange to Neighbor 5, then Neighbor 3 will still have their quest in progress until the player specifically gives neighbor 3 the orange.

I’ve tried a bunch of different things where it came to the randomizer and the actual two test quests itself and I can’t seem to grasp what I am doing wrong or how I should re-make them. All of these quest events are common events because of how the game is set up. I cannot use normal events for this.

Can someone help me figure out how I should do this step by step? Or if this is even possible? I’m a newer dev (since February of 2023) but I still know a bit about eventing, scripts etc. from experience with making other games with MV.

I’m nervous about showing off what I already have because it’s a huge mess with a lot of different tests mashed together, this is why I think it’s best for me to restart this. But if anyone can give me some ideas/wisdom, or even any questions for me to help you understand the issue more, that would be incredibly helpful and appreciated.
Yes, you would have to just not have the quests share the same switches or variables. I could do this with an array of arrays but it would definitely get into intermediate coding territory.

var activeQuests = [];

Then push the data for each quest as individual arrays into the activeQuests array.

Oh, you also want each personality to have a quest pool.

var cutePool = [[itemId, quantity], [itemId2, quantity], [itemId3, quantity]]; //e.g. orange itemId 5, qty 10
var coolPool = [[itemId, quantity], [itemId2, quantity]];

etc, etc.

When a character assigns a quest, randomly select an index from that personality pool then push it into the activeQuests array. Maybe another array for completed quests.
Randomly generating parts of a quest is the rather easier part. The harder part is if it's displayed.

For example, if you use something like Yanfly's Quest Journal or some other plugin that displays quest tracking information to the player, those are typically not designed to go off of any kind of dynamic data, they use plugin parameters and such.

You would definitely need to get into coding it as suggested above - exactly what data you're storing depending on what your quests can be.

But you'd probably need something that identifies who gave the quest (it could be a word that matches that event's unique name), what the object of the quest is (are you giving them money, items, killing something?), and then a value associated with it (which would be how much money, how many items or enemies, etc.).

Depending on the structure of your quests you may need more than that. But if you can define those things, we can help you with how to actually put the code in your game.
First of all, it is possible.
You might be overthinking things in terms of complexity and what to do first.

Personally, I'd at first set up all NPCs to be able to generate the random quests. Restrictions can be added later.

Everyone has their own set of variables to store the quest parameters.
Like ...
var quest 1 Type (1=get fish, 2=get strawberries, 3= ...)
var quest 1 Amount (how much of each stuff is needed)
var quest 1 progess (how far did you proceed so far ...)
etc., whatever you need to know about the quests.
Char 2, 3, 4, 5 have their own set of variables.

Whenever you want to generate a quest, you roll these at random. You can add logic restrictions here, like ("if personality is 1, only roll quest types 2, 3 and 5."). If "Quest type = 1", amount can only be 1. Etc.

Once it works, you can add further limitations. Like "check all quest type variables, if quest type 2 is already existing; if yes, exclude it from the list of allowed quests."
All of the OP's examples are fetch quests so I believe it can be done with arrays holding two values each [itemId, quantity] while in the personality pools.

Then when the character assigns the quest, push in two additional values: the questgiver's name (or other identifier) and progress (0). So it's now [itemId, quantity, questGiver, progress] and will look like [11, 3, 'Bob', 0], e.g. item id 11 (apple), 3 quantity, given by Bob, progress 0. Then push that array into an activeQuests array.

Of course now you're going to have to alias gainItem() to update and check the array every time you gain an item and push it into a finishedQuests array if progress is equal to or greater than quantity. On second thought, you probably have to alias loseItem() too, so you might not want or need the finishedQuests array since that can change.

As for displaying quest progress, you can use SRD HUDMaker or Aerosys Gab Windows.

Original thread: https://forums.rpgmakerweb.com/threads/is-it-possible-to-have-unlimited-randomized-quests-that-npcs-can-share.174045/