EVENT PREGAME: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
No edit summary
Fox (talk | contribs)
No edit summary
Line 1: Line 1:
EVENT_PREGAME is a [[EDuke32 event list|game event]].
EVENT_GAME is a [[EDuke32_event_list|Game Event]].


This [[event]] is triggered once per tic per sprite in the game. The gamevar [[THISACTOR]] refers to the ID of the actor executing the code.  Thus, it takes the value of each actor in the game.
This [[event]] is triggered once per tic per sprite in the game. The gamevar [[THISACTOR]] refers to the ID of the actor executing the code.  Thus, it takes the value of each actor in the game.


All sprites are processed in the following fashion:
Typically this event is processed after hard-coded effects and the actor code (with [[actor]] or [[useractor]]), while [[EVENT_PREGAME]] is processed before. Thus EVENT_GAME can be used to override these effects. Generally EVENT_GAME is sufficient for coding needs but EVENT_PREGAME has some specific uses.


#EVENT_PREGAME
Unlike [[actor]] or [[useractor]], EVENT_GAME and EVENT_PREGAME are triggered the same tic the sprite is loaded/spawned, but are processed after [[EVENT_LOADACTOR]] or [[EVENT_EGS]].
#hardcoded stuff
#[[EVENT_GAME]]


One potential use specifically for EVENT_PREGAME is to examine struct values which are clobbered by commands such as [[ifhitweapon]]/[[ifwasweapon]]. Otherwise, [[EVENT_GAME]] is generally sufficient.
One potential use specifically for EVENT_PREGAME is to examine struct values which are clobbered by commands such as [[ifhitweapon]]/[[ifwasweapon]].


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

Revision as of 13:32, 20 July 2014

EVENT_GAME is a Game Event.

This event is triggered once per tic per sprite in the game. The gamevar THISACTOR refers to the ID of the actor executing the code. Thus, it takes the value of each actor in the game.

Typically this event is processed after hard-coded effects and the actor code (with actor or useractor), while EVENT_PREGAME is processed before. Thus EVENT_GAME can be used to override these effects. Generally EVENT_GAME is sufficient for coding needs but EVENT_PREGAME has some specific uses.

Unlike actor or useractor, EVENT_GAME and EVENT_PREGAME are triggered the same tic the sprite is loaded/spawned, but are processed after EVENT_LOADACTOR or EVENT_EGS.

One potential use specifically for EVENT_PREGAME is to examine struct values which are clobbered by commands such as ifhitweapon/ifwasweapon.