Step 6: Conditions and Effects
Categories:
Step 6 — Conditions and Effects
Using Variables
Declare variables in the Variable Panel to track dialogue state:
- Open the Variable Panel dock
- Click Add and create a boolean variable:
"hasVisitedMerchant"(default: false)
Conditions on Nodes
Any dialogue node can have conditions that gate whether it executes. If conditions fail, the evaluator skips that node and tries the next connection.
- Select a Text node in the inspector
- In the Conditions section, click the type picker dropdown
- Add a
Boolean_DialogueCondition - Set:
- Variable Name:
"hasVisitedMerchant" - Expected Value:
true
- Variable Name:
Now that Text node only executes if the player has visited before. You can create two branches from a single output — one with hasVisitedMerchant = true and one without conditions as a fallback.
Effects Nodes
Effects nodes trigger game actions during dialogue. They are the bridge between conversation and gameplay.
- Drag an Effects node from the palette
- Place it in the flow where you want the effect to happen
- Select it and use the type picker in the Inspector to add effect types
For example, after the merchant’s greeting, add an Effects node that sets hasVisitedMerchant = true so subsequent visits show different dialogue.
Performance Nodes
Performance nodes trigger character actions — animations, movement, posing:
- Drag a Performance node into the flow
- Add performance types via the Inspector type picker:
MoveTo_DialoguePerformance— Move a character to a positionPathTo_DialoguePerformance— Move along a path
- Enable Wait to Continue if the dialogue should pause until the performance finishes
Creating Custom Types
The polymorphic extension system makes it simple to add project-specific conditions, effects, and performances:
- Create a subclass of
DialogueCondition,DialogueEffect, orDialoguePerformance - Add
AZ_RTTIand implementReflect()with SerializeContext and EditContext - Include and reflect it in
DialogueSequencerComponent::Reflect()
The inspector automatically discovers your new type — no registry code needed.
Complete Example
Here is a complete branching dialogue with conditions and effects:
Start
→ [Merchant greeting (no condition): "Welcome, stranger!"]
→ [Merchant greeting (hasVisitedMerchant=true): "Welcome back, friend!"]
→ Selection: "Buy" / "Sell" / "Leave"
→ "Buy" → Effects(OpenShopUI) → End
→ "Sell" → Effects(OpenSellUI) → End
→ "Leave" → [Merchant: "Come again!"] → Effects(Set hasVisitedMerchant=true) → End
Summary
You now have a complete dialogue pipeline:
- Database with performers and multiple sequences
- Visual authoring with Text, Selection, Random, Effects, and Performance nodes
- Runtime components (Manager, Sequencer, UI Bridge) executing the graphs
- UI display with typewriter text reveal and player choice buttons
- Conditions for dynamic branching based on game state
- Effects for triggering gameplay from within dialogue
For the full API reference, see the Dialogue Editor documentation.