GSCCoreComponent #

This Actor Component provides abstraction towards Ability System Component.

For PlayerStates characters, the Ability System Component is not directly accessible as the owner actor in this case is actually the Player State.

Provides commonly shared functionality and API / Events for all Actors that have an Ability System Component (abstracting away Owner / Avatar actor setup for ASC)

Events #

OnDamage #

Called when character takes damage, which may have killed them

On Damage

Parameters

Name Type Description
DamageAmount float Amount of damage that was done, not clamped based on current health
SourceCharacter AActor* The actual actor that did the damage
DamageTags FGameplayTagContainer The gameplay tags of the event that did the damage

OnHealthChange #

Called when health is changed, either from healing or from being damaged
For damage this is called in addition to OnDamaged/OnDeath

On Health Change

Parameters

Name Type Description
DeltaValue float Change in health value, positive for heal, negative for cost. If 0 the delta is unknown
EventTags FGameplayTagContainer The gameplay tags of the event that changed mana

OnStaminaChange #

Called when stamina is changed, either from regen or from being used as a cost

On Stamina Change

Parameters

Name Type Description
DeltaValue float Change in stamina value, positive for heal, negative for cost. If 0 the delta is unknown
EventTags FGameplayTagContainer The gameplay tags of the event that changed mana

OnManaChange #

Called when mana is changed, either from healing or from being used as a cost

On Mana Change

Parameters

Name Type Description
DeltaValue float Change in mana value, positive for heal, negative for cost. If 0 the delta is unknown
EventTags FGameplayTagContainer The gameplay tags of the event that changed mana

OnAttributeChange #

Called when any of the attributes owned by this character are changed

On Attribute Change

Parameters

Name Type Description
Attribute FGameplayAttribute The Attribute that was changed
DeltaValue float It it was an additive operation, returns the modifier value. Or if it was a change coming from damage meta attribute (for health), returns the damage done.
EventTags FGameplayTagContainer The gameplay tags of the event that changed this attribute

OnDeath #

Called when character dies

On Death

OnPostGameplayEffectExecute #

PostGameplayEffectExecute event fired off from native AttributeSets, define here
any attribute change specific management you are not doing in c++ (like clamp)

Only triggers after changes to the BaseValue of an Attribute from a GameplayEffect.

On Post Gameplay Effect Execute

Parameters

Name Type Description
Attribute FGameplayAttribute The affected GameplayAttribute
SourceActor AActor* The instigator Actor that started the whole chain (in case of damage, that would be the damage causer)
TargetActor AActor* The owner Actor to which the Attribute change is applied
SourceTags FGameplayTagContainer The aggregated SourceTags for this EffectSpec
Payload FGSCGameplayEffectExecuteData Payload information with the original AttributeSet, the owning AbilitySystemComponent, calculated DeltaValue and the ClampMinimumValue from config if defined

OnPreAttributeChange #

PreAttributeChange event fired off from native AttributeSets, react here to
changes of Attributes CurrentValue before the modification to the BaseValue
happens.

Called just before any modification happens to an attribute, whether using
Attribute setters or using GameplayEffect.

On Pre Attribute Change

Parameters

Name Type Description
AttributeSet UGSCAttributeSetBase* The AttributeSet that started the change
Attribute FGameplayAttribute Set The AttributeSet that started the change The affected GameplayAttribute
NewValue float The new value

OnAbilityActivated #

Called when an ability is activated for the owner actor

On Ability Activated

Parameters

Name Type Description
Ability UGameplayAbility*

OnAbilityEnded #

Called when an ability is ended for the owner actor.

On Ability Ended

Parameters

Name Type Description
Ability UGameplayAbility*

OnAbilityFailed #

Called when an ability failed to activated for the owner actor, passes along the failed ability
and a tag explaining why.

On Ability Failed

Parameters

Name Type Description
Ability UGameplayAbility*
ReasonTags FGameplayTagContainer

OnGameplayEffectStackChange #

Called when a GameplayEffect is added or removed.

On Gameplay Effect Stack Change

Parameters

Name Type Description
AssetTags FGameplayTagContainer
GrantedTags FGameplayTagContainer
ActiveHandle FActiveGameplayEffectHandle
NewStackCount int32
OldStackCount int32

OnGameplayEffectTimeChange #

Called when a GameplayEffect duration is changed (for instance when duration is refreshed)

On Gameplay Effect Time Change

Parameters

Name Type Description
AssetTags FGameplayTagContainer
GrantedTags FGameplayTagContainer
ActiveHandle FActiveGameplayEffectHandle
NewStartTime float
NewDuration float

OnGameplayEffectAdded #

Called when a GameplayEffect is added.

On Gameplay Effect Added

Parameters

Name Type Description
AssetTags FGameplayTagContainer
GrantedTags FGameplayTagContainer
ActiveHandle FActiveGameplayEffectHandle

OnGameplayEffectRemoved #

Called when a GameplayEffect is removed.

On Gameplay Effect Removed

Parameters

Name Type Description
AssetTags FGameplayTagContainer
GrantedTags FGameplayTagContainer
ActiveHandle FActiveGameplayEffectHandle

OnGameplayTagChange #

Called whenever a tag is added or removed (but not if just count is increased. Only for 'new' and 'removed' events)

On Gameplay Tag Change

Parameters

Name Type Description
GameplayTag FGameplayTag
NewTagCount int32

OnAbilityCommit #

Called whenever an ability is committed (cost / cooldown are applied)

On Ability Commit

Parameters

Name Type Description
Ability UGameplayAbility*

OnCooldownStart #

Called when an ability with a valid cooldown is committed and cooldown is applied

On Cooldown Start

Parameters

Name Type Description
Ability UGameplayAbility*
CooldownTags FGameplayTagContainer
TimeRemaining float
Duration float

OnCooldownEnd #

Called when a cooldown gameplay tag is removed, meaning cooldown expired

On Cooldown End

Parameters

Name Type Description
Ability UGameplayAbility*
CooldownTag FGameplayTag
Duration float

Functions #

SetAttributeValue #

Sets the base value of an attribute. Existing active modifiers are NOT cleared and will act upon the new base value.

Set Attribute Value

Parameters

Name Type Description
Attribute FGameplayAttribute
NewValue float

IsUsingAbilityByTags #

Returns whether one of the character's active abilities are matching the provided tags

Is Using Ability by Tags

Parameters

Name Type Description
AbilityTags FGameplayTagContainer

Returns bool

IsUsingAbilityByClass #

Returns whether one of the actors's active abilities are matching the provided Ability Class

Is Using Ability by Class

Parameters

Name Type Description
AbilityClass TSubclassOf

Returns bool

IsAlive #

Returns whether or not the Actor is considered alive (Health > 0)

Is Alive

Returns bool

HasMatchingGameplayTag #

Returns true if Actor's AbilitySystemComponent has a gameplay tag that matches against the specified tag (expands to include parents of asset tags)

Has Matching Gameplay Tag

Parameters

Name Type Description
TagToCheck FGameplayTag

Returns bool

HasAnyMatchingGameplayTags #

Returns true if Actor's AbilitySystemComponent has any of the matching tags (expands to include parents of asset tags)

Has Any Matching Gameplay Tags

Parameters

Name Type Description
TagContainer FGameplayTagContainer

Returns bool

GrantAbility #

Grants the Actor with the given ability, making it available for activation

Grant Ability

Parameters

Name Type Description
Ability TSubclassOf The Gameplay Ability to give to the character
Level int32 The Gameplay Ability Level (defaults to 1)

GetStamina #

Get Stamina

Returns float

GetMaxStamina #

Get Max Stamina

Returns float

GetMaxMana #

Get Max Mana

Returns float

GetMaxHealth #

Get Max Health

Returns float

GetMana #

Get Mana

Returns float

GetHealth #

Get Health

Returns float

GetCurrentAttributeValue #

Returns current (final) value of an attribute

Get Current Attribute Value

Parameters

Name Type Description
Attribute FGameplayAttribute

Returns float

GetAttributeValue #

Returns the current value of an attribute (base value). That is, the value of the attribute with no stateful modifiers

Get Attribute Value

Parameters

Name Type Description
Attribute FGameplayAttribute

Returns float

GetActiveAbilitiesByTags #

Returns a list of currently active ability instances that match the given tags

This only returns if the ability is currently running

Get Active Abilities by Tags

Parameters

Name Type Description
GameplayTagContainer FGameplayTagContainer The Ability Tags to search for

Returns Array of UGameplayAbility

GetActiveAbilitiesByClass #

Returns a list of currently active ability instances that match the given class

Get Active Abilities by Class

Parameters

Name Type Description
AbilityToSearch TSubclassOf The Gameplay Ability Class to search for

Returns Array of UGameplayAbility

Die #

Triggers death events for the owner actor

Die

ClearAbility #

Remove an ability from the Actor's Ability System Component

Clear Ability

Parameters

Name Type Description
Ability TSubclassOf The Gameplay Ability Class to remove

ClearAbilities #

Remove an set of abilities from the Actor's Ability System Component

Clear Abilities

Parameters

Name Type Description
Abilities Array of UGameplayAbility Array of Ability Class to remove

ClampAttributeValue #

Clamps the Attribute from MinValue to MaxValue

Clamp Attribute Value

Parameters

Name Type Description
Attribute FGameplayAttribute
MinValue float
MaxValue float

AdjustAttributeForMaxChange #

Helper function to proportionally adjust the value of an attribute when it's associated max attribute changes.
(e.g. When MaxHealth increases, Health increases by an amount that maintains the same percentage as before)

Adjust Attribute for Max Change

Parameters

Name Type Description
AttributeSet UGSCAttributeSetBase* The AttributeSet owner for the affected attributes
AffectedAttributeProperty FGameplayAttribute The affected Attribute property
MaxAttribute FGameplayAttribute The related MaxAttribute
NewMaxValue float The new value for the MaxAttribute

ActivateAbilityByTags #

Attempts to activate a single gameplay ability that matches the given tag and DoesAbilitySatisfyTagRequirements().

It differs from GAS ASC TryActivateAbilitiesByTag which tries to activate every ability, whereas this version will pick a
random one and attempt to activate it.

Returns true if the ability attempts to activate, and the reference to the Activated Ability if any.

Activate Ability by Tags

Parameters

Name Type Description
AbilityTags FGameplayTagContainer Set of Gameplay Tags to search for
ActivatedAbility UGSCGameplayAbility* The Gameplay Ability that was triggered on success (only returned if it is a GSCGameplayAbility)
bAllowRemoteActivation bool If true, it will remotely activate local/server abilities, if false it will only try to locally activate abilities.

Returns bool

ActivateAbilityByClass #

Attempts to activate the ability that is passed in. This will check costs and requirements before doing so.

Returns true if it thinks it activated, but it may return false positives due to failure later in activation.

Activate Ability by Class

Parameters

Name Type Description
AbilityClass TSubclassOf Gameplay Ability Class to activate
ActivatedAbility UGSCGameplayAbility* The Gameplay Ability that was triggered on success (only returned if it is a GSCGameplayAbility)
bAllowRemoteActivation bool If true, it will remotely activate local/server abilities, if false it will only try to locally activate abilities.

Returns bool


Generated on Tue, 16 Jul 2024 16:16:37 GMT