Skip to content

LSDE Dialog Engine / ExportCondition

Interface: ExportCondition

Defined in: types.ts:57

Condition evaluated to control dialogue flow or choice visibility.

Remarks

Conditions are evaluated left-to-right with no operator precedence. The chain field on each condition determines how it combines with the accumulated result:

  • Empty array → true (no conditions = pass)
  • First condition → its raw boolean result (chain is ignored)
  • chain = '&' or absent → AND with the accumulated result
  • chain = '|' → OR with the accumulated result

This means A AND B OR C evaluates as (A AND B) OR C, not A AND (B OR C).

The developer is responsible for interpreting key, operator, and value against the game state via the onCondition handler — the engine only handles the chaining logic.

See

Properties

chain?

optional chain?: "|" | "&"

Defined in: types.ts:63

Logical chaining with the previous condition: '|' (OR) or '&' (AND). Defaults to AND if omitted. Ignored on the first condition in a chain.


key

key: string

Defined in: types.ts:61

State key to evaluate (e.g. "has_item", "player_level"). Interpreted by the onCondition handler.


operator

operator: string

Defined in: types.ts:65

Comparison operator (e.g. "==", "!=", ">", "<", ">=", "<="). Interpretation is up to the onCondition handler.


uuid

uuid: string

Defined in: types.ts:59

Unique identifier for this condition instance.


value

value: string

Defined in: types.ts:67

Value to compare against. Always a string — the developer is responsible for type coercion.