Skip to content

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

ts
engine.onCondition(({ block, context, next }) => {
  const result = LsdeUtils.evaluateConditionGroups(
    block.conditions ?? [],
    (cond) => myEvaluator(cond),
    !!block.nativeProperties?.enableDispatcher,
  );
  context.resolve(result);
  next();
});

See

Extends

Properties

conditions?

optional conditions?: 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?

optional isStartBlock?: 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?

optional label?: string

Defined in: types.ts:248

Display label assigned in the editor.

Inherited from

BlueprintBlockBase.label


metadata?

optional metadata?: BlockMetadata

Defined in: types.ts:258

Non-logic metadata for display and organization.

Inherited from

BlueprintBlockBase.metadata


nativeProperties?

optional nativeProperties?: NativeProperties

Defined in: types.ts:256

LSDE native execution properties (async, delay, portPerCharacter, etc.).

Inherited from

BlueprintBlockBase.nativeProperties


note?

optional note?: string

Defined in: types.ts:377

Designer note. Not displayed to players.


parentLabels?

optional parentLabels?: 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

BlueprintBlockBase.properties


type

type: "CONDITION"

Defined in: types.ts:370

Block type determining behavior and rendering.

Overrides

BlueprintBlockBase.type


userProperties?

optional userProperties?: 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.

Inherited from

BlueprintBlockBase.uuid