QuakeServer.Builtins.Aim (quake_server v0.1.0)

Copy Markdown View Source

The aim builtin as FTE runs it (PF_aim): the direction a shot from entity should take, from its origin raised by its view_ofs height, given v_forward.

The allowed deviation is the cosine sv_aim; at 1 or more aiming is off and v_forward comes back unchanged. Otherwise a target (takedamage 2, not on the shooter's team while teamplay is set and the team is above 0) straight ahead within 2048 units keeps v_forward; else the target whose centre lies closest to straight ahead, at least sv_aim by cosine and in clear sight, bends the shot: the forward direction scaled to the target's distance along it, with the target's height difference as its height, normalized. With no such target v_forward comes back.

Summary

Functions

The aim direction for shots from entity.

Functions

aim(server, entity)

The aim direction for shots from entity.