Dialogue System and USurvival Integration

Announcements, support questions, and discussion for Quest Machine.
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Dialogue System and USurvival Integration

Post 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
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System and USurvival Integration

Post by Tony Li »

I think so. Try this DialogueManager.ResetDatabase line instead:

Code: Select all

DialogueManager.ResetDatabase(DatabaseResetOptions.KeepAllLoaded);
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Dialogue System and USurvival Integration

Post 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
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System and USurvival Integration

Post 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();
}
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Dialogue System and USurvival Integration

Post 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
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System and USurvival Integration

Post by Tony Li »

Always glad to help!
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Dialogue System and USurvival Integration

Post 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
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System and USurvival Integration

Post 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.
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Dialogue System and USurvival Integration

Post by nathanj »

Great.

Thanks, Tony
Post Reply