UCrimsonGameplayAbility
The base class for all Crimson abilities. Adds activation policies, activation groups, contract-driven properties, dynamic tag mutations, augment-event broadcasting, and per-ability cooldown recovery scaling on top of UGameplayAbility.
Activation policy
| Policy | When to use |
|---|---|
OnInputTriggered | Activates once when the input tag is pressed |
WhileInputActive | Stays active while the input tag is held (re-activates if cancelled) |
OnSpawn | Activates automatically when the ASC initializes (passive abilities) |
Commit time
Controls when cost and cooldown apply relative to execution:
| Commit Time | Description |
|---|---|
OnActivation | Cost and cooldown applied immediately on activation (default) |
OnCastCompleted | Applied only after the cast finishes - cancellation is free |
OnCastCompletedAndOnInterrupted | Applied on completion, and also if interrupted mid-cast |
Set ActivationGroup to participate in the ASC's exclusive-ability logic (see Concept: Ability System Component). Group membership can change at runtime via ChangeActivationGroup.
Additional costs
Beyond the standard GE cost, abilities can have typed costs via the AdditionalCosts array (instanced UCrimsonAbilityCost). Checked in CheckCost, applied in ApplyCost. Built-in: UCrimsonAbilityCost_PlayerTagStack deducts from a tag stack on the ASC.
Contract-driven properties
Assign a UCrimsonAbilityContract to the ability's AbilityContract property. The ability reads typed values at runtime:
| Function | Returns |
|---|---|
GetConfigurableValue(Tag, Default) | float |
GetConfigurableInt(Tag, Default) | int32 |
GetConfigurableBool(Tag, Default) | bool |
GetConfigurableVector(Tag, Default) | FVector |
GetConfigurableClass<T>(Tag) | TSubclassOf<T> |
GetConfigurableObject<T>(Tag) | T* |
GetConfigurableStruct<T>(Tag) | const T* |
Values resolve from the ability's PropertyCache, populated in RecalculateProperties(). Augment StatMutations write into that cache at equip time, so the same GetConfigurableValue call transparently returns the augmented value - the ability has no knowledge of augments.
Augment event broadcasting
Call BroadcastAugmentEvent(EventTags, Payload) at key moments (on hit, on crit, on cast). The ASC routes the event to active stateful listeners and executes matching actions:
// After a hit is confirmedFCrimsonAugmentEventPayload Payload;Payload.TargetData = TargetDataHandle;Payload.EventMagnitude = DamageDealt;BroadcastAugmentEvent(FGameplayTagContainer(TAG_Augment_Event_OnHit), Payload);
SetBaseValuesForSpec_Implementation to inject base SetByCaller magnitudes (e.g. base damage) before augment mutations are applied by MakeAugmentedGameplayEffectSpec.