Condition / If / Else

Used to select which block to execute from multiple conditional branches. Condition is a multi-branch selection structure that can contain multiple If branches and one Else fallback.

Each If includes its own condition expression and the commands to execute.


Example:

Condition(
    If(IsNight(), 
        Log("Night Time"), 
        Goto("NightFlow")
    ),
    If(IsMidNight(), 
        Log("Mid Night Time"), 
        Goto("MidNightFlow")
    ),
    Else(
        Goto("DayFlow")
    )
)

Explanation:

  • Condition checks each If branch’s condition in order.

  • It executes the first If whose condition is true.

  • If none of the If conditions are true, the Else block runs.


✅ Use Cases

  • Multi-branch dialogue choices

  • Selecting logic based on game time, status, or quest state

  • Complex state machine transitions

Last updated