Skip to content

4.3 Listing Options

BDC_Patrick edited this page Dec 9, 2025 · 7 revisions

Handling Dialog Options

01. Detection & Retrieval

To determine if a Message has options, you can check the OptionMessagesCount integer in the Message Data. If greater than zero, options are available.

Alternatively, use the Subsystem function below.

Visual Description
Get Available Options

Get Available Options

Use the Subsystem's GetAvailableOptions function.

  • Returns Bool: HasAnyOptions (true if options exist).
  • Returns Array: An array of DialogDatasetOption structures containing the data for each option.

02. Creating the Option Widget

Visual Step Details
Option Widget Hierarchy

1. Hierarchy

Create a simple Widget Blueprint.

The most basic approach requires a Button and a Text Block to display the option text.

Option Variables and Dispatcher

2. Variables & Dispatchers

Add the following variables and mark them as Exposed and Instance Editable:

  • OptionData (Type: Struct_DialogDatasetOption)
  • OptionIndex (Type: Integer)

Create an Event Dispatcher called OnOptionSelected with an Integer input (to pass the Index back).

Option Widget Graph

3. Setting Data

In the Graph (e.g., on Construct), break the OptionData struct and use the Text field to set your Button's label.

Option Selecting Logic

4. On Click Logic

Implement the OnClicked event for your button.

Call the OnOptionSelected Dispatcher and pass the OptionIndex variable as the argument.


03. Implementation (Spawning)

Visual Step Details
Option Spawning

1. Spawning the Loop

Iterate through the Array returned by GetAvailableOptions using a ForEach Loop.

  • Create Widget: Spawn your Option Widget.
  • Pass Data: Plug the Array Element into OptionData and the Array Index into OptionIndex.
  • Add Child: Add the new widget to your UI container (e.g., Vertical Box).
Option Event Binding

2. Binding the Event

After adding the child, use the Assign or Bind Event node on the Dispatcher OnOptionSelected.

This allows your main Dialog UI to react when the player clicks an option.

Tip: After spawning all options, it is recommended to set the User Focus to the first child of your option container (Index 0) to support Gamepad navigation immediately.

Documentation Index

I. What is the Dialog Backend?
II. Setting up
III. Binding UI
IV. The Subsystem
V. The Components
VI. Dispatchers
VII. Others

Demo available: Demo Page

Clone this wiki locally