Hi Tony!
I have an NPC that you talk to, who should give you an item if you fully complete his conversation. I have a sensor set up such that if you walk away from the NPC mid-conversation, it will stop/cancel the conversation.
Are there any callbacks that I could use, where I could know that the player fully completed the NPCs conversation, so that I can give the item to the player? With the "Dialogue System Events" component, the "On Conversation Ended" callback gets called even if the conversation is "cancelled".
If there isn't a callback type of way to know if the conversation was fully completed, would there be a way to do this via Lua Script on a conversation-node? I would need to give the item to the player *after* they have pressed the continue button on the final node (aka after the conversation has finished).
Thanks for the help!!
Detect conversation 'finishing' versus conversation 'cancelled'?
Re: Detect conversation 'finishing' versus conversation 'cancelled'?
Hi,
You could add a node after the "final" node that doesn't have any Dialogue Text. Set its Sequence to Continue(). Use a Lua function in the Script field to give the item. (You can register your own C# method with Lua and then call this method in the Script field.)
Or you could set a variable in the final node. Add another Dialogue System Trigger set to OnConversationEnd to the NPC. Set this Dialogue System Trigger's Conditions > Lua Conditions to check the variable value. Set Actions > OnExecute() UnityEvent (or some other action) to give the item.
You could add a node after the "final" node that doesn't have any Dialogue Text. Set its Sequence to Continue(). Use a Lua function in the Script field to give the item. (You can register your own C# method with Lua and then call this method in the Script field.)
Or you could set a variable in the final node. Add another Dialogue System Trigger set to OnConversationEnd to the NPC. Set this Dialogue System Trigger's Conditions > Lua Conditions to check the variable value. Set Actions > OnExecute() UnityEvent (or some other action) to give the item.
Re: Detect conversation 'finishing' versus conversation 'cancelled'?
Thanks Tony! I think the first method will work great
Re: Detect conversation 'finishing' versus conversation 'cancelled'?
Great! Glad to help.