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:
Going through the dialogue system, I've managed to grant myself the quest (when I check via the journal)
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:
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.
A comparison with the youtube tutorial output (yellow clicked/ active = journal description + gameobject has the "KillOrc2" gameobject which is what populates the HUD):
Am not sure what I'm missing here
Best Regards,
C
Journal HUD UI not appearing
Re: Journal HUD UI not appearing
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.
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.
Re: Journal HUD UI not appearing
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.
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.
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.
After fixing that (no random initialization), min of 0 and max of 3. Everything worked as expected. 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).
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.
Would that be how you'd approach the problem? Are there tutorials around how to set this up?
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.
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.
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.
After fixing that (no random initialization), min of 0 and max of 3. Everything worked as expected. 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);
}
Last edited by c166 on Sat Jan 14, 2023 10:01 pm, edited 1 time in total.
Re: Journal HUD UI not appearing
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).
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.
Re: Journal HUD UI not appearing
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. The parsed message is here: I'm not sure what I'm missing as I've added the bridge to Dialogue Manager + set the "parse quest machine tags" 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).
Inside the quest giver's offer text
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. The parsed message is here: I'm not sure what I'm missing as I've added the bridge to Dialogue Manager + set the "parse quest machine tags" 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).
Inside the quest giver's offer text
- Attachments
-
- variable_raw_code.PNG (12.72 KiB) Viewed 1257 times
Re: Journal HUD UI not appearing
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.
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.
Re: Journal HUD UI not appearing
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 Didn't work (disabled the script after; but was active during testing)
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 Didn't work (disabled the script after; but was active during testing)
Re: Journal HUD UI not appearing
Yes, that's correct.
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.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.