본문으로 건너뛰기

Using Simple Dialogue Subsystem

Simple Dialogue Subsystem is a subsystem that handles the whole logic related to the playback and searching of the dialogues ingame.

Learning how to use Simple Dialogue Subsystem is essential step to control the playback of the dialogues.


Accessing Simple Dialogue Subsystem on BP

SDSS(SimpleDialogueSubsystem) reference can be obtained on any C++ class by as following :

if(!GetGameInstance()) { return nullptr; }

if(!GetGameInstance()->GetSubsystem<USimpleDialogueSubsystem>()) { return nullptr; }

return GetGameInstance()->GetSubsystem<USimpleDialogueSubsystem>();

SDSS(SimpleDialogueSubsystem) reference can be obtained on any blueprint by searching as following :

Alt text

Provided Features

Starting Dialogue

Alt text

SDSS provides those two functions you can use to start off any dialogues.

StartDialogue

You can create a dialogue widget with dialogue manager you want with this function.

You can specify the dialogue widget class you want to use, and dialogue asset to play on the dialogue.

You can select whether to automatically add it to the viewport. if you don't want to add it to the screen right away, then you can disable it and find the dialogue widget later and use it as you want.

You can specify the node where the dialogue will start from. Leave it blank(none) to start from the beginning.

You can double-click the name label for the node to rename the node as you want.

Alt text

If you specify the Dialogue ID property you want, then it will set the dialogue's ID to it, and later you can access to the dialogue with the ID, either you can make it use a specific ID and access the dialogue via that ID on other multiple BPs.

노트

If you don't specify the ID, it will use ramdomly generated ID instead.

Return value of both functions is the dialogue ID the newly generated dialogue has.

warning

You must to use this function to start off dialogue. It is not good way to manually create a dialogue widget and feed a dialogue manager to it.

StartDialogueWithParams

it's almost same with the StartDialogue, but it provide an argument called IDToHandleComponentReferenceOverride.

It literally overrides the participant components' references for the specific Participant Key that dialogue widget automatically collects when the dialogue initializes.

This is useful for some occasions such as when you have to specify the participants that has different IDName from the role in the dialogue, or when you have to specify a character among multiple characters with same IDNames.

Here is the real usage:

When a dialogue manager has "Cube" as a one of the participants, and if you want to feed a UDialogueHandleComponent with the IDName as "Cube_Test1" to that role,

Add this fair to this function's IDToHandleComponentReferenceOverride : ("Cube", target_UDialogueHandleComponent_reference(in this case, a UDialogueHandleComponent with the IDName "Cube_Test1")).

Ending Dialogues

Alt text

SDSS provides End Dialogue that make the specified dialogue end.

All you have to do is feeding the ID of the dialogue you want to make end.

Also you can specify whether to terminate it immediately. (Remove from the viewport immediately)

Finding Dialogues & Getting All Dialogues

Alt text

SDSS provides Find Dialogue that returns the dialogue widget reference for the specified ID.

Alt text

SDSS also provides Find Dialogue that returns the whole dialogue widgets' references that are being played on the level.

Ending Dialogues

Alt text

SDSS provides Find Dialogue that returns the dialogue widget reference for the specified ID.

Finding Participant Handle (Speech Bubble Handle)

Alt text

SDSS provides FindFirstSpeechbubbleHandle, FindSpeechBubbleHandles, GetAllSpeechBubbleHandleComponents that can be used to gather the references of participant handle component with specific IDName, or all the components on the level.

Delegates for Dialogue Start / End

Alt text

You can also use those delegates to detect the start / end of the dialogue.

warning

Detecting dialogue's start event will not be triggered on the very first beginning of the game world as expected.