Skip to content

6.1 Dispatchers of the Actor Component

BDC_Patrick edited this page Dec 9, 2025 · 4 revisions

Participant Component Events

The BDC_DialogBackend_ActorComponent provides three key Event Dispatchers (Delegates).
These allows you to react to Dialog-States on a per-character basis, rather than globally.

Event Description
OnDialogStarted Fires when this specific participant enters a dialog interaction.
OnDialogFinished Fires when the dialog session for this participant ends.
OnReceivedEvent Fires when an Event Node sends a command specifically to this participant.

OnDialogStarted & OnDialogFinished

These two events are parameterless and straightforward. They are best used for state management of your NPC/Actor.

Use Cases

  • Movement Control:
    • On Started: Disable "Random Patrol" or "AI Movement" logic. Stop the character in place.
    • On Finished: Re-enable movement logic, allowing the NPC to return to their schedule.
  • Focus & LookAt:
    • On Started: Set the Player as the "Look At" target for the head/eyes.
    • On Finished: Clear the focus target or return to looking ahead.
  • Animation:
    • On Started: Play a "Greeting" montage (e.g., Waving hand). Switch to an "Attentive" Idle pose.
    • On Finished: Play a "Goodbye" montage.
  • UI Interaction:
    • On Started: Hide the "Interaction Prompt" (e.g., 'Press E to Talk') overhead widget.
    • On Finished: Show the prompt again after a short delay.

OnReceivedEvent

This is the primary data-transfer event. It is triggered by the Event Node in the Dialog Graph. This allows the Dialog System to communicate complex instructions and data back to the gameplay actor.

Arguments

Name Type Description
EventTag FGameplayTag The main identifier for the event (e.g., Action.GiveItem, State.Angry). Use a "Switch on Gameplay Tag" node here to handle different logic branches.
EventValues FStruct_GlobalValueSystem A container for primitive values defined in the Event Node. Contains Maps for:
  • GlobalInteger (e.g., Amount of Gold)
  • GlobalFloat (e.g., Relationship Change amount)
  • GlobalBool (e.g., bIsQuestItem)
  • GlobalName, GlobalString, etc.
MassTags FGameplayTagContainer A container of tags passed from the Event Node. Useful if you need to pass multiple flags at once (e.g., Item.Consumable, Item.Rare).
Additionals FStruct_AdditionalValues A container for Object and Class references. Contains Maps for:
  • AdditionalObjects (TMap<FName, Object>)
  • AdditionalClasses (TMap<FName, Class>)
Useful for passing specific Item Classes to spawn or specific Actor References to interact with.

Explicit Use Cases

1. Giving an Item to the Player

Setup in Graph (Event Node):
- Event Message Tag: Event.GiveItem
- Values (Int): Key="Amount", Value=5
- Additionals (Class): Key="ItemClass", Value=BP_HealthPotion

Logic in Actor (OnReceivedEvent):
1. Switch on Tag (Event.GiveItem).
2. Break Additionals -> Find Class in AdditionalClasses using Key "ItemClass".
3. Break EventValues -> Find Int in GlobalInteger using Key "Amount".
4. Call your Inventory System's AddItem(Class, Amount) function.

2. Changing NPC Alignment/Relationship

Setup in Graph (Event Node):
- Event Message Tag: Event.UpdateRelationship
- Values (Float): Key="ChangeAmount", Value=-15.0

Logic in Actor (OnReceivedEvent):
1. Switch on Tag (Event.UpdateRelationship).
2. Break EventValues -> Find Float in GlobalFloat using Key "ChangeAmount".
3. Add this value to the NPC's internal CurrentRelationship variable.
4. If CurrentRelationship drops below 0, trigger PlayAnimMontage(AngryFace).

3. Starting a Quest

Setup in Graph (Event Node):
- Event Message Tag: Event.StartQuest
- Values (Name): Key="QuestID", Value="KillRats"
- MassTags: Quest.Urgent, Quest.SideMission

Logic in Actor (OnReceivedEvent):
1. Switch on Tag (Event.StartQuest).
2. Break EventValues -> Find Name in GlobalName using Key "QuestID".
3. Check MassTags -> If it has Quest.Urgent, play a "Panicked" voice line.
4. Add the Quest ID to the player's quest log via the Game Instance or Player Controller.

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