Best way to clear Quests

Announcements, support questions, and discussion for Quest Machine.
Post Reply
Dougomite
Posts: 2
Joined: Fri May 24, 2019 5:50 pm

Best way to clear Quests

Post by Dougomite »

Hi I was wondering what would be the best way to clear all current and/or past quests. For now, I'd like to be able to do this for quickly testing my game by jumping around the game with console commands and I'd like to clear my Quests when doing this. I may want this functionality in my final game in case I'd like a quest to expire or be removed from the game.

I've tried using QuestMachine.UnregisterAllQuestInstances & QuestMachine.GetQuestJournal.Reset, but it doesn't seem to be getting rid of the quests.
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: Best way to clear Quests

Post by Tony Li »

Hi,

If you want to clear the player's quest journal, find the QuestJournal component and call its DestroyQuestInstances() method. You can call QuestMachine.GetQuestJournal() to get the player's quest journal. For example:

Code: Select all

QuestMachine.GetQuestJournal().DestroyQuestInstances();
To delete a single quest, use DeleteQuest().
Dougomite
Posts: 2
Joined: Fri May 24, 2019 5:50 pm

Re: Best way to clear Quests

Post by Dougomite »

Excellent that's just what I needed. Thanks for the help.
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: Best way to clear Quests

Post by Tony Li »

Glad to help.
Post Reply