Navigation
API > API/Plugins > API/Plugins/GameplayAbilities
UGameplayEffect The GameplayEffect definition. This is the data asset defined in the editor that drives everything. This is only blueprintable to allow for templating gameplay effects. Gameplay effects should NOT contain blueprint graphs.
| Name | UGameplayEffect |
| Type | class |
| Header File | /Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/GameplayEffect.h |
| Include Path | #include "GameplayEffect.h" |
Syntax
UCLASS (Blueprintable, prioritizeCategories="Status Duration GameplayEffect GameplayCues Stacking",
Meta=(ShortTooltip="A GameplayEffect modifies attributes and tags."), MinimalAPI)
class UGameplayEffect :
public UObject ,
public IGameplayTagAssetInterface
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UGameplayEffect
Implements Interfaces
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UGameplayEffect
(
const FObjectInitializer& ObjectInitializer |
GameplayEffect.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| INFINITE_DURATION | const float | These are deprecated but remain for backwards compat, please use FGameplayEffectConstants:: instead. | GameplayEffect.h |
| INSTANT_APPLICATION | const float | GameplayEffect.h | |
| INVALID_LEVEL | const float | GameplayEffect.h | |
| NO_PERIOD | const float | GameplayEffect.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ApplicationTagRequirements | FGameplayTagRequirements | Tag requirements for this GameplayEffect to be applied to a target. | GameplayEffect.h |
|
| bClearStackOnOverflow | bool | If true, the entire stack of the effect will be cleared once it overflows | GameplayEffect.h |
|
| bDenyOverflowApplication | bool | If true, stacking attempts made while at the stack count will fail, resulting in the duration and context not being refreshed | GameplayEffect.h |
|
| bExecutePeriodicEffectOnApplication | bool | If true, the effect executes on application and then at every period interval. | GameplayEffect.h |
|
| bFactorInStackCount | bool | If true, the calculation will include the stack count for Modifier Magnitudes | GameplayEffect.h |
|
| bRequireModifierSuccessToTriggerCues | bool | If true, cues will only trigger when GE modifiers succeed being applied (whether through modifiers or executions) | GameplayEffect.h |
|
| bSuppressStackingCues | bool | If true, GameplayCues will only be triggered for the first instance in a stacking GameplayEffect. | GameplayEffect.h |
|
| CachedAssetTags | FGameplayTagContainer | Cached Component Data - Do not modify these at runtime! If you want to manipulate these, write your own GameplayEffectComponent set the data during PostLoad. | GameplayEffect.h | |
| CachedBlockedAbilityTags | FGameplayTagContainer | Cached copy of all the tags this GE applies to its target to block Gameplay Abilities. | GameplayEffect.h | |
| CachedGrantedTags | FGameplayTagContainer | Cached copy of all the tags this GE grants to its target. Data populated during PostLoad. | GameplayEffect.h | |
| ConditionalGameplayEffects | TArray< FConditionalGameplayEffect > | Other gameplay effects that will be applied to the target of this effect if this effect applies | GameplayEffect.h |
|
| DurationMagnitude | FGameplayEffectModifierMagnitude | Duration in seconds. | GameplayEffect.h |
|
| DurationPolicy | EGameplayEffectDurationType | Properties |
Policy for the duration of this effect | GameplayEffect.h |
- EditDefaultsOnly
- Category=Duration
| Executions | TArray< FGameplayEffectExecutionDefinition > | Array of executions that will affect the target of this effect | GameplayEffect.h |
|
| GameplayCues | TArray< FGameplayEffectCue > | Cues to trigger non-simulated reactions in response to this GameplayEffect such as sounds, particle effects, etc | GameplayEffect.h |
|
| GrantedAbilities | TArray< FGameplayAbilitySpecDef > | Granted abilities |
Policy for what abilities this GE will grant. | GameplayEffect.h |
- BlueprintReadOnly
- Category="Granted Abilities"
| GrantedApplicationImmunityQuery | FGameplayEffectQuery | Grants immunity to GameplayEffects that match this query. | GameplayEffect.h |
|
| GrantedApplicationImmunityTags | FGameplayTagRequirements | Grants the owner immunity from these source tags. | GameplayEffect.h |
|
| HasGrantedApplicationImmunityQuery | bool | Cached !GrantedApplicationImmunityQuery.IsEmpty(). Set on PostLoad. | GameplayEffect.h | |
| HasRemoveGameplayEffectsQuery | bool | Cached !RemoveGameplayEffectsQuery.IsEmpty(). Set on PostLoad. | GameplayEffect.h | |
| InheritableBlockedAbilityTagsContainer | FInheritedTagContainer | These blocked ability tags are applied to the actor I am applied to | GameplayEffect.h |
|
| InheritableGameplayEffectTags | FInheritedTagContainer | Tag Containers |
The GameplayEffect's Tags: tags the the GE has and DOES NOT give to the actor. | GameplayEffect.h |
- BlueprintReadOnly
- Category=Deprecated
- Meta=(DisplayName="GameplayEffectAssetTag", Categories="GameplayEffectTagsCategory", DeprecatedProperty)
| InheritableOwnedTagsContainer | FInheritedTagContainer | These tags are applied to the actor I am applied to | GameplayEffect.h |
|
| MaxDurationMagnitude | FGameplayEffectModifierMagnitude | MaxDuration in seconds. | GameplayEffect.h |
|
| Modifiers | TArray< FGameplayModifierInfo > | Array of modifiers that will affect the target of this effect | GameplayEffect.h |
|
| OngoingTagRequirements | FGameplayTagRequirements | Once Applied, these tags requirements are used to determined if the GameplayEffect is "on" or "off". | GameplayEffect.h |
|
| OverflowEffects | TArray< TSubclassOf< UGameplayEffect > > | Effects to apply when a stacking effect "overflows" its stack count through another attempted application. | GameplayEffect.h |
|
| Period | FScalableFloat | Period in seconds. 0.0 for non-periodic effects | GameplayEffect.h |
|
| PeriodicInhibitionPolicy | EGameplayEffectPeriodInhibitionRemovedPolicy | How we should respond when a periodic gameplay effect is no longer inhibited | GameplayEffect.h |
|
| PrematureExpirationEffectClasses | TArray< TSubclassOf< UGameplayEffect > > | Effects to apply when this effect is made to expire prematurely (like via a forced removal, clear tags, etc.); Only works for effects with a duration | GameplayEffect.h |
|
| RemovalTagRequirements | FGameplayTagRequirements | Tag requirements that if met will remove this effect. Also prevents effect application. | GameplayEffect.h |
|
| RemoveGameplayEffectQuery | FGameplayEffectQuery | On Application of an effect, any active effects with this this query that matches against the added effect will be removed. | GameplayEffect.h |
|
| RemoveGameplayEffectsWithTags | FInheritedTagContainer | GameplayEffects that have tags in this container will be cleared upon effect application. | GameplayEffect.h |
|
| RoutineExpirationEffectClasses | TArray< TSubclassOf< UGameplayEffect > > | Effects to apply when this effect expires naturally via its duration; Only works for effects with a duration | GameplayEffect.h |
|
| StackDurationRefreshPolicy | EGameplayEffectStackingDurationPolicy | Policy for how the effect duration should be refreshed while stacking | GameplayEffect.h |
|
| StackExpirationPolicy | EGameplayEffectStackingExpirationPolicy | Policy for how to handle duration expiring on this gameplay effect | GameplayEffect.h |
|
| StackingType | EGameplayEffectStackingType | TODO: 5.11 Add EditCondition DurationPolicy to Stacking rules. | GameplayEffect.h |
|
| StackLimitCount | int32 | Stack limit for StackingType. A value of -1 or 0 means no limit. | GameplayEffect.h |
|
| StackPeriodResetPolicy | EGameplayEffectStackingPeriodPolicy | Policy for how the effect period should be reset (or not) while stacking | GameplayEffect.h |
|
| UIData | TObjectPtr< class UGameplayEffectUIData > | Data for the UI representation of this effect. | GameplayEffect.h |
|
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| DataVersion | FGameplayEffectVersion | The saved version of this package (the value is not inherited from its parents). | GameplayEffect.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
GEComponentClass & AddComponent () |
Add a GameplayEffectComponent to the GameplayEffect. | GameplayEffect.h | |
bool CanApply
(
const FActiveGameplayEffectsContainer& ActiveGEContainer, |
Can we Apply this Gameplay Effect? Note: Apply is the generic term for adding to the active container or executing it. | GameplayEffect.h | |
const UGameplayEffectComponent * FindComponent
(
TSubclassOf< UGameplayEffectComponent > ClassToFind |
GameplayEffect.h | ||
const GEComponentClass * FindComponent () |
Find and return the component of class GEComponentClass on this GE, if one exists. | GameplayEffect.h | |
GEComponentClass & FindOrAddComponent() |
Find an existing GameplayEffectComponent of the requested class, or add one if none are found. | GameplayEffect.h | |
const FGameplayTagContainer & GetAssetTags() |
Returns all tags that this GE has and does not grant to any Actor. | GameplayEffect.h | |
const FGameplayTagContainer & GetBlockedAbilityTags () |
Returns all blocking ability tags granted by this gameplay effect definition. | GameplayEffect.h | |
virtual void GetBlockedAbilityTags
(
FGameplayTagContainer& OutTagContainer |
GameplayEffect.h | ||
const FGameplayTagContainer & GetGrantedTags () |
Returns all tags granted to the Target Actor of this gameplay effect. | GameplayEffect.h | |
virtual void GetOwnedGameplayTags
(
FGameplayTagContainer& TagContainer |
GameplayEffect.h | ||
EGameplayEffectStackingExpirationPolicy GetStackExpirationPolicy() |
Returns the stack expiration policy for this gameplay effect | GameplayEffect.h | |
EGameplayEffectStackingType GetStackingType() |
Return the stacking type defined from the data asset | GameplayEffect.h | |
int32 GetStackLimitCount() |
Returns the maximum stack size for this gameplay effect | GameplayEffect.h | |
virtual bool HasAllMatchingGameplayTags
(
const FGameplayTagContainer& TagContainer |
GameplayEffect.h | ||
virtual bool HasAnyMatchingGameplayTags
(
const FGameplayTagContainer& TagContainer |
GameplayEffect.h | ||
virtual bool HasMatchingGameplayTag
(
FGameplayTag TagToCheck |
GameplayEffect.h | ||
bool OnAddedToActiveContainer
(
FActiveGameplayEffectsContainer& ActiveGEContainer, |
Receive a notify that this GameplayEffect has been added to an Active Container. | GameplayEffect.h | |
void OnApplied
(
FActiveGameplayEffectsContainer& ActiveGEContainer, |
Receive a notify that this GameplayEffect has been applied (this GE is either previously added to the container or executed in such cases). | GameplayEffect.h | |
void OnExecuted
(
FActiveGameplayEffectsContainer& ActiveGEContainer, |
Receive a notify that this GameplayEffect has been executed (it must be instant, as it is not added to the Container). | GameplayEffect.h | |
virtual void OnGameplayEffectChanged () |
Called when the Gameplay Effect has finished loading. | GameplayEffect.h | |
void PostCDOCompiledFixupSubobjects () |
We need to fix-up all of the SubObjects manually since the Engine doesn't fully support this | GameplayEffect.h | |
void SetStackingType
(
EGameplayEffectStackingType InType |
Set stacking type | GameplayEffect.h | |
void ValidateGameplayEffect() |
Check for any errors | GameplayEffect.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual EDataValidationResult IsDataValid
(
FDataValidationContext& Context |
Allow each Gameplay Effect Component to validate its own data. | GameplayEffect.h | |
virtual void PostCDOCompiled
(
const FPostCDOCompiledContext& Context |
Do our upgrades in PostCDOCompiled | GameplayEffect.h | |
virtual void PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
GameplayEffect.h | ||
virtual void PostInitProperties() |
Needed to properly disable inheriting the version value from its parent. | GameplayEffect.h | |
virtual void PostLoad () |
PostLoad gets called once after the asset has been loaded. | GameplayEffect.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Upgrade Path | GameplayEffect.h | ||
void SetVersion
(
EGameplayEffectVersion Version |
Sets the Version of the class to denote it's been upgraded | GameplayEffect.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PreSave
(
FObjectPreSaveContext SaveContext |
We should intercept the Save call and revalidate all of our deprecated values to avoid hanging onto stale data | GameplayEffect.h |
Deprecated Variables
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ApplicationRequirements_DEPRECATED | TArray< TSubclassOf< UGameplayEffectCustomApplicationRequirement > > | GameplayEffect.h |
|
|
| ChanceToApplyToTarget_DEPRECATED | FScalableFloat | Probability that this gameplay effect will be applied to the target actor (0.0 for never, 1.0 for always) | GameplayEffect.h |
|