GSCUserWidget #

Base user widget class to inherit from for UMG that needs to interact with an Ability System Component.

For typical use case of Player HUD, use UGSCUWHud subclass instead.

This class provides an event based API to react to Ability System related events:

  • Attribute value change
  • Gameplay Tag change
  • Gameplay Effect added / removed
  • Cooldown start / expiration

Properties #

OwnerActor #

Type AActor*

Owner Actor

OwnerCoreComponent #

Type UGSCCoreComponent*

Owner Core Component

Events #

OnGameplayTagChange #

Event triggered by Companion Core Component 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

OnGameplayEffectTimeChange #

Event triggered by Companion Core Component whenever a gameplay effect time 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

OnGameplayEffectStackChange #

Event triggered by Companion Core Component whenever a gameplay effect is added / removed

On Gameplay Effect Stack Change

Parameters

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

OnGameplayEffectRemoved #

Event triggered by Companion Core Component whenever a gameplay effect is removed

On Gameplay Effect Removed

Parameters

Name Type Description
AssetTags FGameplayTagContainer
GrantedTags FGameplayTagContainer
ActiveHandle FActiveGameplayEffectHandle
EffectData FGSCGameplayEffectUIData

OnGameplayEffectAdded #

Event triggered by Companion Core Component whenever a gameplay effect is added

On Gameplay Effect Added

Parameters

Name Type Description
AssetTags FGameplayTagContainer
GrantedTags FGameplayTagContainer
ActiveHandle FActiveGameplayEffectHandle
EffectData FGSCGameplayEffectUIData

OnCooldownStart #

Event triggered by Companion Core component 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 #

Event triggered by Companion Core Component when a cooldown gameplay tag is removed, meaning cooldown expired

On Cooldown End

Parameters

Name Type Description
Ability UGameplayAbility*
CooldownTag FGameplayTag
Duration float

OnAttributeChange #

Event triggered whenever an attribute value is changed on Owner Actor's ASC

On Attribute Change

Parameters

Name Type Description
Attribute FGameplayAttribute
NewValue float
OldValue float

OnAbilitySystemInitialized #

Event triggered when this widget has been initialized with a valid ASC.

Run initialization logic that depends on Ability System here. (like setting initial state for user widgets based on attributes value)

On Ability System Initialized

Functions #

SetOwnerActor #

Initialize or update references to owner actor and additional actor components (such as AbilitySystemComponent) and cache them for this instance of user widget.

Set Owner Actor

Parameters

Name Type Description
Actor AActor*

InitializeWithAbilitySystem #

Runs initialization logic for this UserWidget related to interactions with Ability System Component.

Setup AbilitySystemComponent delegates to react to various events.

Usually called from NativeConstruct, but exposed there if other classes needs to run initialization logic again to update references.

Initialize with Ability System

Parameters

Name Type Description
AbilitySystemComponent UAbilitySystemComponent*

GetPercentForAttributes #

Helper function to return percentage from Attribute / MaxAttribute

Get Percent for Attributes

Parameters

Name Type Description
Attribute FGameplayAttribute
MaxAttribute FGameplayAttribute

Returns float

GetOwningCoreComponent #

Returns reference to OwnerCoreComponent for this user widget, if it has been initialized.

Get Owning Core Component

Returns UGSCCoreComponent*

GetOwningActor #

Returns reference to OwnerActor for this user widget, if it has been initialized.

Get Owning Actor

Returns AActor*

GetOwningAbilitySystemComponent #

Returns reference to AbilitySystemComponent for this user widget, if it has been initialized.

Get Owning Ability System Component

Returns UAbilitySystemComponent*

GetAttributeValue #

Returns the current value of an attribute (base value) from owning actor Ability System (if it has any). That is, the value of the attribute with no stateful modifiers

Get Attribute Value

Parameters

Name Type Description
Attribute FGameplayAttribute

Returns float


Generated on Sat, 11 Mar 2023 16:20:29 GMT