How-To: Declare an Ability Contract
Goal: turn augment authoring from typing tag strings into picking from a dropdown, by declaring which properties an ability actually exposes.
Why bother
Without a contract, an augment that says "scale Ability.Property.Damage by 1.5" is free text: nothing checks the tag exists, nothing checks the ability reads it, and a typo fails silently at runtime. A UCrimsonAbilityContract declares the properties up front so the augment editor can offer them as a validated list.
1. Create the contract
Content Browser -> right-click -> Crimson -> Ability System -> Ability Contract. Add one entry per property the ability exposes, each with its property tag and value type.
2. Point the ability at it
Assign the contract on the ability. Its property tags then appear as dropdown options wherever an augment mutation targets that ability.
3. Read a contract value at runtime
The ability reads its own configurable values through the contract API, so an augment mutation and the ability's default agree on one lookup path.
Inside the ability add Get Configurable Value and set its Property Tag. The node finds that tag in the ability's contract, reads which type the property was authored as, and retypes its Default Value and Return Value pins to float, integer, boolean or vector - so there is one node for every property type and no way to read a property through the wrong one.
When the contract cannot answer - the Property Tag pin is wired from a variable, the Blueprint is not a Crimson Gameplay Ability, the ability has no contract set, or the tag is declared by an augment rather than published by the contract - the pins take the Value Type set on the node in the Details panel. The compiler says which of those applied.
GetConfigurableValue resolves the base value and then applies whatever mutations are equipped on THIS spec - so two characters running the same ability with different augments get different numbers.See also
- Concept: Ability Contract
- How-To: Create and Equip an Augment