Quest getting deleted prematurely in QuestGiver Quest list
Posted: Sat Mar 20, 2021 9:36 pm
QuestMachine version 1.2.14 running on Unity 2020.2.3f1
I’m trying to create a Quest Debugger that can give testers a way to assign quests to themselves. After assigning a quest to myself and restarting the editor play session, I run into a problem where QuestGiver quests get deleted after passing the quest.timesAccepted check in QuestGiver.DeleteUnavailableQuests(). I’m assuming m_timesAccepted is being persisted on the ScriptableObject. Is there any way I can prevent this?
I also noticed a race condition between my Debugger.Start() script and the QuestGiver.Start(). Both Debugger and QuestGiver are components on the same GameObject. QuestGiver.Start() is always hit first in the scene that’s open when the play session is started, otherwise Debugger.Start() is hit first. I have no idea why this is. I'm loading the QuestGiver with Quests from a QuestDatabase reference in Debugger.Start(), so this race condition causes QuestGiver to have all its quests in the scene that’s first loaded (running the DeleteUnavailableQuests() method before the QuestGiver's quest list gets populated.). This happens even after leaving and returning to the scene in the same play session.
I’m trying to create a Quest Debugger that can give testers a way to assign quests to themselves. After assigning a quest to myself and restarting the editor play session, I run into a problem where QuestGiver quests get deleted after passing the quest.timesAccepted check in QuestGiver.DeleteUnavailableQuests(). I’m assuming m_timesAccepted is being persisted on the ScriptableObject. Is there any way I can prevent this?
I also noticed a race condition between my Debugger.Start() script and the QuestGiver.Start(). Both Debugger and QuestGiver are components on the same GameObject. QuestGiver.Start() is always hit first in the scene that’s open when the play session is started, otherwise Debugger.Start() is hit first. I have no idea why this is. I'm loading the QuestGiver with Quests from a QuestDatabase reference in Debugger.Start(), so this race condition causes QuestGiver to have all its quests in the scene that’s first loaded (running the DeleteUnavailableQuests() method before the QuestGiver's quest list gets populated.). This happens even after leaving and returning to the scene in the same play session.