Quick Start (5 Steps)

👋Quick Start

1

Create Data Asset

  1. In the Content Browser, right-click → Miscellaneous → Data Asset → select DialogueDataAsset → Name it

  2. Open the DialogueDataAsset asset and configure it according to your needs.

    • SpeakerInfos: Add speakers and set SpeakerName, DisplayName, Avatar, and SpeakerColor.

      • Global Variables: Define variables and set VariableName, ValueType, and DefaultValue.

      • DialogueSequences: Create a new sequence and set SequenceName and StartNodeID.

    Note: Pay special attention to the content in the yellow box, as it affects the first dialogue’s start and how dialogues connect. Both the first and subsequent dialogues are identified and controlled by GUIDs.

2

Configure Node

Dialogue Node (FDialogueNode with NodeType=Text):

  • Set DialogueText (dialogue text)

  • Set SpeakerName (reference a speaker from SpeakerInfos)

  • Configure DisplayDelay (delay before displaying text; 0 = immediate)

  • Configure AutoAdvanceDelay (auto-advance after delay; 0 = manual)

  • Set NextNodeID (target node after this node)

Choice Node (FDialogueChoiceNode):

  • Set PromptText (question or prompt text)

  • Add choices to the Choices array

  • Configure bAllowMultipleSelection (true enables multiple selection)

  • Set MinSelectionCount and MaxSelectionCount (for multiple selection)

  • Configure SelectionTimeout (seconds; 0 = no timeout)

  • Set TimeoutNodeID (node to jump to after timeout)

Condition/Event/Delay Node:

  • Condition: Add conditions to the node's Conditions array

  • Event: Set EventName to broadcast the event

  • Delay: Set DisplayDelay to the delay duration in seconds

3

Add the component to your Actor.

  1. Select the Actor that will drive the dialogue (e.g., player character, UI controller).

  2. Add Component → Search for Dialogue System Component.

  3. In BeginPlay or during initialization:

    • Call LoadDialogueDataAsset(DataAsset) and pass in your DialogueDataAsset.

4

Starting and Driving Dialogue (Blueprint)

Starting Dialogue:

  • Call StartDialogue(SequenceName) and pass in the sequence name from the data asset.

Event Binding:

  • UIText Node Event: Bind OnDialogueNodeExecuted(Node, SpeakerInfo, NodeID) to display the UI

  • Choice Node Event: Bind OnDialogueChoiceNodeExecuted(ChoiceNode, AvailableChoices, NodeID) to display choices

  • Event Callback: Bind OnDialogueEventTriggered(EventName) for external system integration

  • Dialogue End: Bind OnDialogueEnded for cleanup

Advancing Dialogue:

  • Automatic: If AutoAdvanceDelay > 0, the dialogue advances automatically

  • Manual: Call AdvanceDialogue() when the player clicks "Next"

Submitting Choices:

  • Collect the selected ChoiceID values (FGuid) from the UI

  • Call SubmitChoice(SelectedChoiceIDs) and pass in the array of selected choice IDs

Dialogue End:

  • When the sequence completes, the component automatically triggers OnDialogueEnded.

5

Managing Variables and Conditions

Reading Variables:

  • Call GetVariableValue(VariableName, OutValue) to read the current value.

Setting Variables:

  • Call SetVariableValue(VariableName, ValueString, ValueType) to modify runtime variables.

Condition Evaluation:

  • Node Conditions determine whether a node executes (all conditions must pass)

  • Choice AvailabilityConditions determine whether a choice is visible/selectable

  • Conditions are automatically evaluated by the system


Minimum Workflow (Quick Reference)

  1. Create DialogueDataAsset → Configure SpeakerInfos, GlobalVariables, DialogueSequences

  2. Add DialogueSystemComponent to Actor → Call LoadDialogueDataAsset

  3. Bind events: OnDialogueNodeExecuted, OnDialogueChoiceNodeExecuted, OnDialogueEventTriggered, OnDialogueEnded

  4. Start dialogue: StartDialogue(SequenceName) → Update UI → AdvanceDialogue() or SubmitChoice()

Last updated