Statnum: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
Statnums are used by the game internally to see whether something is an actor, player, projectile, etc...
Statnums are used by the game internally to see whether something is an actor, player, projectile, etc, and then process it appropriately.


Some statnums also have certain properties attached to them. For example, actors with a statnum of 5 (moveweapons) cannot be killed with the [[killit]] primitive. In order for them to be killed their statnum has to be changed with [[changespritestat]].
Some important statnums (there are many more not listed):
 
0 -- Sprites that are not defined by the CON code as actors, and are not projectiles, etc, have a statnum of 0.  (E.g. the floor texture sprites used to make up a sprite bridge).
 
1 -- Actors.  Sprites with a statnum of 1 will execute the actor code that applies to their tile number in the CON scripts.
 
2 -- Sleepers.  Sprites taking a break from code execution (e.g. a Pigcop that has been left alone for long enough will revert to statnum 2, only waking up and going back to statnum 1 upon seeing the player again)
 
4 -- Projectiles.  These includes RPG, FREEZEBLAST, etc., as well as custom projectiles.  It does not include hitscan (bullets), since those are not sprites that exist in the game world (SHOTSPARK1, the sprite spawned by bullets, is not itself a projectile)
 
10 -- The player.


[[Category:Sprite structure members]]
[[Category:Sprite structure members]]

Revision as of 01:48, 15 August 2008

Statnums are used by the game internally to see whether something is an actor, player, projectile, etc, and then process it appropriately.

Some important statnums (there are many more not listed):

0 -- Sprites that are not defined by the CON code as actors, and are not projectiles, etc, have a statnum of 0. (E.g. the floor texture sprites used to make up a sprite bridge).

1 -- Actors. Sprites with a statnum of 1 will execute the actor code that applies to their tile number in the CON scripts.

2 -- Sleepers. Sprites taking a break from code execution (e.g. a Pigcop that has been left alone for long enough will revert to statnum 2, only waking up and going back to statnum 1 upon seeing the player again)

4 -- Projectiles. These includes RPG, FREEZEBLAST, etc., as well as custom projectiles. It does not include hitscan (bullets), since those are not sprites that exist in the game world (SHOTSPARK1, the sprite spawned by bullets, is not itself a projectile)

10 -- The player.