Step 6: Conditions and Effects

Gate dialogue branches with conditions and trigger game effects from dialogue.

Step 6 — Conditions and Effects

Using Variables

Declare variables in the Variable Panel to track dialogue state:

  1. Open the Variable Panel dock
  2. 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.

  1. Select a Text node in the inspector
  2. In the Conditions section, click the type picker dropdown
  3. Add a Boolean_DialogueCondition
  4. Set:
    • Variable Name: "hasVisitedMerchant"
    • Expected Value: true

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.

  1. Drag an Effects node from the palette
  2. Place it in the flow where you want the effect to happen
  3. 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:

  1. Drag a Performance node into the flow
  2. Add performance types via the Inspector type picker:
    • MoveTo_DialoguePerformance — Move a character to a position
    • PathTo_DialoguePerformance — Move along a path
  3. 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:

  1. Create a subclass of DialogueCondition, DialogueEffect, or DialoguePerformance
  2. Add AZ_RTTI and implement Reflect() with SerializeContext and EditContext
  3. 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.