My Grouping Doesn't Seem to Work?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
SkyTech6
Posts: 1
Joined: Tue Sep 22, 2020 2:24 am

My Grouping Doesn't Seem to Work?

Post by SkyTech6 »

I feel like I might be using Group nodes wrong? I saw the FAQ about it, but a more in-depth look at it would be nice I think...

Image

Here's my conversation. I'm attempting to have this NPC give a Quest that contains 5 sub entries.

<quest-start> conditionals check that the quest is currently "unassigned". That node chain ends with script that sets the Quest and the first 4 entries to "active".

<quest-mid> conditionals check that the quest is "active" and that the 5th entry is "unassigned". This is supposed to be like a "Huh, what are you doing? Go do the quest."

In the game once all 4 entries are done, an observation trigger sets the 5th to "active". (This is mainly for my HUD tracker to say "Return to NPC".

<quest-end> conditional simply checks that the both the quest and 5th entry are "active".

Both mid-quest and end-quest never trigger... Despite their conditionals being met. Am I doing something wrong here?
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: My Grouping Doesn't Seem to Work?

Post by Tony Li »

Hi,

That screenshot looks correct to me. Maybe there's an issue with the conditions. Please temporarily set the Dialogue Manager's Other Settings > Debug Level to Info. This will log a lot of information to the Console window.

For example, if the quest is active:

Code: Select all

Dialogue System: Starting conversation 'New Conversation 1', actor=, conversant=NPC (UnityEngine.Transform).
Dialogue System: Add Group (NPC): ID=1:1 'branch' (True)
Dialogue System: Lua(return CurrentQuestState("My Quest") == "unassigned")
Dialogue System: Block on False Link (NPC): ID=1:2 '' Condition='CurrentQuestState("My Quest") == "unassigned"'
Dialogue System: Lua(return CurrentQuestState("My Quest") == "active")
Dialogue System: Add Group (NPC): ID=1:3 'mid' (True)
Dialogue System: Add Link (NPC): ID=1:6 'Active text.' (True)
Dialogue System: Lua(return CurrentQuestState("My Quest") == "success")
Dialogue System: Block on False Link (NPC): ID=1:4 '' Condition='CurrentQuestState("My Quest") == "success"'
Dialogue System:  says ''
Dialogue System: Sequencer.Play( None()@0 )
Dialogue System: NPC says 'Active text.'
Dialogue System: Sequencer.Play( Delay(2)@0 )
Dialogue System: Sequencer: Delay(2)
Here's how to interpret it:

Code: Select all

Dialogue System: Starting conversation 'New Conversation 1', actor=, conversant=NPC (UnityEngine.Transform).
Dialogue System: Add Group (NPC): ID=1:1 'branch' (True)
^ Conversation started. <branch> group has no conditions, so we follow it.

Code: Select all

Dialogue System: Lua(return CurrentQuestState("My Quest") == "unassigned")
Dialogue System: Block on False Link (NPC): ID=1:2 '' Condition='CurrentQuestState("My Quest") == "unassigned"'
^ The quest isn't in the unassigned state, so we don't use the <quest-start> group.

Code: Select all

Dialogue System: Lua(return CurrentQuestState("My Quest") == "active")
Dialogue System: Add Group (NPC): ID=1:3 'mid' (True)
Dialogue System: Add Link (NPC): ID=1:6 'Huh? I told you to get....' (True)
^ The quest is active, so we follow the <quest-mid> group. This leads to the active quest text, which we add to a list of lines that are currently true (i.e., available for the NPC to speak).

Code: Select all

Dialogue System: Lua(return CurrentQuestState("My Quest") == "success")
Dialogue System: Block on False Link (NPC): ID=1:4 '' Condition='CurrentQuestState("My Quest") == "success"'
^ The quest isn't in the success state, so we don't use the <quest-end> group.

Code: Select all

Dialogue System:  says ''
Dialogue System: Sequencer.Play( None()@0 )
^ This is just the <START> node.

Code: Select all

Dialogue System: NPC says 'Huh? I told you to get...'
Dialogue System: Sequencer.Play( Delay(2)@0 )
Dialogue System: Sequencer: Delay(2)
^ After evaluating all possible paths, the conversation ends up with a list of lines whose conditions are true. It then plays the first line in the list. In our case, the list only has the one line ('Huh? I told you to get...').

Side note: The first of the two "Sequencer" lines shows the sequencer command as the Dialogue System's parser understands it. The second one appears when the command actually runs and shows any special value that need to be filled in at runtime, such as 'speaker'.
Post Reply