I'm back My dialog tree is becoming quite complex, and what I would like to do is to is, once I make the Quest active in the dialog script, send an event that tells my NPC's Conversation Trigger component to change its conversation property to the next dialog. This would make it cleaner and easier to manage. What would be in your opinion the best way to do this? I'm a bit on the fence on if I should trigger it through LUA script through the Conversation manager or add a component to my NPC that watches for the event?
Thanks again!
-Jeff
Switch NPC conversation when Quest becomes active
Re: Switch NPC conversation when Quest becomes active
Hi Jeff,
Here are a few options to choose from based on your preferred workflow.
Option #1
In the Dialogue Editor, you can link across conversations. Create a "hub" conversation that the NPC always starts at. Then create separate conversations for each quest, and link from the hub to the appropriate quest conversation based on the states of quests and/or variables. To add a cross-conversation link, select the originating node. In the Inspector, find the Links To: dropdown and select "(Another Conversation)".
Set the Conditions fields on the destination nodes so the Dialogue System will know which link to follow. You can also use priority levels on nodes to make the conditions simpler.
Option #2
On your NPC, add a separate Conversation Trigger for each conversation. Set each Conversation Trigger's Condition so only one will be true at any given time.
Option #3
Register a C# function that finds your ConversationTrigger component and sets its conversation property (a string which is the conversation's title). Use this function in the Script field of your dialogue entry nodes.
Here are a few options to choose from based on your preferred workflow.
Option #1
In the Dialogue Editor, you can link across conversations. Create a "hub" conversation that the NPC always starts at. Then create separate conversations for each quest, and link from the hub to the appropriate quest conversation based on the states of quests and/or variables. To add a cross-conversation link, select the originating node. In the Inspector, find the Links To: dropdown and select "(Another Conversation)".
Set the Conditions fields on the destination nodes so the Dialogue System will know which link to follow. You can also use priority levels on nodes to make the conditions simpler.
Option #2
On your NPC, add a separate Conversation Trigger for each conversation. Set each Conversation Trigger's Condition so only one will be true at any given time.
Option #3
Register a C# function that finds your ConversationTrigger component and sets its conversation property (a string which is the conversation's title). Use this function in the Script field of your dialogue entry nodes.
Re: Switch NPC conversation when Quest becomes active
Awesome. Nothing else to add. I rest my case I feel like you're doing all the work! I think option 3 will work best for me. Thanks again.
Re: Switch NPC conversation when Quest becomes active
Glad to help! I just try to get some of the technical annoyances out of the way so creative people like you can get down to the business of actually writing your games.