Hello, I’m making a quest system for my game using Dialogs and DataStore2. The idea is that each NPC has a set amount of quests and once all of them are complete, said NPC will give you a completion token. Ideally the quest line musn’t have branches, but every quest will have helpful tips if you get stuck.
Note that this post is more about the idea of my technique than a specific scripting error
I iterated the system in two different ways:
The first one was with table datastore having “IsCompleted” (bool, determines whether all of NPC’s quests are finished), “CanComplete” (bool, determines whether you’ve fulfilled all current quest requirements), “IsRead” (bool, determines whether to tell you the quest or hints about it), “QuestNumber” (integer, determines which quest is currently in progress).
I used a folder in ReplicatedStorage
storing all dialogs and I checked which dialog to put in the NPC’s head when any of the datastores above were changed. On paper it looked well, but in practice if
statemens consumed lots of space and the dialogs didn’t move properly.
The second iteration is very similar, except I have only “IsActive” (bool, “IsRead”, but renamed to better suit it’s purpose) and “QuestNumber”. I’m managing the dialogs client-side by having the text in one array with many sub-folders and the “Dialog” instance is staying fixed in the NPC’s head. Once it’s been read to the end, the client sends a remote for said NPC to make it’s “IsActive” true
on the server. Once activated you can revoke the quest or complete it by checking whether quest-specific requirements are met every time their value changes.