Effects
Categories:
Effects are synchronous actions executed from EffectsNodeData nodes within a dialogue sequence. When the Dialogue Sequencer encounters an Effects node, it calls DoEffect() on each DialogueEffect in the node’s list in order, then immediately advances to the next node.
All effects are polymorphic — extending the base class automatically populates the effects list in the dialogue editor at startup.
For usage guides and setup examples, see The Basics: GS_Cinematics.
Contents
- DialogueEffect (Abstract Base)
- SetRecords_DialogueEffect
- ToggleEntitiesActive_DialogueEffect
- Complete Effect Type Reference
- Creating a Custom Effect
- See Also
DialogueEffect (Abstract Base)
The base class for all dialogue effects. Effects execute synchronously and can be reversed for rollback scenarios.
| Property | Type | Description |
|---|---|---|
| TypeId | {71E2E05E-A7A3-4EB3-8954-2F75B26D5E3A} |
Virtual Methods
| Method | Description |
|---|---|
DoEffect() | Executes the effect. Called by the sequencer when the EffectsNodeData is processed. |
ReverseEffect() | Undoes the effect. Used for rollback or undo scenarios. |
Lifecycle
- The sequencer encounters an
EffectsNodeDatanode. - The sequencer calls
DoEffect()on each effect in the node’s list in order. - All effects complete synchronously within the same frame.
- The sequencer immediately advances to the next node.
SetRecords_DialogueEffect
Sets one or more game records in the GS_Save RecordKeeper system. Commonly used to flag quest progress, NPC disposition, or world state changes triggered by dialogue.
| Property | Type | Description |
|---|---|---|
| TypeId | {FFCACF63-0625-4EE5-A74B-86C809B7BF80} | |
| Records | AZStd::vector<RecordEntry> | List of record name/value pairs to set on execution. |
ToggleEntitiesActive_DialogueEffect
Activates or deactivates a list of entities in the level. Used to show or hide objects, enable or disable triggers, or change world state during dialogue.
| Property | Type | Description |
|---|---|---|
| TypeId | {F97E1B87-EE7A-4D26-814C-D2F9FA810B28} | |
| Entities | AZStd::vector<AZ::EntityId> | The entities to activate or deactivate. |
| Active | bool | Target active state: true to activate, false to deactivate. |
Complete Effect Type Reference
| Type | TypeId | Description |
|---|---|---|
DialogueEffect | {71E2E05E-A7A3-4EB3-8954-2F75B26D5E3A} | Abstract base |
SetRecords_DialogueEffect | {FFCACF63-0625-4EE5-A74B-86C809B7BF80} | Sets game records |
ToggleEntitiesActive_DialogueEffect | {F97E1B87-EE7A-4D26-814C-D2F9FA810B28} | Activates/deactivates entities |
Creating a Custom Effect
To add a custom effect type from an external gem:
1. Define the class
#pragma once
#include <GS_Cinematics/Dialogue/Effects/DialogueEffect.h>
namespace MyGem
{
class PlaySound_DialogueEffect : public GS_Cinematics::DialogueEffect
{
public:
AZ_RTTI(PlaySound_DialogueEffect, "{YOUR-UUID-HERE}", GS_Cinematics::DialogueEffect);
AZ_CLASS_ALLOCATOR(PlaySound_DialogueEffect, AZ::SystemAllocator);
static void Reflect(AZ::ReflectContext* context);
void DoEffect() override;
void ReverseEffect() override;
private:
AZStd::string m_soundEvent;
};
}
2. Implement and reflect
#include "PlaySound_DialogueEffect.h"
#include <AzCore/Serialization/SerializeContext.h>
namespace MyGem
{
void PlaySound_DialogueEffect::Reflect(AZ::ReflectContext* context)
{
if (auto sc = azrtti_cast<AZ::SerializeContext*>(context))
{
sc->Class<PlaySound_DialogueEffect, GS_Cinematics::DialogueEffect>()
->Version(1)
->Field("SoundEvent", &PlaySound_DialogueEffect::m_soundEvent);
if (auto ec = sc->GetEditContext())
{
ec->Class<PlaySound_DialogueEffect>("Play Sound", "Fires a sound event during dialogue.")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::Category, "MyGem/Effects")
->DataElement(AZ::Edit::UIHandlers::Default, &PlaySound_DialogueEffect::m_soundEvent, "Sound Event", "");
}
}
}
void PlaySound_DialogueEffect::DoEffect()
{
// Fire the sound event
}
void PlaySound_DialogueEffect::ReverseEffect()
{
// Stop the sound if needed
}
}
Custom effects are discovered automatically at startup through O3DE serialization — no manual registration step is required.
See Also
For conceptual overviews and usage guides:
- Dialogue System Overview – Architecture and subsystems
- GS_Cinematics Overview – Top-level gem reference
For component references:
- Dialogue Sequencer – How the sequencer drives effects
- Dialogue Data Structure – EffectsNodeData and data model
For related resources:
- Performances – Asynchronous performance types
Get GS_Cinematics
GS_Cinematics — Explore this gem on the product page and add it to your project.