A_JumpIfTracerInSight

From DoomWiki.org

A_JumpIfTracerInSight(state, fov) is a missile function that is part of the MBF21 specification. It jumps the calling actor to a specified state if its tracer (current target), is in its line of sight. It has two parameters, using the values in the Args fields as arguments. The function mirrors the behavior of A_JumpIfTargetInSight, 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 field of view to scan relative to the direction the calling actor is facing. The angle of the field of view has to be passed to the function in fixed point, meaning the intended value has to be multiplied by 65536 (FRACUNIT). If the field of view is set to ≤ 0, the function will check for the tracer in all directions.

Example[edit]

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

Frame 1234
Args1 = 420
Args2 = 65536

[CODEPTR]
FRAME 1234 = JumpIfTracerInSight

Or using DECOHack syntax:

state 1234
{
 TNT1 A 1 A_JumpIfTracerInSight(420, 1.0)
}

In the above example A_JumpIfTracerInSight will jump the calling actor to state 420 if its tracer is found within a field of view of exactly 1° from the direction the calling actor is facing, meaning it has to be directly ahead of it or a jump will not occur.

External links[edit]