Skip to content

Hook reference

Every hook delivered through the hook bus, generated from the SDK. Subscribe with Context.Hooks.Subscribe<T> in a system's OnInit (see the hooks guide for the subscription model). Game-typed payloads arrive as object, so cast them in the handler.

Strategy

AliveSquaddiesChanged

The count of alive squaddies changed (e.g. one was lost).

  • Context: AliveSquaddiesChangedContext
  • Source: event (Squaddies.OnAliveSquaddiesChanged)
FieldTypeDescription
AliveCountintThe number of squaddies still alive.

BlackMarketItemAdded

An item was added to the Black Market.

  • Context: BlackMarketItemAddedContext
  • Source: postfix (BlackMarket.AddItem)
FieldTypeDescription
ItemBaseItemThe item added.

BlackMarketRestocked

The Black Market restocked its inventory.

  • Context: BlackMarketRestockedContext
  • Source: postfix (BlackMarket.Restock)

ConversationVarChanged

A campaign conversation variable changed.

  • Context: ConversationVarChangedContext
  • Source: event (StrategyState.OnConversationVarChanged)
FieldTypeDescription
NamestringThe variable name.
OldValueintThe previous value.
NewValueintThe new value.

FactionStatusChanged

A story faction's status changed (allied / hostile / neutral, etc.).

  • Context: FactionStatusChangedContext
  • Source: event (StoryFaction.OnStatusChanged)
FieldTypeDescription
FactionStoryFactionThe faction.
OldStatusStoryFactionStatusThe previous status.
NewStatusStoryFactionStatusThe new status.

FactionTrustChanged

A story faction's trust value changed.

  • Context: FactionTrustChangedContext
  • Source: event (StoryFaction.OnTrustChanged)
FieldTypeDescription
FactionStoryFactionThe faction.
OldTrustintThe previous trust value.
NewTrustintThe new trust value.

FactionUpgradeUnlocked

A story faction unlocked a ship upgrade.

  • Context: FactionUpgradeUnlockedContext
  • Source: event (StoryFaction.OnUpgradeUnlocked)
FieldTypeDescription
FactionStoryFactionThe faction.
UpgradeShipUpgradeTemplateThe unlocked upgrade.

LeaderDismissed

A leader was dismissed from the roster.

  • Context: LeaderDismissedContext
  • Source: postfix (Roster.TryDismissLeader)
FieldTypeDescription
LeaderBaseUnitLeaderThe dismissed leader.

LeaderHired

A leader was hired into the roster.

  • Context: LeaderHiredContext
  • Source: postfix (Roster.HireLeader)
FieldTypeDescription
LeaderBaseUnitLeaderThe hired leader.

LeaderPerkAdded

A leader gained a perk (levelled up).

  • Context: LeaderPerkAddedContext
  • Source: postfix (BaseUnitLeader.AddPerk)
FieldTypeDescription
LeaderBaseUnitLeaderThe leader.
PerkPerkTemplateThe perk gained.

LeaderPermadeath

A leader permanently died.

  • Context: LeaderPermadeathContext
  • Source: postfix (Roster.OnPermanentDeath)
FieldTypeDescription
LeaderBaseUnitLeaderThe leader that died.

OperationFinished

A strategic operation concluded.

  • Context: OperationFinishedContext
  • Source: postfix (OperationsManager.OnOperationFinished)
FieldTypeDescription
OperationOperationThe operation that finished.

OperationStarted

A strategic operation began.

  • Context: OperationStartedContext
  • Source: postfix (Operation.StartOperation)
FieldTypeDescription
OperationOperationThe operation that started.
MissionMissionThe first mission of the operation.

Tactical

AITurn

An AI faction gained control for the turn.

  • Context: AITurnContext
  • Source: event (TacticalManager.OnAITurn)
FieldTypeDescription
FactionintThe faction identifier taking the turn.

ActiveActorChanged

The active actor changed (turn passed to a new actor).

  • Context: ActiveActorChangedContext
  • Source: event (TacticalManager.OnActiveActorChanged)
FieldTypeDescription
ActorActorThe new active actor.

ActorActed

An actor finished acting.

  • Context: ActorActedContext
  • Source: event (TacticalManager.OnActorActed)
FieldTypeDescription
ActorActorThe actor that acted.

ActorStateChanged

An actor's state changed (idle / moving / dead, etc.).

  • Context: ActorStateChangedContext
  • Source: event (TacticalManager.OnActorStateChanged)
FieldTypeDescription
ActorActorThe actor.
OldStateActorStateThe previous state.
NewStateActorStateThe new state.

ArmorChanged

An entity's armour changed.

  • Context: ArmorChangedContext
  • Source: event (TacticalManager.OnArmorChanged)
FieldTypeDescription
EntityEntityThe entity.
DurabilityfloatThe armour durability remaining.
ArmorintThe armour value.
AnimationMsintThe bar animation duration in milliseconds.

AttackMissed

An attack missed its target.

  • Context: AttackMissedContext
  • Source: event (TacticalManager.OnAttackMissed)
FieldTypeDescription
TargetEntityThe intended target.
AttackerEntityThe attacker.
SkillSkillThe skill used.

AttackTileStarted

A tile-targeted attack began.

  • Context: AttackTileStartedContext
  • Source: event (TacticalManager.OnAttackTileStart)
FieldTypeDescription
AttackerActorThe attacker.
SkillSkillThe skill used.
TileTileThe targeted tile.
DurationSecondsfloatThe attack's duration in seconds.

BleedingOut

A leader entered the bleeding-out state.

  • Context: BleedingOutContext
  • Source: event (TacticalManager.OnBleedingOut)
FieldTypeDescription
LeaderBaseUnitLeaderThe leader.
RemainingRoundsintRounds remaining before death.

DamageReceived

An entity received damage.

  • Context: DamageReceivedContext
  • Source: event (TacticalManager.OnDamageReceived)
FieldTypeDescription
VictimEntityThe entity that took the damage.
SourceEntityThe entity that dealt it, or null.
SkillSkillThe skill that dealt it, or null.
DamageDamageInfoThe damage detail.

Discovered

A hidden entity was discovered.

  • Context: DiscoveredContext
  • Source: event (TacticalManager.OnDiscovered)
FieldTypeDescription
EntityEntityThe discovered entity.
DiscovererActorThe actor that discovered it.

ElementDied

A sub-element of an entity was destroyed (e.g. a vehicle part).

  • Context: ElementDiedContext
  • Source: event (TacticalManager.OnElementDeath)
FieldTypeDescription
EntityEntityThe owning entity.
ElementElementThe destroyed element.
AttackerEntityThe attacker, or null.
DamageDamageInfoThe damage detail.

ElementMalfunction

A sub-element malfunctioned.

  • Context: ElementMalfunctionContext
  • Source: event (TacticalManager.OnElementMalfunction)
FieldTypeDescription
ElementElementThe element.
SkillSkillThe skill involved, or null.

EntityDied

An entity died.

  • Context: EntityDiedContext
  • Source: event (TacticalManager.OnDeath)
FieldTypeDescription
VictimEntityThe entity that died.
KillerEntityThe entity credited with the kill, or null.

EntitySpawned

An entity was spawned into the mission.

  • Context: EntitySpawnedContext
  • Source: event (TacticalManager.OnEntitySpawned)
FieldTypeDescription
EntityEntityThe spawned entity.

HiddenToPlayer

An actor became hidden from the player.

  • Context: HiddenToPlayerContext
  • Source: event (TacticalManager.OnHiddenToPlayer)
FieldTypeDescription
ActorActorThe actor.

HitpointsChanged

An entity's hitpoints changed.

  • Context: HitpointsChangedContext
  • Source: event (TacticalManager.OnHitpointsChanged)
FieldTypeDescription
EntityEntityThe entity.
PercentfloatThe new hitpoints as a fraction (0..1).
AnimationMsintThe bar animation duration in milliseconds.

MissionFinished

A tactical mission concluded.

  • Context: MissionFinishedContext
  • Source: event (TacticalManager.OnFinished)

MissionStarted

A tactical mission loaded and is ready.

  • Context: MissionStartedContext
  • Source: synthetic (raised by Jiangyu)

MoraleStateChanged

An actor's morale state changed.

  • Context: MoraleStateChangedContext
  • Source: event (TacticalManager.OnMoraleStateChanged)
FieldTypeDescription
ActorActorThe actor.
StateMoraleStateThe new morale state.

MovementFinished

An actor finished moving.

  • Context: MovementFinishedContext
  • Source: event (TacticalManager.OnMovementFinished)
FieldTypeDescription
ActorActorThe actor.
TileTileThe destination tile.

MovementStarted

An actor started moving.

  • Context: MovementStartedContext
  • Source: event (TacticalManager.OnMovement)
FieldTypeDescription
ActorActorThe moving actor.
FromTileTileThe tile moved from.
ToTileTileThe tile moved to.
MovementActionMovementActionThe movement action.
ContainerEntityThe carrying entity, or null.

ObjectiveStateChanged

A mission objective changed state (e.g. completed or failed).

  • Context: ObjectiveStateChangedContext
  • Source: event (TacticalManager.OnObjectiveStateChanged)
FieldTypeDescription
ObjectiveObjectiveThe objective.
OldStateObjectiveStateThe previous state.
NewStateObjectiveStateThe new state.

OffmapAbilityCanceled

An offmap ability was cancelled.

  • Context: OffmapAbilityCanceledContext
  • Source: event (TacticalManager.OnOffmapAbilityCanceled)
FieldTypeDescription
AbilityOffmapAbilityTemplateThe ability template.

OffmapAbilityUsed

An offmap ability was used.

  • Context: OffmapAbilityUsedContext
  • Source: event (TacticalManager.OnOffmapAbilityUsed)
FieldTypeDescription
AbilityOffmapAbilityTemplateThe ability template.
TileTileThe targeted tile.

PlayerTurn

The player gained control for the turn.

  • Context: PlayerTurnContext
  • Source: event (TacticalManager.OnPlayerTurn)

RoundStarted

A new tactical round began.

  • Context: RoundStartedContext
  • Source: event (TacticalManager.OnRoundStart)
FieldTypeDescription
RoundintThe round number that just started.

SkillAdded

A skill was granted to an actor.

  • Context: SkillAddedContext
  • Source: event (TacticalManager.OnSkillAdded)
FieldTypeDescription
ReceiverActorThe actor that received the skill.
SkillSkillThe skill granted.
SourceActorThe granting actor, or null.
SuccessboolWhether the grant succeeded.

SkillCompleted

A skill finished executing.

  • Context: SkillCompletedContext
  • Source: event (TacticalManager.OnAfterSkillUse)
FieldTypeDescription
SkillSkillThe skill.

SkillUsed

An actor used a skill.

  • Context: SkillUsedContext
  • Source: event (TacticalManager.OnSkillUse)
FieldTypeDescription
UserActorThe actor that used the skill.
SkillSkillThe skill used.
TileTileThe targeted tile.

Stabilized

A bleeding leader was stabilised.

  • Context: StabilizedContext
  • Source: event (TacticalManager.OnStabilized)
FieldTypeDescription
LeaderBaseUnitLeaderThe stabilised leader.
SaviorActorThe actor that stabilised them.

Suppressed

An actor became suppressed.

  • Context: SuppressedContext
  • Source: event (TacticalManager.OnSuppressed)
FieldTypeDescription
ActorActorThe suppressed actor.

SuppressionApplied

Suppression was applied to an actor with a specific amount.

  • Context: SuppressionAppliedContext
  • Source: event (TacticalManager.OnSuppressionApplied)
FieldTypeDescription
ActorActorThe actor.
ChangefloatThe suppression change applied.
SuppressorEntityThe source entity, or null.

TurnEnded

An actor's turn concluded.

  • Context: TurnEndedContext
  • Source: event (TacticalManager.OnTurnEnd)
FieldTypeDescription
ActorActorThe actor whose turn ended.

TurnStarted

An actor's turn began.

  • Context: TurnStartedContext
  • Source: event (TacticalManager.OnTurnStart)
FieldTypeDescription
ActorActorThe actor whose turn started.

VisibleToPlayer

An actor became visible to the player.

  • Context: VisibleToPlayerContext
  • Source: event (TacticalManager.OnVisibleToPlayer)
FieldTypeDescription
ActorActorThe actor.