UGameplayModMagnitudeCalculation

Class used to perform custom gameplay effect modifier calculations, either via blueprint or native code

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

GameplayAbilities

Header

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

Include

#include "GameplayModMagnitudeCalculation.h"

Syntax

UCLASS(BlueprintType, Blueprintable, Abstract)
class UGameplayModMagnitudeCalculation : public UGameplayEffectCalculation

Remarks

Class used to perform custom gameplay effect modifier calculations, either via blueprint or native code

Variables

Name Description

Protected variable UProperty Category, EditDefaultsOnly, AdvancedDisplay

bool

 

bAllowNonNetAuthorityDependencyRegistration

Whether the calculation allows non-net authorities to register the external dependency multi-cast delegate or not; Effectively whether clients are allowed to perform the custom calculation themselves or not

Constructors

Name Description

Public function

UGameplayModMagnitudeCalculation

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Const UFunction Category blueprintnativeevent

float

 

CalculateBaseMagnitude

(
    const FGameplayEffectSpec& Spec
)

Calculate the base magnitude of the gameplay effect modifier, given the specified spec.

Protected function Const

bool

 

GetCapturedAttributeMagnitude

(
    const FGameplayEffectAttributeCaptu...,
    const FGameplayEffectSpec& Spec,
    const FAggregatorEvaluateParameters...,
    OUT float& Magnitude
)

Convenience method to get attribute magnitude during a CalculateMagnitude call

Public function Virtual Const

FOnExternalG...

 

GetExternalModifierDependencyMulticast

(
    const FGameplayEffectSpec& Spec,
    UWorld* World
)

If the magnitude resultant from the custom calculation depends on game code-specific conditions that are not under the purview of the ability system, this method should be overridden to provide a multicast delegate that will fire when the reliant conditions change, so that the magnitude can be recalculated and updated.

Protected function UFunction BlueprintCallable, Category

float

 

GetSetByCallerMagnitudeByName

(
    const FGameplayEffectSpec& EffectS...,
    const FName& MagnitudeName
)

Extracts the Set by Caller Magnitude from a Gameplay Effect Spec

Protected function UFunction BlueprintCallable, Category

float

 

GetSetByCallerMagnitudeByTag

(
    const FGameplayEffectSpec& EffectS...,
    const FGameplayTag& Tag
)

Extracts the Set by Caller Magnitude from a Gameplay Effect Spec

Protected function UFunction BlueprintCallable, Category

const FGamep...

 

GetSourceActorTags

(
    const FGameplayEffectSpec& EffectS...
)

Returns the source actor tags from a Gameplay Effect Spec

Protected function UFunction BlueprintCallable, Category

FGameplayTag...

 

GetSourceAggregatedTags

(
    const FGameplayEffectSpec& EffectS...
)

Copies and returns the source aggregated tags from a Gameplay Effect Spec

Protected function UFunction BlueprintCallable, Category

const FGamep...

 

GetSourceSpecTags

(
    const FGameplayEffectSpec& EffectS...
)

Returns the source spec tags from a Gameplay Effect Spec

Protected function UFunction BlueprintCallable, Category

const FGamep...

 

GetTargetActorTags

(
    const FGameplayEffectSpec& EffectS...
)

Returns the target actor tags from a Gameplay Effect Spec Useful for Modifier Magnitude Calculations

Protected function UFunction BlueprintCallable, Category

FGameplayTag...

 

GetTargetAggregatedTags

(
    const FGameplayEffectSpec& EffectS...
)

Copies and returns the target aggregated tags from a Gameplay Effect Spec

Protected function UFunction BlueprintCallable, Category

const FGamep...

 

GetTargetSpecTags

(
    const FGameplayEffectSpec& EffectS...
)

Returns the target spec tags from a Gameplay Effect Spec Useful for Modifier Magnitude Calculations

Protected function UFunction BlueprintCallable, Category, Meta

float

 

K2_GetCapturedAttributeMagnitude

(
    const FGameplayEffectSpec& EffectS...,
    FGameplayAttribute Attribute,
    const FGameplayTagContainer& Sourc...,
    const FGameplayTagContainer& Targe...
)

Gets the captured magnitude value for the given Attribute For this to work correctly, the Attribute needs to be added to the Relevant Attributes to Capture array

Public function Const

bool

 

ShouldAllowNonNetAuthorityDependencyRegistration()

Simple accessor to bAllowNonNetAuthorityDependencyRegistration with some validation: Read the comment on that variable for usage!!!