Page 1 of 1

Start game with active quest

Posted: Sun Mar 06, 2022 11:03 am
by mroshaw
Hi! I want my player to have a quest start automatically when the game starts. The quest involves visiting a character, who will then kick off the narrative of the game.

I've created a quest and assigned it to the NPC character in question. I have 3 nodes: Start > Return to Quest Giver > Success. I've added the quest to the Quest Database.

I've tried setting the Quest "Current State" to "Active" as well as tried setting the "Start" node to "Active". Whatever I try, I haven't been able to see the quest appear in the player journal or on the HUD as an active quest.

Is there a better way to have a quest immediately become active when the player starts the game?

Many thanks!

Re: Start game with active quest

Posted: Sun Mar 06, 2022 11:44 am
by mroshaw
Getting somewhere with this! I'm now trying to use the QuestGiver.GiveQuestToQuester() method in a component Start().

I've got as far as this, but I'm stuck on how to retrieve the QuestListContainer for the player:

Code: Select all

Quest questInstance = QuestMachine.GetQuestInstance(questId);
QuestListContainer questList = QuestMachine.GetQuestListContainer(???)
questGiver.GiveQuestToQuester(questInstance, questList);
How do I set / retrieve the "id" of the appropriate QuestListContainer for the player?

Re: Start game with active quest

Posted: Sun Mar 06, 2022 11:50 am
by Tony Li
Hi,

You can use QuestMachine.GetQuestJournal():

Code: Select all

questGiver.GiveQuestToQuester(questInstance, QuestMachine.GetQuestJournal());
However, you may be looking for How To: Start Quest From Quest.

Re: Start game with active quest

Posted: Sun Mar 06, 2022 2:56 pm
by mroshaw
That's the one! Thanks again, Tony!

Re: Start game with active quest

Posted: Sun Mar 06, 2022 3:25 pm
by Tony Li
Glad to help!