Hi!
I have set up a "Trigger Event" component and a "Quest Control" component. The idea is that when the player enters the trigger area, it will set a particular Quest node state to "Completed".
I drag the Quest Control component onto a new "On Trigger Enter" event, but I cannot select "SetQuestNodeState". The only methods available are Send Message (and variants) and SetQuestCounter. Neither "SetQuestState" or "SetQuestNodeState" are available to select.
I'm following page 42 in the Quest Machine user manual.
Is there something else I need to do to be able to hook the Trigger Event up to Quest Control in order to update a Quest directly, outside of the messaging system?
Thanks again!
Can't call Quest Control "SetQuestNodeState" from Trigger Event
Re: Can't call Quest Control "SetQuestNodeState" from Trigger Event
Since SetQuestState(QuestState) and SetQuestNodeState(QuestNodeState) accept QuestState and QuestNodeState values, the UnityEvent inspector can't draw them. You can call them from a script, or you can set your node's conditions to listen for a message, and then select QuestControl.SendToMessageSystem() to send that message. (Make sure to select SendToMessageSystem, not SendMessage.)
Re: Can't call Quest Control "SetQuestNodeState" from Trigger Event
Gotcha, thanks again Tony. I've written a little helper Monobehaviour to handle it.
Great stuff!
Great stuff!
-
- Posts: 86
- Joined: Mon May 02, 2022 12:16 am
Re: Can't call Quest Control "SetQuestNodeState" from Trigger Event
I am trying to do something similar to this. I have an enemy AI that when disposed of, sets a quest to completed. Is this the correct way of doing it?
I'd like to use the message system if that is the best way, or?
Thanks!
I'd like to use the message system if that is the best way, or?
Thanks!
Re: Can't call Quest Control "SetQuestNodeState" from Trigger Event
Yes, the message system is a fine way to do it. If you don't want to write any code, you can add a Disappear Event component and a Quest Control component to the enemy. Configure the Disappear Event to call QuestControl.SendToMessageSystem, and specify the message to send.
-
- Posts: 86
- Joined: Mon May 02, 2022 12:16 am
Re: Can't call Quest Control "SetQuestNodeState" from Trigger Event
I have gotten it to work, mostly.
The problem I am having now is how to get the quest state from DS? I tried using a condition but I must not have it set up right because I cant see anything from quest machine. I tried using GetQuestNodeNumberState but nothing appears in the dropdown for, I'm assuming what should be the quests?
Thanks for the help with this.
The problem I am having now is how to get the quest state from DS? I tried using a condition but I must not have it set up right because I cant see anything from quest machine. I tried using GetQuestNodeNumberState but nothing appears in the dropdown for, I'm assuming what should be the quests?
Thanks for the help with this.
Re: Can't call Quest Control "SetQuestNodeState" from Trigger Event
In DS, use the GetQuestNodeState("questID", "nodeID") Lua function in your dialogue entry's Conditions field. (Page 12 of the Dialogue System Support.pdf manual.)
If you want to access QM quest IDs in the Lua function dropdowns, use the QM To DS Tool. (Page 11 of the manual.)
If you want to access QM quest IDs in the Lua function dropdowns, use the QM To DS Tool. (Page 11 of the manual.)