Assigning quest with Dialogue Manager

Announcements, support questions, and discussion for Quest Machine.
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Re: Assigning quest with Dialogue Manager

Post by timbecile »

still doesn't work. I found that I needed to add the quest to the Quest Giver component, but still not showing up in the player's quest journal.

Are they supposed to be connected together in a way I'm missing?
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Re: Assigning quest with Dialogue Manager

Post by timbecile »

Looks like I'm on the right path with the 'can't find the journal' thing. I wrote a quick little method to use GiveQuestToQuestor and that seems to work, though I'd rather use the internal Lua than have to keep writing methods...
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Assigning quest with Dialogue Manager

Post by Tony Li »

Oh darn, I must have too much turkey and gravy running through my brain because I typed the parameters in the wrong order!

It should be this:

Code: Select all

GiveQuest("Villager", "peskyRabbits")
I'm so sorry about that.

Please try swapping the parameters. If that doesn't fix it, are there any warnings or errors in the Console? (Make sure your Console window isn't hiding warnings and errors.)

Your quest should also be assigned to a quest database asset that's assigned to the Quest Machine GameObject.

Have you added a 'Dialogue System Quest Machine Bridge' component to your Dialogue Manager GameObject and ticked its 'Override Quest Log' checkbox?

p.s. - I'll go back through my previous replies and add a note about this. If in doubt about any parameter orders in the future, please refer to the PDF manual for the correct order.
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Re: Assigning quest with Dialogue Manager

Post by timbecile »

That Worked!

One other question...

How do I check for quest states, quest node states, etc through the editor? They're not in the wizard :(

Can I just use type them straight in?

For instance, I have a multi-node quest, so I need to:
check whether the quest is assigned (to block out the assigning dialog)
check the node state (also to block out)
set the node state
and complete the quest to success.
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Assigning quest with Dialogue Manager

Post by Tony Li »

Use the Lua functions listed in the Dialogue System integration's PDF, which is in Plugins / Pixel Crushers / Quest Machine / Third Party Support / Dialogue System Support. The list is on page 11.

When using the Conditions and Script fields' "..." button, click "+" and select "Custom" from the dropdown. Then you can select the functions you want from dropdowns. Each function's row will have the correct number of parameters to fill in. You just need to fill them in with quest IDs, etc.
  • check whether the quest is assigned => HasQuest("questID")
  • check the node state => GetQuestNodeState("questID", "nodeID")
  • set the node state => SetQuestNodeState("questID", "nodeID", "state")
  • and complete the quest to success => SetQuestState("questID", "state")
For "state", use "unassigned", "active", or "success" as described in the table on page 12.
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Re: Assigning quest with Dialogue Manager

Post by timbecile »

Hey Tony,

I've run into a strange issue. I have a line of dialogue that shouldn't display if the player doesn't have the quest (using HasQuest("MainLine1") == true ) in dialogue manager, but the bit of dialog is still showing up.

I feel like it works in other locations, but I can't figure out why it's not working for this particular guy (actually a series of guys)

it appears HasQuest is checking on the quest giver instead of the quest log as far as I can tell...
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Assigning quest with Dialogue Manager

Post by Tony Li »

Hi,

Does your scene have more than one QuestJournal component?

HasQuest() will look for a QuestJournal component and check if it has a quest. In a single player (quester) game, only the player should have a QuestJournal. If you have multiple questers (e.g., multiple characters with their own quest journals), you'll need to use the QuesterHasQuest() Lua function so you can specify a quester's ID.
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Re: Assigning quest with Dialogue Manager

Post by timbecile »

I don't think I have two, but I think QuesterHasQuest() will be cleaner anyway. Do you have an example of that? I didn't see any in the api documentation
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Assigning quest with Dialogue Manager

Post by Tony Li »

Hi,

It's on page 12 of "Dialogue System Support.pdf". Specify the quester's ID as the second parameter. For example, if you've set the player's Quest Journal component > ID field to "Player", then check the quest like this:

QuesterHasQuest("Some Quest ID", "Player") == true

However, since it sounds like your scene doesn't have two Quest Journals, the actual issue may be elsewhere. Note that HasQuest() and QuesterHasQuest() both only check if the quest journal has a quest in it. It doesn't check the quest's state. The quest could be completed already.
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Re: Assigning quest with Dialogue Manager

Post by timbecile »

ok, still not working. can you see anything wrong with this: (the IsPlayerQuestNodeState is a custom Lua function)

Code: Select all

QuesterHasQuest("MainLine1", "Player") == true and IsPlayerQuestNodeState("MainLine1", "guardJohan", "True") ~= true 
Post Reply