How-To: Write a Stateful Augment
Goal: accumulate across events - "every third hit crits", "gain a stack per kill, spend them all on the next cast".
Prerequisites
How-To: Create and Equip an Augment.
1. Pick a base or a shipped listener
| Listener | Does |
|---|---|
_HitCounter | Counts hits and fires on the Nth. |
_StackConsumer | Accumulates stacks and spends them, with property scaling. |
_EventTrigger | Re-broadcasts one event as another. |
_ApplyGameplayEffect | Applies an effect on its event, holding state between applications. |
_ModifyTags | Adds and removes tags on the ability spec. |
_ReplaceAbility | Swaps the ability for another while active. |
2. Subclass for custom behavior
Right-click -> Blueprint Class -> `CrimsonStatefulAugmentBase`, then override Initialize (set up state), Handle Ability Event (react), and On Removed (clean up).
Useful helpers on the base: Get Owner ASC, Get Owning Ability, Get Augment Data, Fire New Augment Event, Grant Tag To Ability Spec, Remove Tag From Ability Spec.
Stateful augments live on the server
They hold authoritative accumulation. Do not read their counters directly for UI - broadcast a message or drive a replicated tag instead.
Verify
Land three hits and confirm the third produces the escalated behavior, on both a listen server and a client.
See also
- Concept: Augment System
- How-To: Gate Combo Branches with Conditions