A_JumpIfTracerCloser

From DoomWiki.org

A_JumpIfTracerCloser(state, distance) is a missile function that is part of the MBF21 specification. It jumps the calling actor to a specified state if the distance to its tracer (current target), falls below a specific value. It has two parameters, using the values in the Args fields as arguments. The function mirrors the behavior of A_JumpIfTargetCloser, only used for homing projectiles rather than monsters.

The first argument determines the state that the actor will jump to, using the index number of the frame. The second argument sets the lowest distance to the target in map units which will not trigger a jump. Therefore, a jump only occurs if the distance falls below the value specified as the second argument. The distance has to be passed to the function in fixed point, meaning the intended value has to be multiplied by 65536 (FRACUNIT).

Example[edit]

The following is an example of how to set the A_JumpIfTracerCloser code pointer in a DeHackEd file using BEX syntax:

Frame 1234
Args1 = 420
Args2 = 4521984

[CODEPTR]
FRAME 1234 = JumpIfTracerCloser

Or using DECOHack syntax:

state 1234
{
 TNT1 A 1 A_JumpIfTracerCloser(420, 69.0)
}

In the above example A_JumpIfTracerCloser will jump the calling actor to state 420 if the distance to its tracer is 68.0 map units or less.

External links[edit]