Skip to content

Manager

Introduction

The pawn responsible for managing the dialogue

Dependencies

The DialogueManager relies on other components of this plugin to work:

  • Logger: Used to log useful information to help you debug any issues you might experience
  • Audio: Used to play sound effects either 2D or at a specified location

Components

The DialogueManager uses the following components:

Name Description Type
AudioComponent The audio component responsible for playing the audio files of the dialogue entries UAudioComponent*

API Reference

Properties

Property Description Type Default Value
Dialogue The dialogue that should be played by the dialogue manager UDialogue* nullptr
DialogueWidgetClass The class of the widget used to display the dialogue TSubclassOf<UDialogueWidget>
PlayOnStart A boolean value indicating if the dialogue should automatically play when the level is started bool true
DestroyOnComplete A boolean value indicating if the dialogue should automatically be destroyed when completed bool true
StopOnComplete A boolean value indicating if the dialogue should automatically be stopped when completed bool true
SkipSFX The sound effect to play when an entry is skipped USoundBase* nullptr
AdvanceSFX The sound effect to play when advancing to the next entry USoundBase* nullptr
InputMappingContext The input mapping context used to interact with the dialogue UInputMappingContext* nullptr
SkipAction The input action used to skip the current dialogue entry UInputAction* nullptr

Events

Name Description Params
OnDialogueEnded Event used to notify other classes when the dialogue has ended LastEntryId (FName)
The ID of the last entry in the dialogue
OnDialogueEntryStarted Event used to notify other classes when a dialogue entry has started LastEntryId (FName)
The ID of the dialogue entry
OnDialogueEntryEnded Event used to notify other classes when a dialogue entry has ended LastEntryId (FName)
The ID of the dialogue entry

Functions

Name Description Params Return
PlayDialogue Play the dialogue
StopDialogue Stop playing the dialogue
DestroyDialogue Stop playing the dialogue and destroy the dialogue manager
SkipEntry Skip the current entry in the dialogue
GetDialogueWidget Get the dialogue widget UDialogueWidget*
A reference to the dialogue widget

Blueprint Usage

You can use the DialogueManager using Blueprints by adding one of the following nodes:

  • Ultimate Starter Kit > Dialogue > Play Dialogue
  • Ultimate Starter Kit > Dialogue > Stop Dialogue
  • Ultimate Starter Kit > Dialogue > Destroy Dialogue
  • Ultimate Starter Kit > Dialogue > Skip Entry
  • Ultimate Starter Kit > Dialogue > Get Dialogue Widget

C++ Usage

Before you can use the plugin, you first need to enable the plugin in your Build.cs file:

PublicDependencyModuleNames.Add("USK");

The DialogueManager can now be used in any of your C++ files:

#include "USK/Dialogue/DialogueManager.h"

void ATestActor::Test()
{
    // DialogueManager is a pointer to the ADialogueManager
    DialogueManager->PlayDialogue();
    DialogueManager->StopDialogue();
    DialogueManager->DestroyDialogue();
    DialogueManager->SkipEntry();
    UDialogueWidget* DialogueWidget = DialogueManager->GetDialogueWidget();
}