Concept: Gameplay Effect Context

FCrimsonGameplayEffectContext extends the engine context with the data Crimson systems read - the ability source interface, augment provenance, and crit/hit metadata.

It only exists if the globals class is registered
GAS creates the context through UAbilitySystemGlobals::AllocGameplayEffectContext. If Config/DefaultGame.ini does not set AbilitySystemGlobalsClassName=/Script/CrimsonAbilitySystem.CrimsonAbilitySystemGlobals, you get the engine context, every cast to the Crimson one fails, and the failures are silent. Quick Start step 1 sets this.

Reading it

Get the context from an effect spec and cast. UCrimsonAbilitySystemStatics also exposes GetSetByCallerMagnitudeFromHandle and GetAbilitySystemComponentFromTargetData for the common lookups.

Ability source

ICrimsonAbilitySourceInterface lets the thing that caused an effect (a weapon, a trap, an environment volume) describe itself to damage calculations without the calculation knowing its concrete type.

See also

  • Quick Start
  • Concept: Ability System Component