-
-
Notifications
You must be signed in to change notification settings - Fork 25
Dialogue Participant Interface
The Mountea Dialogue Participant Interface (IMounteaDialogueParticipantInterface
) is an interface designed to connect the Mountea Dialogue Graph with the Mountea Dialogue Manager Component. This interface allows any actor to be a dialogue participant, handling various dialogue-related functionalities such as starting dialogues, playing participant voices, and managing dialogue states.
This interface provides a comprehensive set of functions to handle dialogue processes within the game, including checking if a dialogue can start, saving and retrieving dialogue states, playing and skipping participant voices, and more. It includes several events to notify the system of changes in the dialogue state.
To use the IMounteaDialogueParticipantInterface
in C++, follow these steps:
Include the Interface Header:
#include "Interfaces/MounteaDialogueParticipantInterface.h"
void YourClass::InitializeParticipant_Implementation()
{
// Your implementation code
}
Implement all pure virtual functions defined in the interface. For example:
void YourClass::InitializeParticipant_Implementation()
{
// Your implementation code
}
For methods with default implementations, you can call them directly:
YourClassInstance->InitializeParticipant();
For functions that are meant to be called from Blueprints and require BlueprintNativeEvent, use the Execute_ prefix:
IMounteaDialogueParticipantInterface::Execute_CanStartDialogueEvent(YourClassInstance);
or
TScriptInterface<IMounteaDialogueParticipantInterface> interface = YourClassInstance;
interface->Execute_CanStartDialogueEvent(YourClassInstance);
To use the IMounteaDialogueParticipantInterface in Blueprints:
Open the class settings in the Blueprint Editor.
Under "Interfaces", click "Add" and select IMounteaDialogueParticipantInterface
.
Once the interface is added, you will see new functions in the Blueprint that you need to implement. Implement these functions by providing the necessary Blueprint logic.
You can call these interface functions from other Blueprints by using the appropriate nodes available in the Blueprint Editor.
Name | Inputs | Outputs |
---|---|---|
CanStartDialogueEvent | None |
bool (Whether the dialogue can start) |
GetOwningActor | None |
AActor* (The owning actor) |
SaveStartingNode |
NewStartingNode (The node to set as the starting node) |
None |
SaveTraversedPath |
InPath (The traversed path of the dialogue graph to be saved) |
None |
GetState | None |
EDialogueParticipantState (The participant state) |
GetTag | None |
FGameplayTag (The participant gameplay tag) |
InitializeParticipant | None | None |
PlayParticipantVoice |
ParticipantVoice (The sound to play) |
None |
SkipParticipantVoice |
ParticipantVoice (The sound to skip) |
None |
CanStartDialogue | None |
bool (Whether the dialogue can start) |
GetSavedStartingNode | None |
UMounteaDialogueGraphNode* (The saved starting node) |
GetDialogueGraph | None |
UMounteaDialogueGraph* (The dialogue graph) |
SetDialogueGraph |
NewDialogueGraph (The new dialogue graph to be used) |
None |
GetParticipantState | None |
EDialogueParticipantState (The participant state) |
SetParticipantState |
NewState (The new state to set the participant to) |
None |
GetDefaultParticipantState | None |
EDialogueParticipantState (The default participant state) |
SetDefaultParticipantState |
NewState (The new default state to set the participant to) |
None |
GetAudioComponent | None |
UAudioComponent* (The audio component) |
SetAudioComponent |
NewAudioComponent (The new audio component to use for dialogue audio) |
None |
GetTraversedPath | None |
TArray<FDialogueTraversePath> (The traversed path) |
GetParticipantTag | None |
FGameplayTag (The participant gameplay tag) |
Name | Inputs | Description |
---|---|---|
FDialogueGraphChanged | UMounteaDialogueGraph* NewGraph |
Event triggered when the dialogue graph changes. |
FDialogueParticipantStateChanged | const EDialogueParticipantState& NewState |
Event triggered when the dialogue participant state changes. |
FDialogueParticipantAudioComponentChanged | const UAudioComponent* NewAudioComp |
Event triggered when the audio component changes. |
FParticipantStartingNodeSaved | const UMounteaDialogueGraphNode* NewSavedNode |
Event triggered when the starting node is saved. |