Quest resets to Waiting To Start

Announcements, support questions, and discussion for Quest Machine.
Post Reply
hookkshot
Posts: 4
Joined: Wed Feb 16, 2022 5:36 pm

Quest resets to Waiting To Start

Post by hookkshot »

I am in a state where we released a broken quest, and players in our game could restart a quest when they should no of been able to.

What is happening is now that their is a second version of the quest, for some reason between scenes both version of the quest (active and succeeded) transition into 'waiting to start'.

We have since fixed the original problem. But wnat to (without asking our players to restart the game) fix players in this broken state.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest resets to Waiting To Start

Post by Tony Li »

Hi,

The Save System component has a version property. It's an arbitrary number that you can set. I recommend using the version property to keep track of saved game file versions. For example, let's say in your patched game you set the save system version to 1. The default value is 0, so that's what was recorded in old saved game files. When you load a saved game, you can check the version of that saved game. If it's 0, you can do some special handling such as cleaning up the quest.

Otherwise, do the old and new quests have different quest IDs? If so, you can write some code that checks for the old quest ID and removes that quest, or that does something similar to handle it the way you want.

From your description alone I can't tell you why the quests are in the waiting to start state. Are you sure the quests on the player's Quest Journal are waiting to start, or just on the Quest Givers? Quests on the Quest Givers are normally left in waiting to start.
hookkshot
Posts: 4
Joined: Wed Feb 16, 2022 5:36 pm

Re: Quest resets to Waiting To Start

Post by hookkshot »

It is definitely on the quest Journal. Its the same quest just given to the player twice. Since we use script to give quests from Dialogue system.

It happens when going between scenes. So you have the active quest. Can see it on the HUD, then go to the next scene (Journal and database or static dont destroy on load) and the quest gets set to waiting to start. This only happens on the duplicate quests. hasnt seemed to effect anything else.

There is another quest that stays in the succeeded state.
hookkshot
Posts: 4
Joined: Wed Feb 16, 2022 5:36 pm

Re: Quest resets to Waiting To Start

Post by hookkshot »

Just forced giving my self 4 of the same quest.

Go to new scene it brings it down to 1 of that quest.
Go to next scene and it is none

I assume this is due to the quest ID being the same.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest resets to Waiting To Start

Post by Tony Li »

Yes. Quest IDs should be unique, and it's a good idea to use HasQuest() in your conversation to check if the player has a quest before adding it.

In C# code, you can check if the player has a quest by checking QuestJournal.ContainsQuest("quest ID")
hookkshot
Posts: 4
Joined: Wed Feb 16, 2022 5:36 pm

Re: Quest resets to Waiting To Start

Post by hookkshot »

Thats a good Idea I might make a helper function that does both.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest resets to Waiting To Start

Post by Tony Li »

Maybe it would be best to write a custom C# method / Lua function for that. Some devs might want GiveQuest() to replace an existing instance while others might want GiveQuest() to not give the quest if the player already has it.
Post Reply