LSDE Dialog Engine / ConditionBlock
Interface: ConditionBlock
Defined in: types.ts:369
Condition block — evaluates logic to branch the dialogue flow.
Remarks
Conditions are organized as a 2D array of groups (ExportCondition[][]). Each inner array is a "case" — conditions chained with & (AND) / | (OR).
Single group (classic true/false): [[c1, c2]] — resolve(true) → port 0, resolve(false) → port 1.
Multiple groups (switch mode): [[c1], [c2], [c3]] — groups are evaluated in order, first matching group routes to its port (case_0, case_1, ...), otherwise routes to default. Call context.resolve(matchingIndex) or context.resolve(-1) for default.
Dispatcher mode (nativeProperties.enableDispatcher = true): all groups are evaluated, every matching group fires its port as an async track, and the default port is the main continuation track (always executed). Call context.resolve(matchingIndices[]).
Example
engine.onCondition(({ block, context, next }) => {
const result = LsdeUtils.evaluateConditionGroups(
block.conditions ?? [],
(cond) => myEvaluator(cond),
!!block.nativeProperties?.enableDispatcher,
);
context.resolve(result);
next();
});See
- ExportCondition for condition structure and chaining rules
- ConditionContext for handler context
- NativeProperties.enableDispatcher for dispatcher mode
Extends
Properties
conditions?
optionalconditions?:ExportCondition[][]
Defined in: types.ts:375
2D array of condition groups. Each inner array is a "case" — conditions chained with & / |. Single group: classic true/false branching. Multiple groups: switch mode (case_0..N / default).
isStartBlock?
optionalisStartBlock?:boolean
Defined in: types.ts:260
When true, this block is the entry point of the scene. Only one per scene.
Inherited from
BlueprintBlockBase.isStartBlock
label?
optionallabel?:string
Defined in: types.ts:248
Display label assigned in the editor.
Inherited from
metadata?
optionalmetadata?:BlockMetadata
Defined in: types.ts:258
Non-logic metadata for display and organization.
Inherited from
nativeProperties?
optionalnativeProperties?:NativeProperties
Defined in: types.ts:256
LSDE native execution properties (async, delay, portPerCharacter, etc.).
Inherited from
BlueprintBlockBase.nativeProperties
note?
optionalnote?:string
Defined in: types.ts:377
Designer note. Not displayed to players.
parentLabels?
optionalparentLabels?:string[]
Defined in: types.ts:250
Hierarchy of parent folder labels providing structural context.
Inherited from
BlueprintBlockBase.parentLabels
properties
properties:
BlockProperty[]
Defined in: types.ts:252
Custom key-value properties defined by block configuration.
Inherited from
type
type:
"CONDITION"
Defined in: types.ts:370
Block type determining behavior and rendering.
Overrides
userProperties?
optionaluserProperties?:Record<string,string|number|boolean>
Defined in: types.ts:254
User-defined custom properties dictionary set by the narrative designer.
Inherited from
BlueprintBlockBase.userProperties
uuid
uuid:
string
Defined in: types.ts:244
Unique block identifier.
