FGameplayCueTranslationEditorOnlyData

Overview of the GameplayCueTranslator system

Choose your operating system:

Windows

macOS

Linux

References

Module

GameplayAbilities

Header

/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/GameplayCueTranslator.h

Include

#include "GameplayCueTranslator.h"

Syntax

struct FGameplayCueTranslationEditorOnlyData

Remarks

Overview of the GameplayCueTranslator system

This system facilitates translating a GameplayCue event from one tag to another at runtime. This can be useful for customization or override type of systems that want to handle GameplayCues in different ways for different things or in different contexts.

Some example uses:

Your game emits generic events: GameplayCue.Hero.Victory (an event to play a victory sound/animation). Depending on which Hero this is played on, you may want different sounds. This system can be used to translate the generic GameplayCue.Hero.Victory into GameplayCue.<YourHeroName>.Victory.

Your game wants to translate GameplayCue.Impact.Material into GameplayCue.Impact.<Stone/Wood/Water/Etc>, based on the physics material of the surface that was hit.

Though there are other ways of accomplishing these examples, the main advantages to a translator approach is that you can maintain single, atomic GC Notifies, rather than A) having monolithic GC Notifies/handlers that "know how to handle every possible variation" (and now have to deal with loading/unloading the ones that are needed) or B) Storing the override assets on a character blueprint/data asset that the GC Notify/handler would pull from (this hampers work flow because now you need to add override properties somewhere for each GameplayCue event that wants to use this. You can no longer have a simple GC Notify class that "just plays sounds and FX").

How to use:

C++: Implement your own UGameplayCueTranslator. See UGameplayCueTranslator_Test as an example. You essentially need to implement two functions:

GetTranslationNameSpawns: return a list of possible tag translations (called once at startup to gather information)

GameplayCueToTranslationIndex: returns the index into the list you returned in #1 for which translation to apply to a given tag/context.

Editor: Use GameplayCue editor to add new tags and notifies. The GCEditor has built in functionality to make this easier. It can auto create the tags for you and new GC Notify assets that derive off of the base tags/notifies.

Useful commands: Log LogGameplayCueTranslator Verbose [enable logging of tag translation]

GameplayCue.PrintGameplayCueTranslator [prints translationLUT] GameplayCue.BuildGameplayCueTranslator [rebuilds translationLUT, useful for debugging]--------------------------------------------------------------------------Editor only. Data that is only used by the GameplayCue editor tool

Variables

Name Description

Public variable

FName

 

EditorDescription

Public variable

bool

 

Enabled

Public variable

FString

 

ToolTip

Public variable

int32

 

UniqueID

Constructors