Quest Status Updates

Announcements, support questions, and discussion for the Dialogue System.
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Quest Status Updates

Post by pegassy »

Hello Tony,

I wanted to ask for help with a feature I could not manage to get to work.

In the Quest Example Scene, General Starr has a quest status update feature. The object has two scripts on it: Quest State Indicator and Quest State Listener. I have been trying to use the same feature on my game scene.

However, even if copy General Starr into my game or if I copy both scripts to another NPC on my scene, the question mark or the exclamation mark never shows on the NPC. I do update the quest database, and then choose the related quest from the dropdown, and I can see the quest turning from Unassigned to Active to Success as I go through dialogues, but there will be no indicator showing up or updating on the character.

Do you have any idea what I might be doing wrong? Thank you in advance for your help.
User avatar
Tony Li
Posts: 22059
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Status Updates

Post by Tony Li »

Hi,

The documentation on indicators is buried here.

Your Dialogue Manager GameObject probably needs a Quest State Dispatcher. This informs NPCs' Quest State Listeners that a quest has changed.

Your NPC (e.g., General Starr) needs one Quest State Indicator, and a Quest State Listener for each quest that the NPC has.

General Starr's Quest State Indicator has three indicator levels:
  • 0: nothing
  • 1: question mark
  • 2: exclamation mark
He also has one Quest State Listener. Its Quest Name field is set to "Get the Coordinates", which is the quest he monitors. (Private Hart also monitors this quest. He has his own Quest State Listener.)

Each element of the Quest State Indicator Levels list is like a rule or event handler.
  • General Starr's first element says that when the Quest State is Unassigned (i.e., quest is available for player to pick up), use indicator level 1.
  • The second element says that when the Quest State is Success, use indicator level 0.
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Re: Quest Status Updates

Post by pegassy »

I think I just missed out the dispatcher, and had the other two. That explains why when I carried him to my scene he was not receiving that from the Dialogue Manager. I will give that a try. Thank you so much for helping.
User avatar
Tony Li
Posts: 22059
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Status Updates

Post by Tony Li »

The next release automatically adds the dispatcher if it's missing, but the version you're using doesn't do that yet.
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Re: Quest Status Updates

Post by pegassy »

Ok, so I added the dispatcher to my scene and I could get the exclamation mark on my NPC with the unassigned quest right away. I seem to be having trouble changing the sign to another indicator level though.

I have a quest with two entry states, which pretty much has the same structure with General Starr quest from the example scene. I followed the same exact state indicator and entry state indicator level content in my scene but even the first sign does not change.

To make sure that the entry state indicator levels did not interfere with the main quest state indicator levels, I turned it into a simple structure where if the main quest is unassigned it would be an exclamation mark, and if the main quest is success or active then it would be none. But even then, the exclamation mark appears in the beginning and it does not disappear when the quest is active, or when I complete the quest with success. I am out of ideas about where that might be coming from.

I also checked the only other NPC that has quest state listener to make sure I do not have him controlling the first NPC's indicator canvas, and also deleted his script, so that there is only one NPC with the listener. The sign still does not change.

I have attached what the quest state listener inspector looks like. Do you have any ideas what may be causing this?

Thank you for your patience with many newbie questions.
Attachments
2018-3-18-DS Quest Symbol Change Bug.png
2018-3-18-DS Quest Symbol Change Bug.png (39.03 KiB) Viewed 1549 times
User avatar
Tony Li
Posts: 22059
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Status Updates

Post by Tony Li »

This example might help: TPC_MountHorseExample_2018-03-18.unitypackage

The player has two indicators: A red square indicates the "Mount Your Steed" quest is active. A green square indicates that it's successful.

If your scene is set up similarly, check the Console window for any warnings.

If you don't see any warnings, you can set the Dialogue Manager's Debug Level to Info. This will lot a lot of info to the Console. For example, in the example scene, it logs this when the scene starts:

Dialogue System: Dom_Shooter: Listening for state changes to quest 'Mount Your Steed'.
Dialogue System: Dom_Shooter: Quest 'Mount Your Steed' changed to state Active.
Dialogue System: Dom_Shooter: SetIndicatorLevel(Dom_Shooter (PixelCrushers.DialogueSystem.QuestStateListener), 1)
Dialogue System: Dom_Shooter: Activating GameObject associated with indicator level 1

When you mount the horse, it logs this:

Dialogue System: Setting quest 'Mount Your Steed' state to 'success'
Dialogue System: Dom_Shooter: Quest 'Mount Your Steed' changed to state Success.
Dialogue System: Dom_Shooter: SetIndicatorLevel(Dom_Shooter (PixelCrushers.DialogueSystem.QuestStateListener), 2)
Dialogue System: Dom_Shooter: Activating GameObject associated with indicator level 2
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Re: Quest Status Updates

Post by pegassy »

Thank you so much for taking the time to put this together. I will check it out and see where my scene seems to be doing wrong.
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Re: Quest Status Updates

Post by pegassy »

I have tried the example scene, and I also turned on the debug level on Dialogue Manager to info. It does produce the initiation log entries. However, when I mounted the horse, nothing happened. The indicator remained as red, and there were no new entries produced in the Console.

I just notice thought, that there seems to be a script missing (Nothing Selected) on Dom_Shooter. I do not know what it is but might it be what was supposed to detect the mounting event trigger?

I played around a little bit and added the quest trigger script to Blitz (It was on Dom_Shooter) and when I turned it to trigger enter, the green dot came up in the start of the scene play.

I will play around with what is going on little more by importing your mount scene to a new project with TPC. I may have something messed up at the prefab level that might be messing other things. I also notice that some of my barks are running in the beginning of a scene even though they are attached to trigger enter of an NPC... New project may show that there is a problem in the haystack somewhere.
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Re: Quest Status Updates

Post by pegassy »

I have tested the mount scene in new project with TPC and DS installed. I still could not get the mount to trigger a green dot. However, I had found a workaround for the mount trigger, so I tried to see if this time I can get the regular quest trigger enter event around a game object (cube) actually trigger the event, and it worked.

I will go try the same method in my scene to see if that will also work there.
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Re: Quest Status Updates

Post by pegassy »

Ok, I got some findings now. I went back to my original game scene, and first figured out the reason that some of my original NPC barks on trigger enter were being set off during initiation. Apparently I had not set up player as the accepted game object, so they were set off by other objects. So that is fixed now.

For the main issue with the quest status updates, I tried to set up a quest trigger to set the same quest to active from unassigned, and that DID change the symbol on the NPC from exclamation mark to question mark. However, when the NPC dialogue activates the quest, the symbol does not change, even though both on tracking and in quest log I can see that it becomes active the same way.

I went into the dialogue and the script that sets the quest active is:

SetQuestState("Report_to_Colonel", "active");
SetQuestEntryState("Report_to_Colonel", 1, "active");
ShowAlert("New Quest: Take message to Colonel.")

Therefore, the same exact behavior (one being caused by quest trigger, the other by dialogue tree leaf) cause different results with the quest updates. At this point I am not sure what else to look at.

I checked the console log to try to figure out if there were any related errors, but could not notice anything. I have attached it in case you think it is worth looking at. The name of the quest is "Report_to_Colonel".

Thank you.
Attachments
2018-3-18-DS Status Update Bug-Console Log.rar
(25.51 KiB) Downloaded 76 times
Post Reply