Page 2 of 2

Re: Dialogue System and USurvival Integration

Posted: Tue Dec 11, 2018 1:15 am
by nathanj
Hi Again,

How can I reset both Databases?

I have a button that runs

Code: Select all

uSurvivalQuestJournal.ResetToOriginalState();
DialogueManager.ResetDatabase(DatabaseResetOptions.RevertToDefault();
DialogueManager.SendUpdateTracker()
and it looks like everything is reset from the Quest Journal but I can not start the procedural conversations.

Is it because the extra database is loaded through the ExtraDatabases component?

Thanks,
Nathan

Re: Dialogue System and USurvival Integration

Posted: Tue Dec 11, 2018 8:44 am
by Tony Li
I think so. Try this DialogueManager.ResetDatabase line instead:

Code: Select all

DialogueManager.ResetDatabase(DatabaseResetOptions.KeepAllLoaded);

Re: Dialogue System and USurvival Integration

Posted: Tue Dec 11, 2018 6:17 pm
by nathanj
Hi Tony

Ok, I think that the problem when I reset the databases is that the Quest Giver's assigned quests are removed. So when I go to initialise a conversation again they don't have any assigned quests.

Is there a global command I can call it generate all possible quests for Quest Generator Entities?

I understand that this is kind of a weird scenario as it's only really for testing purposes.

Thanks again,
Nathan

Re: Dialogue System and USurvival Integration

Posted: Tue Dec 11, 2018 6:55 pm
by Tony Li
Hi Nathan,

Under what circumstance are you resetting the databases? To give you a good answer, I should get a better understanding of the purpose first.

To give you a fast answer, on the other hand... ;-) you can call the QuestGeneratorEntity's GenerateQuest() method. To make sure all QuestGeneratorEntities have quests, you can use this code:

Code: Select all

foreach (var npc in FindObjectsOfType<PixelCrushers.QuestMachine.QuestGeneratorEntity>()) {
    npc.GenerateQuest();
}

Re: Dialogue System and USurvival Integration

Posted: Tue Dec 11, 2018 7:16 pm
by nathanj
Edit: Yes, this worked!

It's just for testing purposes. I'm loading up entities in the environment and moving them in an out of domains to play around with the dynamics of the system.

The reset is simply for testing purposes so I can reset everything and try different combinations to see the results.

This should be all I need.

Thank you, again!

Nathan

Re: Dialogue System and USurvival Integration

Posted: Tue Dec 11, 2018 7:26 pm
by Tony Li
Always glad to help!

Re: Dialogue System and USurvival Integration

Posted: Tue Dec 11, 2018 7:37 pm
by nathanj
Ok,

One more thing.

Is it possible for an NPC to offer written and procedural quests?

I can set a condition for written quests to only be active during certain times but is there a way to assign a priority to either written or procedural quests?

Sorry for all the questions. I'm just trying to get everything inline and sorted before I start writing everything.

Thanks again,
Nathan

Re: Dialogue System and USurvival Integration

Posted: Tue Dec 11, 2018 8:03 pm
by Tony Li
Yes, an NPC can have written and procedural quests. The Quest Generator Entity component's "Max Quests To Generate" value only applies to procedural quests. If you add written quests, they won't count toward the value.

When you talk to an NPC that has more than one quest to offer/discuss, Quest Machine always shows a list of all of the offerable/active quests. This includes written and procedural quests. When the player chooses a quest from the list, it plays the dialogue for that quest.

If you need it to behave differently, such as only showing the top priority quest, you'll need to get your programmer to write a subclass that overrides the QuestGiver script's RecordQuestsByState() method -- for example to pare the list down to only the top priority quest.

Re: Dialogue System and USurvival Integration

Posted: Tue Dec 11, 2018 8:09 pm
by nathanj
Great.

Thanks, Tony