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
engine.onChoice(({ context, next }) => {
showChoicesUI(context.choices, (selectedUuid) => {
context.selectChoice(selectedUuid);
next();
});
});See
- ChoiceItem for choice structure
- ChoiceContext for handler context
- ExportCondition for visibility conditions
Extends
Properties
choices?
optionalchoices?:ChoiceItem[]
Defined in: types.ts:330
Available player choices. Visibility is filtered at runtime via visibilityConditions.
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:332
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:
"CHOICE"
Defined in: types.ts:328
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.
