A_CapeChase

From SRB2 Wiki
Jump to navigation Jump to search

A_CapeChase is an action that is commonly used to make an Object trail another Object, such as its original purpose of making a cape follow Sonic for his "Super" form in versions predating v1.09. It does not make the actor move; it only sets its location relative to that of its target or tracer. This is only done once per state, so for the actor to continuously follow its target/tracer, this action will need to be called every tic.

If Var1's lower 16 bits are 0, the actor's target will be used, if they are 1, the tracer will be used. By default, the actor will assume the position and angle of its target/tracer, but it is possible to set offsets in all three dimensions. Var1's upper 16 bits set the actor's vertical offset, relative to the bottom of the target/tracer. Var2's upper 16 bits set the forward/backward offset. Var2's lower 16 bits set the left/right offset, with positive values giving a left offset and negative values giving a right offset. All offsets are measured in fracunits. Thus, Var1 and Var2 can be calculated like this:

  • Var1 = (vertical offset × 65536) + 0 or 1
  • Var2 = (forward/backward offset × 65536) + left/right offset

This action also runs a check on the health of the target/tracer Object: If it no longer exists, or if its health is equal to or less than zero, the actor will be removed from the map. Note that landed projectiles do not set their health to zero.

Attributes Use
Var1 Lower 16 bits: 0 – use target; 1 – use tracer
Upper 16 bits: vertical offset
Var2 Lower 16 bits: Left/right offset
Upper 16 bits: Forward/backward offset

  Actions – Movement [view]
A_BubbleRiseA_BunnyHopA_CapeChaseA_ChaseA_FishJumpA_ForceStopA_HomingChaseA_InstaLoopA_KnockBackA_MouseThinkA_MoveAbsoluteA_MoveRelativeA_PushAwayA_ScoreRiseA_SkullAttackA_ThrustA_ZThrust