EVENT GETAUTOAIMANGLE: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
New page: Called when the auto aim angle is desired for the weapon. Set AUTOAIMANGLE to zero to disable auto-aim for the weapon. Default value for AUTOAIMANGLE is 48. Example: onevent EVEN...
 
mNo edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Called when the auto aim angle is desired for the weapon.
{{EventTable|1=EVENT_GETAUTOAIMANGLE|2=player firing the weapon|3=[[i|player->i]]|4=0 values}}
EVENT_GETAUTOAIMANGLE is a [[EDuke32_event_list|Game Event]].


Set [[AUTOAIMANGLE]] to zero to disable auto-aim for the weapon.
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.
 
Default value for AUTOAIMANGLE is 48.


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:
Example:


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


[[Category:Events]]
[[Category:Events]]

Latest revision as of 11:35, 5 February 2022

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