How-To: Grant an Ability Set
Goal: grant a batch of abilities, passive effects and attribute sets in one call, and take them all back later.
Prerequisites
Quick Start through step 3.
Ability sets belong to CrimsonCommon
UCrimsonAbilitySet is defined in CrimsonCommon, not in this plugin. It is documented here because it is the standard way to populate a Crimson ASC, but its home is CrimsonCommon.1. Create the set
Content Browser -> right-click -> Miscellaneous -> Data Asset -> `CrimsonAbilitySet`. It has three arrays.
| Array | Entry fields | Notes |
|---|---|---|
| Granted Gameplay Abilities | Ability, AbilityLevel, InputTag | The InputTag picker is filtered to the InputTag tag hierarchy. |
| Granted Gameplay Effects | GameplayEffect, EffectLevel | Applied as passives at grant time. |
| Granted Attributes | AttributeSet | Instantiated and registered on the ASC. |
Verify
The asset saves and shows your ability under Granted Gameplay Abilities.
2. Grant it on the server
Granting is authoritative state. Do it on the server only; the results replicate.
Event BeginPlay -> Switch Has Authority (Authority) -> Give To Ability System, with the ASC from Get Crimson Ability System Component. Promote the returned handles struct to a variable so you can revoke later.
Verify
Play As Client. The client can activate the granted ability, which proves the grant replicated rather than only existing on the server.
3. Revoke
Call Take From Ability System on the set, passing the ASC. Store the handles variable from step 2 if you need to revoke a specific grant.
Verify
After revoking, the ability no longer activates and its passive effects are gone.
See also
- Quick Start
- Concept: Ability System Component