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
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
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
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
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
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
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.
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.
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
Parameters
Name | Type | Description |
---|---|---|
Ability | UGameplayAbility* |
OnAbilityEnded #
Called when an ability is ended for the owner actor.
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.
Parameters
Name | Type | Description |
---|---|---|
Ability | UGameplayAbility* | |
ReasonTags | FGameplayTagContainer |
OnGameplayEffectStackChange #
Called when a GameplayEffect is added or removed.
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)
Parameters
Name | Type | Description |
---|---|---|
AssetTags | FGameplayTagContainer | |
GrantedTags | FGameplayTagContainer | |
ActiveHandle | FActiveGameplayEffectHandle | |
NewStartTime | float | |
NewDuration | float |
OnGameplayEffectAdded #
Called when a GameplayEffect is added.
Parameters
Name | Type | Description |
---|---|---|
AssetTags | FGameplayTagContainer | |
GrantedTags | FGameplayTagContainer | |
ActiveHandle | FActiveGameplayEffectHandle |
OnGameplayEffectRemoved #
Called when a GameplayEffect is 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)
Parameters
Name | Type | Description |
---|---|---|
GameplayTag | FGameplayTag | |
NewTagCount | int32 |
OnAbilityCommit #
Called whenever an ability is committed (cost / cooldown are applied)
Parameters
Name | Type | Description |
---|---|---|
Ability | UGameplayAbility* |
OnCooldownStart #
Called when an ability with a valid cooldown is committed and cooldown is applied
Parameters
Name | Type | Description |
---|---|---|
Ability | UGameplayAbility* | |
CooldownTags | FGameplayTagContainer | |
TimeRemaining | float | |
Duration | float |
OnCooldownEnd #
Called when a cooldown gameplay tag is removed, meaning cooldown expired
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.
Parameters
Name | Type | Description |
---|---|---|
Attribute | FGameplayAttribute | |
NewValue | float |
IsUsingAbilityByTags #
Returns whether one of the character's active abilities are matching the provided 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
Parameters
Name | Type | Description |
---|---|---|
AbilityClass | TSubclassOf |
Returns bool
IsAlive #
Returns whether or not the Actor is considered alive (Health > 0)
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)
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)
Parameters
Name | Type | Description |
---|---|---|
TagContainer | FGameplayTagContainer |
Returns bool
GrantAbility #
Grants the Actor with the given ability, making it available for activation
Parameters
Name | Type | Description |
---|---|---|
Ability | TSubclassOf |
The Gameplay Ability to give to the character |
Level | int32 | The Gameplay Ability Level (defaults to 1) |
GetStamina #
Returns float
GetMaxStamina #
Returns float
GetMaxMana #
Returns float
GetMaxHealth #
Returns float
GetMana #
Returns float
GetHealth #
Returns float
GetCurrentAttributeValue #
Returns current (final) value of an attribute
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
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
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
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
ClearAbility #
Remove an ability from the Actor's Ability System Component
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
Parameters
Name | Type | Description |
---|---|---|
Abilities | Array of UGameplayAbility | Array of Ability Class to remove |
ClampAttributeValue #
Clamps the Attribute from MinValue to MaxValue
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)
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.
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.
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