EVENT GETAUTOAIMANGLE

From EDukeWiki
Revision as of 11:35, 5 February 2022 by Doom64hunter (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Event ID player# THISACTOR RETURN
EVENT_GETAUTOAIMANGLE player firing the weapon player->i 0 values

EVENT_GETAUTOAIMANGLE is a Game Event.

This event is called when the auto aim range is determined for the current weapon. This is the horizontal angle at which shots will automatically lock onto enemies.

The default value for AUTOAIMANGLE is 48. Set AUTOAIMANGLE to zero to disable auto-aim for the weapon, or to a higher value to increase the range at which shots will lock onto enemies from the crosshair center.

Example:

onevent EVENT_GETAUTOAIMANGLE
    getplayer[THISACTOR].curr_weapon TEMP
    ifvare TEMP PISTOL_WEAPON      // the pistol
        setvar AUTOAIMANGLE 64     // a 'wider' auto-aim angle.
endevent