1.6 KiB
1.6 KiB
Ability Status Implementation
An ability status is a gameplay tag assigned to the dynamic tags of an ability spec.
It can be one of the four values
| Tag | Meaning |
|---|---|
Ability.Status.Locked |
The ability cannot be learnt |
Ability.Status.Eligible |
The ability can be learnt |
Ability.Status.Unlocked |
Ability learnt from the book but not bind |
Ability.Status.Equipped |
Ability has an input tag bind |
Each character has a class information that contains an ability book
AAuraBaseCharacter *MyCharacter;
UAbilityInfo* Book = MyCharacter->GetClassInfo()->AbilitiesBook;
The Ability System Component has a list of ability specs.
UAuraAbilitySystemComponent *AuraASC;
TArray<FGameplayAbilitySpec> Abilities = AuraASC->GetActivatableAbilities();
We can fetch an ability status with ether an ability spec or an ability id tag
FGameplayAbilitySpec AbilitySpec;
FGameplayTag StatusTag = UAuraAbilitySystemComponent::GetStatusTagFromAbilitySpec(AbilitySpec);
bool StatusFound = AuraASC->GetStatusTagForAbilityIDTag(AbilityIDTag, FGameplayTag, StatusTag);
| Status | In Active Abilities | Level > 0 | InputTag |
|---|---|---|---|
| Locked | ❌ | ❌ | ❌ |
| Eligible | ✔️ | ❌ | ❌ |
| Unlocked | ✔️ | ✔️ | ❌ |
| Equipped | ✔️ | ✔️ | ✔️ |
To keep the status tag up to date, it is updated in the asc when
- We recieve an ability with a matching tag of
Ability.ID. in theOnGiveAbility - We assign an input tag to the ability spec. in the
AssignInputTagToAbilitySpecandRemoveInputTagFromAbilitySpec - We modify an ability spec level with the function
SetLevelForAbilitySpecorAddLevelForAbilitySpec