Actor state

Every actor in Wolfenstein 3D exists in one state at every point in time. This state changes variously to change the actor's status.
"Actor" here refers mainly to enemies, though other objects such as projectiles fall under the same category.
==Possible states==
*Stand, in which the enemy stands still, having not detected the player
*Path, in which the enemy is walking around the map on predetermined paths, having not detected the player
*Pain, in which the enemy interrupts any action and recoils in pain from being attacked
*Shoot, in which the enemy attempts to shoot the player
*Chase, in which the enemy has detected the player and gives chase, stopping to shoot occasionally if that state exists for that enemy
*Die (also "dead"), in which the enemy dies
===Specific actors only===
*Jump, in which the enemy bites the player (Dogs only)
*Tired, in which the enemy breathes and rests (Angel of Death and Devil Incarnate only)
*Wait, the equivalent of Stand for a Spectre
*Wake, the rebirth of a Spectre after its death
*Deathcam, which seems to function in the Deathcam for some bosses.
==State definition==
A state is declared to exist in the source code, mainly in . This is done with the extern command. After that, it is described in greater detail with the statetype command. For an abridged example, here are the declarations and definitions of two of a Guard's states - Stand and Path.
extern	statetype s_grdstand;
extern	statetype s_grdpath1;
extern	statetype s_grdpath1s;
extern	statetype s_grdpath2;
extern	statetype s_grdpath3;
extern	statetype s_grdpath3s;
extern	statetype s_grdpath4;
statetype s_grdstand	= {true,SPR_GRD_S_1,0,T_Stand,NULL,&s_grdstand};
statetype s_grdpath1 	= {true,SPR_GRD_W1_1,20,T_Path,NULL,&s_grdpath1s};
statetype s_grdpath1s 	= {true,SPR_GRD_W1_1,5,NULL,NULL,&s_grdpath2};
statetype s_grdpath2 	= {true,SPR_GRD_W2_1,15,T_Path,NULL,&s_grdpath3};
statetype s_grdpath3 	= {true,SPR_GRD_W3_1,20,T_Path,NULL,&s_grdpath3s};
statetype s_grdpath3s 	= {true,SPR_GRD_W3_1,5,NULL,NULL,&s_grdpath4};
statetype s_grdpath4 	= {true,SPR_GRD_W4_1,15,T_Path,NULL,&s_grdpath1};
The parameters appear to be, in order:
#Whether the state has individual sprites for rotation or not; non-rotatable states (like shooting or dying) always show a sprite facing the player.
#Name of sprite which applies during this state (a sprite may apply to multiple states); for rotatable states that's the sprite facing the player, the rotated sprite will then be picked during runtime
#Length of state, in tics (zero tics is infinite state)
#Functions to perform during this state
#Functions to perform, or audio to play, during this state
#The state that should follow this state
==Trivia==
*In the Wolfenstein 3D source code, another state called "giveup" is declared for Guards, Officers, and MutantsCategory:Wolfenstein 3D actor states
Category:Wolfenstein 3D engine, in WL_ACT2.C. It is not referred to again in the same page, and indeed does not seem to be mentioned again anywhere in the source code. It is possible that this is a remnant from early on in development, perhaps from when the game was aimed to be more stealth-oriented like earlier games Castle Wolfenstein and Beyond Castle Wolfenstein.
==References==