How-To: Grant an Ability Set

Goal: bundle a group of abilities, effects, and attribute sets into one UCrimsonAbilitySet data asset and grant it to an ASC at runtime.

Prerequisites
You've completed the Quick Start (PS-owns-ASC pawn). You have at least one UCrimsonGameplayAbility subclass to grant.

1. Create the ability set asset

Screenshot pendingImages/CrimsonAbilitySystem/howto-create-abilityset.png
Content Browser -> Add -> Crimson -> Ability System -> Crimson Ability Set. Fill the Granted Abilities / Effects / Attribute Sets lists.

2. Grant it on the server and keep the handles

Hold onto the returned FCrimsonAbilitySet_GrantedHandles if you ever need to remove the set (e.g. on death or unequip).

cpp
// Server only
FCrimsonAbilitySet_GrantedHandles Handles;
AbilitySet->GiveToAbilitySystem(ASC, &Handles);
// Later, to remove everything the set granted:
Handles.TakeFromAbilitySystem(ASC);
Verify
Open the Ability Dev Tools (Tools -> Crimson Ability System) in PIE - the granted abilities appear on the ASC. Inputs mapped by their contracts now activate them.

See also

  • Concept: Ability System Component - the runtime hub
  • Concept: Gameplay Ability - the base ability class