A_JumpIfInTargetLOS

From ZDoom Wiki
Jump to: navigation, search

A_JumpIfInTargetLOS (int offset[, float fov[, int flags[, float dist_max[, float dist_close]]]])
A_JumpIfInTargetLOS (str "state"[, float fov[, int flags[, float dist_max[, float dist_close]]]])

For weapons and inventory, jumps if the player has a suitable line target under their crosshair. With weapons and inventory, FOV is meaningless and can be omitted.

For monsters and seeking projectiles, the flags parameter is used to determine the actor that the calling actor looks for. In the rest of the description, "target" will refer to either:

  1. The calling actor's master, if the actor is a monster and the JLOSF_CHECKMASTER flag is set;
  2. The calling actor's tracer, if the actor is a missile with the SEEKERMISSILE flag and JLOSF_PROJECTILE is set;
  3. The calling actor's target, in all other cases. This corresponds to a monster's enemy or a projectile's shooter. (It is counter-intuitive, but a projectile's target field does not store the projectile's actual target.)

Jumps if the calling actor has a valid target (as explained above) and can currently be seen by it. If FOV is given, it is an angle representing the size (in degrees) of the target's sight cone. Actors outside of this cone (the center of which is the calling actor's current facing direction) are not considered to be “visible”. If omitted, no sight cone is used and instead this function jumps if the view between the target and the caller is unobstructed (the target can see the caller, regardless of facing direction, given there are no walls between the two).

  • state is label of the state to which the jump must be made.
  • offset corresponds to the number of states that must be skipped to make the jump.
  • fov corresponds to the field of vision used by the calling actor. The default value of 0 gives an all-around field of vision.
  • flags: The following flags can be combined by using the | character between the constant names:
    • JLOSF_PROJECTILE — Seeking projectile: If set, the actor checks sight with the target it is seeking (tracer field) instead of the normal target field (which, for projectiles, actually corresponds to the actor that fired it). If the actor is not a projectile or does not have the SEEKERMISSILE flag set, this flag is ignored.
    • JLOSF_NOSIGHT — No sight check: Disables the sight check.
    • JLOSF_CLOSENOFOV — No FOV check if close: Disable the FOV check if the target is within dist_close distance.
    • JLOSF_CLOSENOSIGHT — No sight check if close: Disable the sight check if the target is within dist_close distance.
    • JLOSF_CLOSENOJUMP — No jump if close: Does not perform a jump if the target is within dist_close distance.
    • JLOSF_DEADNOJUMP — No jump if dead: Does not perform a jump if the target is dead.
    • JLOSF_CHECKMASTER — Check master: Use the master field instead of the target or tracer field.
  • dist_max: The maximum distance between the calling actor and the target, no jumps are performed beyond it. The default value of 0 means there are no distance checks.
  • dist_close: The function of this parameter depends on the flags used; it has otherwise no effect. The default value is 0.

Examples

Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contibutions are greatly appreciated.


See also

Personal tools
Namespaces

Variants
Actions
Navigation
ACS
DECORATE
ZDoom mods
Toolbox