(1) Those tags are part of UAbilitySystemGlobals
. It has tags for:
- actor is being dead
ActivateFailIsDeadTag
- on cooldown
ActivateFailCooldownTag
- insufficient costs
ActivateFailCostTag
- blocked by other abilities
ActivateFailTagsBlockedTag
- missing required tags
ActivateFailTagsMissingTag
- invalid networking settings
ActivateFailNetworkingTag
(2) They can be set by (example for cost)
Set the tags in DefaultGame.ini
, using the corresponding FName
(example for costs):
[/Script/GameplayAbilities.AbilitySystemGlobals]
ActivateFailCostName=My.Test.Tag
Make sure, the GameplayTag exists, e.g. in DefaultGameplayTags.ini
+GameplayTagList=(Tag="My.Test.Tag",DevComment="")
Initialize those tags by calling UAbilitySystemGlobals::Get().InitGlobalData()
, e.g. in the constructor of your UGameInstance
subclass.
How does that work
Example for costs:
in UGameplayAbility::CanActivateAbility()
-> UGameplayAbility::CheckCost()
:
UAbilitySystemGlobals::ActivateFailCostTag
is applied to optional out param OptionalRelevantTags
if costs can’t be afforded
- this tag is used in
UAbilitySystemComponent::NotifyAbilityFailed()
which
- fires the delegate
UAbilitySystemComponent::AbilityFailedCallbacks
This is similar for the other cases mentioned above (cooldown, block, …).