How-To: Block and Cancel by Tag
Goal: declare "casting blocks dodging" and "dodging cancels casting" as data instead of hardcoding tag containers on every ability.
Prerequisites
Quick Start.
1. Create the mapping
Right-click -> Miscellaneous -> Data Asset -> `CrimsonAbilityTagRelationshipMapping`. Each row maps an ability tag to the tags it blocks and the tags it cancels.
| Column | Meaning |
|---|---|
| Ability Tag | The tag on the ability this row describes. |
| Ability Tags to Block | Abilities with these tags cannot activate while this one is running. |
| Ability Tags to Cancel | Abilities with these tags are cancelled when this one activates. |
2. Assign it to the ASC
Assigning the mapping is C++ only
SetTagRelationshipMapping is not BlueprintCallable, and the underlying property is a bare UPROPERTY() - so it is neither editable in Class Defaults nor writable from Blueprint. A Blueprint-only project needs a small C++ base class (or an ASC subclass) that calls it once during init. The mapping ASSET itself is fully data-authored; only the one-line assignment needs code.Author the data asset in the editor as above, then have a C++ base class assign it - see the C++ tab. There is no Blueprint node for the assignment.
This is the right place for a global commitment policy
Whether an attack can cancel into a dodge is the single biggest feel decision in a combat game. Putting it in one data asset makes it a stated rule you can change in one place, rather than an emergent property of which abilities happened to get which tags.
Verify
Give two abilities opposing tags and confirm one blocks the other, with the failure reported as
Ability.ActivateFail.ActivationGroup or your own block tag.See also
- Concept: Gameplay Ability
- Concept: Modifiers and Dynamic Tags