Statnum: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
I remember hearing about statnum 1024, but I haven't tried it myself.
pretty table, taken from WEAPONx_FLAGS
Line 1: Line 1:
Statnums are used by the game internally to see whether something is an actor, player, projectile, etc, and then process it appropriately.
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):
{| {{prettytable}}
!Name!!Number!!Description!!
|-
|STAT_DEFAULT
|align="right"|'''0'''
|Sprites that are not defined by the CON code as actors, and are not projectiles, etc, have a statnum of 0. (i.e. the floor texture sprites used to make up a sprite bridge)
|-
|STAT_ACTOR
|align="right"|'''1'''
|Actors. Sprites with a statnum of 1 will execute the actor code that applies to their tile number in the CON scripts.
|-
|STAT_ZOMBIEACTOR
|align="right"|'''2'''
|Sleepers. Sprites taking a break from code execution (e.g. a Pig Cop 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)
|-
|STAT_EFFECTOR
|align="right"|'''3'''
|
|-
|STAT_PROJECTILE
|align="right"|'''4'''
|Projectiles. This includes hardcoded projectiles like RPG, FREEZEBLAST, and SHRINKSPARK, as well as [[defineprojectile|custom projectiles]].  It does not include hitscan projectiles (bullets), since those are not sprites that exist in the game world. (SHOTSPARK1, the sprite spawned by bullets, is not itself a projectile.)
|-
|STAT_MISC
|align="right"|'''5'''
|
|-
|STAT_STANDABLE
|align="right"|'''6'''
|
|-
|STAT_LOCATOR
|align="right"|'''7'''
|
|-
|STAT_ACTIVATOR
|align="right"|'''8'''
|
|-
|STAT_TRANSPORT
|align="right"|'''9'''
|
|-
|STAT_PLAYER
|align="right"|'''10'''
|Player
|-
|STAT_FX
|align="right"|'''11'''
|
|-
|STAT_FALLER
|align="right"|'''12'''
|
|-
|STAT_DUMMYPLAYER
|align="right"|'''13'''
|
|-
|
|align="right"|'''1024'''
|A sprite id with this statnum is invalid, meaning that it has been deleted or just never existed in the map.
|}


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.
1024 -- Unused sprite. A sprite id with this statnum is invalid, meaning that it has been deleted or just never existed in the map.
[[Category:Sprite structure members]]
[[Category:Sprite structure members]]

Revision as of 15:44, 6 August 2009

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

Name Number Description
STAT_DEFAULT 0 Sprites that are not defined by the CON code as actors, and are not projectiles, etc, have a statnum of 0. (i.e. the floor texture sprites used to make up a sprite bridge)
STAT_ACTOR 1 Actors. Sprites with a statnum of 1 will execute the actor code that applies to their tile number in the CON scripts.
STAT_ZOMBIEACTOR 2 Sleepers. Sprites taking a break from code execution (e.g. a Pig Cop 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)
STAT_EFFECTOR 3
STAT_PROJECTILE 4 Projectiles. This includes hardcoded projectiles like RPG, FREEZEBLAST, and SHRINKSPARK, as well as custom projectiles. It does not include hitscan projectiles (bullets), since those are not sprites that exist in the game world. (SHOTSPARK1, the sprite spawned by bullets, is not itself a projectile.)
STAT_MISC 5
STAT_STANDABLE 6
STAT_LOCATOR 7
STAT_ACTIVATOR 8
STAT_TRANSPORT 9
STAT_PLAYER 10 Player
STAT_FX 11
STAT_FALLER 12
STAT_DUMMYPLAYER 13
1024 A sprite id with this statnum is invalid, meaning that it has been deleted or just never existed in the map.