Skip to content

LSDE Dialog Engine / ChoiceBlock

Interface: ChoiceBlock

Defined in: types.ts:327

Choice block — presents selectable options to the player.

Remarks

The context.choices array contains ALL choices — none are filtered out. When onResolveCondition() is configured, the engine evaluates each choice's visibilityConditions and tags every RuntimeChoiceItem with visible: true | false. The developer filters with choices.filter(c => c.visible !== false). Without a filter, visible is undefined and all choices pass.

The handler must call context.selectChoice(uuid) to pick a choice. The engine then follows the connection whose fromPort matches the selected choice UUID.

If no onChoice handler is registered, the engine silently advances with no selection — the flow may end if no default connection exists.

Example

ts
engine.onChoice(({ context, next }) => {
  showChoicesUI(context.choices, (selectedUuid) => {
    context.selectChoice(selectedUuid);
    next();
  });
});

See

Extends

Properties

choices?

optional choices?: ChoiceItem[]

Defined in: types.ts:330

Available player choices. Visibility is filtered at runtime via visibilityConditions.


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:332

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: "CHOICE"

Defined in: types.ts:328

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