Dialogue Choice Flow
Model a short conversation as one prompt State with one transition per visible answer. This keeps response availability, selected outcomes, and UI ownership explicit.
Build the graph
- Create an Action State named
Show Questionthat enables the question panel and assigns its text. - Add
Accept,Decline, andAsk LaterStates for the possible outcomes. - Connect Show Question to each response State.
- Add one UI-button or event Condition to each transition. Give every button or event a unique, stable identifier.
- In each response State, run the Actions that update dialogue data, quests, reputation, or another project system.
- Connect every completed response to
Close Dialogueor back to the owning conversation flow.
How it runs
Only Show Question listens for the response. Selecting one answer makes its transition valid, exits the question State, and prevents the other outcomes from running. The response State applies its result and then finishes or waits for the next prompt.
If several Conditions read one shared selection index, order the most specific choices first and clear the index when the response is consumed. An event-per-button design avoids a stale selection remaining valid when the same prompt is entered again.
Key choices
- Keep UI enable/disable work in Actions and yes-or-no selection checks in Conditions.
- Use Shared Variables for the speaker, listener, current line, and selected response only when several States need them.
- Use a Subgraph when many conversations share the same prompt/response lifecycle.
- Keep narrative data in the dialogue system or project model; the graph should coordinate the flow rather than duplicate the complete script.
Verify in Play Mode
Open the prompt and choose each response in a separate run. Exactly one response State should activate, the other branches should remain inactive, and reopening the prompt should not automatically reuse the prior answer.
Troubleshooting
| Symptom | Check | Fix |
|---|---|---|
| Two responses run. | Shared input event, Condition Mode, and transition order. | Give each response a unique event or value and consume it once. |
| The old response runs on reopen. | Stored selection or unconsumed event. | Clear the value on entry or after the transition. |
| The UI closes before a click is read. | Action completion and transition evaluation timing. | Keep Show Question active until a response Condition becomes valid. |