UGameplayCueTranslator_Test::GameplayCueToTranslationIndex

This is called at runtime to actually do the swapping.

Windows
MacOS
Linux

Override Hierarchy

UGameplayCueTranslator::GameplayCueToTranslationIndex()

UGameplayCueTranslator_Test::GameplayCueToTranslationIndex()

References

Module

GameplayAbilities

Header

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

Include

#include "GameplayCueTranslator.h"

Syntax

virtual int32 GameplayCueToTranslationIndex
(
    const FName & TagName,
    AActor * TargetActor,
    const FGameplayCueParameters & Parameters
) const

Remarks

This is called at runtime to actually do the swapping. This is a trivial example, we will use hardcoded memory addressess to switch on the 3 possible translations. A more realistic approach would be to look at something on the AActor (maybe, cast it to your base actor or interface type) or the GameplayCue parameters. Using an acceleration map may be a good idea here: your translator class could have access to a global map that maps actor* -> swap index.

Important thing to understand: the int32 returned is the index into the SwapList that we created in ::GetTranslationNameSpawns()!

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss