I'm coding my own Quest Actions and Conditions to communicate with my scripts. I've done 4 so far and work great.
But one thing that I want to do also on those Quest Action is to write into the Dialogue Text, Journal and HUD, so I can do it populating data from the code.
How do I call them from the Quest Action? I don't find how to do it and what classes to use it (there are son many
In Active State Node I use my own Custom Quest Action, for instance to communicate with my chest and send "Active" state so the chest shows up in scene with the HUD activated and the trigger activated so the player can open it.
What I want it's try to avoid to write on every node as less as possible, so I'd love to have on this custom Quest Action access to the HUD and Journal and show for example: "Now go to find the chest". What I want is to be able to write this from my custom Quest Action script instead than from the Quest Machine Node Editor (I don't want to fill all info manually in the active state for Hud, Journal, Notifications, etc... as it's quite time consuming for long quests....
Same for my own Custom Quest Condition, where I'd love to have on this custom Quest Condition access to the HUD and Journal and show for example: "Chest Opened!... "
I have tried to access from code to Hud and Journal and I don't find how to do it...
Thanks
GorkaGames wrote: ↑Tue Feb 19, 2019 11:48 am
Ok, and is there any chance to update the UI content from code? Just in the state where the action and Condition Chest script is located?
Yes. You can do that. You will need to find the right instance of the quest. If it's on the player and you have a reference to the player's QuestJournal, use QuestJournal.FindQuest(). For example:
var content = BodyTextQuestContent.CreateInstance<BodyTextQuestContent>();
content.bodyText = new StringField("Now go find the chest.);
hudContentList.Add(content);
Finally, tell the UIs to refresh so they use the new content:
This looks great and I'm going to check it out right now.
But for being 100% automatic and not relaying on quest and node's names, is there a way to know on which Quest and Node am I located when I write the code from the Action or Condition Quest Script?
I mean if the Action or Condition Quest Script is called from Quest (x) and Node (x), I guess the Action or Condition Quest Script can know witch Quest and Node is the actual...