Journal HUD UI not appearing

Announcements, support questions, and discussion for Quest Machine.
Post Reply
c166
Posts: 31
Joined: Fri Oct 14, 2022 11:08 pm

Journal HUD UI not appearing

Post by c166 »

Hey Tony,

I'm using quest machine and integrating it with the dialogue system. I think I've got the basics mostly working by following the tutorial https://www.youtube.com/watch?v=zniaQKR ... elCrushers that you'd posted as an answer to one of the other questions (great tutorial btw, would be good if it was included/ linked in the pdf doc inside the quest machine integration guide)

With regards to the set-up. I've got the quest set up as such:
collect_wood_main_quest.PNG
collect_wood_main_quest.PNG (50.4 KiB) Viewed 730 times
Going through the dialogue system, I've managed to grant myself the quest (when I check via the journal)
collect_wood_quest_hud.PNG
collect_wood_quest_hud.PNG (63.44 KiB) Viewed 730 times
It's meant to display the heading in the HUD as well as the quest status when it's ongoing (but it doesn't) . I think I've set it up correctly below:
collect_wood_active_hud.PNG
collect_wood_active_hud.PNG (10.86 KiB) Viewed 730 times
quest_active_find_wood_step.PNG
quest_active_find_wood_step.PNG (13.46 KiB) Viewed 730 times
You can see in this image that the quest is "active" (appears in the journal) + the dialogue with the NPC also goes to the branch where the quest is active. However, the GameObject QuestHUD/Content Panel doesn't seem to create the gameobject that contains the actual text. Also, while the journal colour highlight changes from white to yellow (between the two screenshots) - it doesn't display text inside the journal either.
hud_journal_not_appearing.PNG
hud_journal_not_appearing.PNG (128.4 KiB) Viewed 730 times
A comparison with the youtube tutorial output (yellow clicked/ active = journal description + gameobject has the "KillOrc2" gameobject which is what populates the HUD):
kill_orc_example.PNG
kill_orc_example.PNG (249.41 KiB) Viewed 730 times
Am not sure what I'm missing here

Best Regards,
C
User avatar
Tony Li
Posts: 20723
Joined: Thu Jul 18, 2013 1:27 pm

Re: Journal HUD UI not appearing

Post by Tony Li »

Unless you've changed the colors of the quest journal UI's text templates in your scene, gray means the quest is in a completed state, such as Successful. Did you maybe add a passthrough node? If your quest is structured like:

Start --> [passthrough node] --> Success

Then as soon as the quest start, the Start node will go active and then true, which will set the passthrough node active and then true, which will set Success active and then true, all at once.
c166
Posts: 31
Joined: Fri Oct 14, 2022 11:08 pm

Re: Journal HUD UI not appearing

Post by c166 »

Hey Tony,

So I have set it up as a conditional node, though tinkering with it after your comments, it seems I had accidentally created a manual passthrough. And I have resolved the problem/ it now appears in the journal.
collect_wood_conditional.PNG
collect_wood_conditional.PNG (32.03 KiB) Viewed 726 times
The cause was me interpreting the options in the below section (quest editor, main) incorrectly. I thought that it meant that I'd set the required amount of wood as being between 3-5. However, it is actually setting the initial value of the counter (e.g. for cases where you start off with a random amount in your inventory?). I'd gotten mixed up between the different sections of the quest editor.
wood_counter2.PNG
wood_counter2.PNG (21.88 KiB) Viewed 726 times
The actual amount required is always static (at 3) as set in the conditions below. Since the initial random amount was at least 3; and the requirement was >=3. That meant the conditions were always fulfilled from the start.
wood_counter.PNG
wood_counter.PNG (17.23 KiB) Viewed 726 times
After fixing that (no random initialization), min of 0 and max of 3. Everything worked as expected.
fixed_hud.PNG
fixed_hud.PNG (103.72 KiB) Viewed 726 times
fixed_wood_counter.PNG
fixed_wood_counter.PNG (21.09 KiB) Viewed 726 times
I am wondering about how to extend this counter system to returning the value inside an inventory (say that I've got an inventory system and I can return the counter number there). I assume I would set up the code inside my inventory script, and then call SetQuestCounter (after a set of conditionals to check whether a quest exists).

Code: Select all

        public static void SetQuestCounter(object sender, StringField questID, StringField counterName, int counterValue)
        {
            MessageSystem.SendMessage(sender, SetQuestCounterMessage, questID, counterName, counterValue);
        }
I would also need to set the options here to expect that input (?). Just want to check my assumptions as I don't want to (badly) recreate a functionality that already exists in Quest Machine.
set_counter_message.PNG
set_counter_message.PNG (23.07 KiB) Viewed 726 times
Would that be how you'd approach the problem? Are there tutorials around how to set this up?
Last edited by c166 on Sat Jan 14, 2023 10:01 pm, edited 1 time in total.
c166
Posts: 31
Joined: Fri Oct 14, 2022 11:08 pm

Re: Journal HUD UI not appearing

Post by c166 »

Hmm definitely feels like there'd a better way than what I suggested above - since you'd then need to code up every quest id that deals with items inside the inventory script.

Guess my goal here is to count the number of items inside an inventory, and pass it through to the quest if the quest is active. The amount of wood can be random (so literal messages won't work) + can be obtained in multiple ways/ dropped (so instead of capturing it in all these ways and incrementing/ decrementing, I thought it'd be "easiest" to just count the number in the inventory).
Last edited by c166 on Sat Jan 14, 2023 9:40 pm, edited 1 time in total.
c166
Posts: 31
Joined: Fri Oct 14, 2022 11:08 pm

Re: Journal HUD UI not appearing

Post by c166 »

Separate issue, but I'm also having trouble getting the quest machine tags to be parsed via the dialogue manager conversations. I did notice that in the first image that under "All Fields"; there was no corresponding QuestID (page 10 of the intergration docs suggest that the Dialogue System Conversation Quest Content object would attempt to set QuestId and QuesterID in the tags) -> the fact that the tag doesn't appear under All Fields suggests that something related to that may be the problem? Though manually setting that field "QuestID" as "collect_wood" (the quest id) didn't fix anything.

I also used the dropdown QM to DS tool and clicked "copy all QM databases" in case that was also required for DS to parse the fields (still didn't parse).

Conversation/ dialogue set-up.
conversation_raw_code.PNG
conversation_raw_code.PNG (42.61 KiB) Viewed 724 times
The parsed message is here:
variable_not_parsing.PNG
variable_not_parsing.PNG (11.18 KiB) Viewed 725 times
I'm not sure what I'm missing as I've added the bridge to Dialogue Manager + set the "parse quest machine tags"
dialogue_system_bridge.PNG
dialogue_system_bridge.PNG (12.29 KiB) Viewed 725 times
And as far as I know I've set up Quest machine correctly (journal works + variables pass through i.e. {#wood} in the journal text).
quest_machine_setup.PNG
quest_machine_setup.PNG (69.92 KiB) Viewed 725 times
town_quest_setup.PNG
town_quest_setup.PNG (15.54 KiB) Viewed 725 times
Inside the quest giver's offer text
quest_offer_text.PNG
quest_offer_text.PNG (26.73 KiB) Viewed 724 times
Attachments
variable_raw_code.PNG
variable_raw_code.PNG (12.72 KiB) Viewed 725 times
User avatar
Tony Li
Posts: 20723
Joined: Thu Jul 18, 2013 1:27 pm

Re: Journal HUD UI not appearing

Post by Tony Li »

Hi,

For the inventory counter, see any of the integrations with third party inventory systems such as Inventory Engine or UIS. If you're not using the particular third party inventory system, the integration's custom quest condition won't compile in your project, but you can examine it to see how it works and then delete it and write your own. To write your own, duplicate the file QuestConditionTemplate.cs, rename it, and fill in your code where indicated.

For the tags, if you're starting a conversation through a Dialogue System Conversation quest action in a quest that has a counter named "wood", then "{#wood}" should work in the dialogue text. It won't appear in All Fields, but instances of "{#wood}" in your dialogue text will be replaced at runtime with the current counter value just before showing the text in the dialogue UI.
c166
Posts: 31
Joined: Fri Oct 14, 2022 11:08 pm

Re: Journal HUD UI not appearing

Post by c166 »

Hey Tony,

Thanks, I'll have a crack at extracting the integration component from the support inventory system packs; and see if I can get it working with what I've already created.

After a better read of the docs, I can see that `CounterGoal` refers to generated quests - and that if I wanted the quest to return the number required for collection, I'd just use {>#wood} which is the MAX that the COUNTER goes up to (and is static in a hand-written quest). I'd originally thought that it'd need to be the max that is in my inventory which was why I was trying to use `CounterGoal`, but realized it just referred to the counter (So I could have 99 in my inventory, but quest counter just goes up to 3). Can you confirm that is how the counter max is intended to be used + that `CounterGoal` is intended for generated quests (due to the random amount required)?

I also figured out why the counters weren't working - it seems that entering via a "Dialogue System Trigger" doesn't (method used in the integration tutorial https://www.youtube.com/watch?v=zniaQKR ... elCrushers) parse the Quest Machine tags. Another one of PixelCrusher's tutorial/ demo/ the docs used a Usable script + entered the conversation through there - which worked (Not sure exactly where, think it was in the Demo)

Am not sure if that's re-creatable - but that was my experience/ thought I'd let you know as an FYI.

Works
convo_trigger1.PNG
convo_trigger1.PNG (18.54 KiB) Viewed 620 times
variable_parsed.PNG
variable_parsed.PNG (9.34 KiB) Viewed 620 times
Didn't work (disabled the script after; but was active during testing)
convo_trigger2.PNG
convo_trigger2.PNG (38.47 KiB) Viewed 620 times
variable_not_parsing.PNG
variable_not_parsing.PNG (11.18 KiB) Viewed 620 times
User avatar
Tony Li
Posts: 20723
Joined: Thu Jul 18, 2013 1:27 pm

Re: Journal HUD UI not appearing

Post by Tony Li »

c166 wrote: Fri Jan 20, 2023 7:54 pmCan you confirm that is how the counter max is intended to be used + that `CounterGoal` is intended for generated quests (due to the random amount required)?
Yes, that's correct.
c166 wrote: Fri Jan 20, 2023 7:54 pmI also figured out why the counters weren't working - it seems that entering via a "Dialogue System Trigger" doesn't (method used in the integration tutorial https://www.youtube.com/watch?v=zniaQKR ... elCrushers) parse the Quest Machine tags.
You can still use Dialogue System Trigger. Inspect your conversation in the Dialogue Editor. Select Menu > Conversation Properties. In the Inspector view, expand All Fields. Add a Text field named QuestID and set it to the ID of the quest this conversation is about.
Post Reply