EVENT FIRE: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
No edit summary
 
mNo edit summary
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
This event is called when the player fire ( default key is "CTRL" ). You can do various effects with this event and the gamevar "WEAPON".
{{EventTable|1=EVENT_FIRE|2=player that executed the input|3=[[i|player->i]]|4=1 value}}
EVENT_FIRE is a [[EDuke32 event list|game event]].
 
This [[event]] is called every game [[tic]] while the weapon is firing and the primary fire key is held.
 
Setting the gamevar [[RETURN]] to any non-zero value disables firing the weapon. The hard-coded [[gamevar]] [[WEAPON]] contains the variable for the player's current weapon.
 
The difference between this and [[EVENT_PRESSEDFIRE]] is that setting RETURN to -1 does not unset the bitflag that indicates that the player has pressed the fire key. Some hardcoded effects (e.g. resetting [[knuckle_incs]]) will hence be executed despite the weapon not firing.
 
See also [[EVENT_PRESSEDFIRE]] and [[EVENT_DOFIRE]].
 
[[Category:Events]]

Latest revision as of 15:31, 4 February 2022

Event ID player# THISACTOR RETURN
EVENT_FIRE player that executed the input player->i 1 value

EVENT_FIRE is a game event.

This event is called every game tic while the weapon is firing and the primary fire key is held.

Setting the gamevar RETURN to any non-zero value disables firing the weapon. The hard-coded gamevar WEAPON contains the variable for the player's current weapon.

The difference between this and EVENT_PRESSEDFIRE is that setting RETURN to -1 does not unset the bitflag that indicates that the player has pressed the fire key. Some hardcoded effects (e.g. resetting knuckle_incs) will hence be executed despite the weapon not firing.

See also EVENT_PRESSEDFIRE and EVENT_DOFIRE.