Tips for Multi-Conversation NPCs
Posted: Sat Jan 28, 2017 10:01 am
Here are some tips on setting up conversations for NPCs that have a lot of dialogue. A good example is a "quest hub" NPC that offers several quests.
Cross-Conversation Links
One approach is to write a separate conversation for each quest. Then create a starting "hub" conversation that contains cross-conversation links to the quest-specific conversations. Configure your NPC's Conversation Trigger to play this starting conversation. Configure the Conditions fields on the quest conversations to specify which cross-conversation link to follow.
Here's an example of the hub conversation:
And the cross-conversation links:
In the first image, I also used forward slashes ( / ) in the conversation titles to group the conversations into a submenu for the NPC. This just makes it easier to select conversations in the editor.
Group Nodes
Alternatively (or even in combination), use Group nodes. To make a dialogue entry node into a Group node, tick its Group checkbox. Group nodes will check their Conditions fields. If true, they will run their Script fields and then immediately pass through to their children without showing any subtitle text. Group nodes allow you to reduce the number of links between nodes, which may make it more manageable to keep all your content in a single conversation.
Here is an example that uses Group nodes:
Multiple Conversation Triggers
Both of the examples above keep all of the branching inside the dialogue database. Another approach is to write independent conversations in the dialogue database, and branch in Unity by using multiple Conversation Triggers. Set each Conversation Trigger's Condition so only one will be true at any given time.
Cross-Conversation Links
One approach is to write a separate conversation for each quest. Then create a starting "hub" conversation that contains cross-conversation links to the quest-specific conversations. Configure your NPC's Conversation Trigger to play this starting conversation. Configure the Conditions fields on the quest conversations to specify which cross-conversation link to follow.
Here's an example of the hub conversation:
And the cross-conversation links:
In the first image, I also used forward slashes ( / ) in the conversation titles to group the conversations into a submenu for the NPC. This just makes it easier to select conversations in the editor.
Group Nodes
Alternatively (or even in combination), use Group nodes. To make a dialogue entry node into a Group node, tick its Group checkbox. Group nodes will check their Conditions fields. If true, they will run their Script fields and then immediately pass through to their children without showing any subtitle text. Group nodes allow you to reduce the number of links between nodes, which may make it more manageable to keep all your content in a single conversation.
Here is an example that uses Group nodes:
Multiple Conversation Triggers
Both of the examples above keep all of the branching inside the dialogue database. Another approach is to write independent conversations in the dialogue database, and branch in Unity by using multiple Conversation Triggers. Set each Conversation Trigger's Condition so only one will be true at any given time.