57. Start a branching conversation
Use Dialogue Designer for lines, choices, revisiting topics and conversation flow. Use the Visual Script graph to decide when that conversation should start and what follows it.
1. Create and test a dialogue record with a valid start node.
2. In the NPC’s Talk graph, do the approach/facing work first.
3. Add Start Dialogue and choose that dialogue ID.
4. Connect the continuation to the response that should happen after the dialogue finishes.
5. Put choice-specific item or variable changes inside the relevant dialogue actions or a called helper.
6. Test each choice, its return path and the end of the conversation.
| Task | Best place |
|---|---|
| May this conversation start? | A visual condition before Start Dialogue. |
| Which answer did the player choose? | The dialogue’s choice flow and actions. |
| One shared reward operation | An exposed helper called by the appropriate dialogue branch. |
| Work after the whole conversation | The continuation after Start Dialogue, or a filtered OnDialogueEnded listener when deliberately centralized. |
The current Start Dialogue call awaits the dialogue run. A waiting line or choice can keep it open until the player responds. End Dialogue cancels the active conversation; plan what should happen after cancellation as well as normal completion.
Avoid awarding the same item both inside the dialogue’s final branch and again after Start Dialogue. Put the reward in one clearly guarded place.
