Making a Quest List GUI

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Tony Li
Posts: 22102
Joined: Thu Jul 18, 2013 1:27 pm

Re: Making a Quest List GUI

Post by Tony Li »

LuaInterpreter, the default Lua used by the Dialogue System, is a good implementation but the error messages were written by a non-native English writer so you sometimes see confusing messages like "...the table element itself isn't in the table." This just means there's no quest named "My_Quest_Title".

Does the watch below work?

Code: Select all

Quest["Go_to_work"].State
Your dialogue database must have a quest named "Go to work" with that exact capitalization. When used as a table index (i.e., inside Quest[...]), Lua replaces the space characters with underscores.

You may prefer to interactively type in commands in the Lua console such as this one to show the quest table:

Code: Select all

return Quest
and this one to show the contents of a specific quest:

Code: Select all

return Quest["Go_to_work"] 
SuperSparkplug
Posts: 65
Joined: Fri Feb 06, 2015 3:51 pm

Re: Making a Quest List GUI

Post by SuperSparkplug »

Interesting, it says that the quest is active when I want it to be. However, it still does not show up on the Quest Tracker UI... :/
User avatar
Tony Li
Posts: 22102
Joined: Thu Jul 18, 2013 1:27 pm

Re: Making a Quest List GUI

Post by Tony Li »

That's a good thing! Now you know that the underlying data is correct.

The last step is to tell the Quest Tracker UI to update itself. The Quest Tracker UI doesn't automatically update, because it doesn't know when data has changed that would require an update. It could refresh itself on a regular basis anyway, say once per second, but this would be very inefficient because most of the time the quest data doesn't change from second to second. It would be eating up CPU cycles needlessly.

Instead, you need to manually send the message "UpdateTracker" to the Quest Tracker UI. Here's how:

1. Inspect your Quest Trigger. Expand the Send Messages section and increase the Size by 1.

2. Expand the newly-added element under Send Messages. Assign your Quest Tracker UI to the Game Object field.

3. Set the Message field to "UpdateTracker" with that exact capitalization, no space, and without quotes.

That should do it. After the Quest Trigger runs your Lua code to activate the quest, it will tell the Quest Tracker UI to update itself.
SuperSparkplug
Posts: 65
Joined: Fri Feb 06, 2015 3:51 pm

Re: Making a Quest List GUI

Post by SuperSparkplug »

Did that, but it doesn't seem to work. Am I doing something wrong here?

Image
User avatar
Tony Li
Posts: 22102
Joined: Thu Jul 18, 2013 1:27 pm

Re: Making a Quest List GUI

Post by Tony Li »

These steps should get you going:

1. Select your Dialogue Manager GameObject.

2. Select menu item Component > Dialogue System > UI > Unity UI > Quest > Quest Tracker HUD (on Dialogue Manager).

3. On your Dialogue Manager, you should see a new component, Unity UI Quest Tracker.
3a. Expand SF Unity UI Quest Tracker HUD so you can see "Vertical Group" and "Quest Track Template".
3b. Assign "Vertical Group" to the Unity UI Quest Tracker component's Container field.
3c. Assign "Quest Track Template" to the Quest Track Template field.

4. In your Quest Trigger component, assign the Dialogue Manager GameObject to the Send Messages > Game Object field.

I know this seems more than a little counterintuitive. You could alternatively add the Quest Tracker HUD component to the actual SF Unity UI Quest Tracker HUD GameObject. It doesn't really matter at this point, but by putting it on the Dialogue Manager I think it might make some possible future questions easier to resolve.
SuperSparkplug
Posts: 65
Joined: Fri Feb 06, 2015 3:51 pm

Re: Making a Quest List GUI

Post by SuperSparkplug »

THERE we go. I had already done all almost those steps previously, except step 4.

Thank you for your help. :)
User avatar
Tony Li
Posts: 22102
Joined: Thu Jul 18, 2013 1:27 pm

Re: Making a Quest List GUI

Post by Tony Li »

Happy to help! If you notice anything not working quite the way you want, just let me know!
Post Reply