Constants

From SRB2 Wiki
Jump to navigation Jump to search
This article or section is outdated and has not been fully updated to reflect the current version of SRB2.

Please help the Wiki by correcting or removing any misinformation, as well as adding any new information to the page.

To do
https://wiki.srb2.org/wiki/User:LJ_Sonik/List_of_outdated_Lua_stuff

This is a comprehensive list of all constants that can be used in SOCs and Lua scripts. Constants are special keywords recognized by SRB2, such as FRACUNIT and TICRATE, which represent a specific, unchangeable integer number. In Lua, these must always be written in the correct case as given in this article (or in linked articles). SOC, however, is case-insensitive and allows all constants to be written in any case whatsoever. Many groups of constants are identifiable by certain prefixes in their names – for example, all primary Object flags have the MF_ prefix, while all secondary Object flags have the MF2_ prefix instead.

Note
Due to the sheer number of constants available in SRB2 altogether, not all of them can be listed here. For convenience, this article provides links to other articles on the SRB2 Wiki already covering specific groups of constants, where they may be explained in more detail than this article can give.

Basic

Integer type limits (INTn_*/UINTn_*)

Name Hexadecimal Decimal Description
INT8_MIN 0x80 -128 Signed 8-bit integer minimum
INT16_MIN 0x8000 -32768 Signed 16-bit integer minimum
INT32_MIN 0x80000000 -2147483648 Signed 32-bit integer minimum
INT8_MAX 0x7f 127 Signed 8-bit integer maximum
INT16_MAX 0x7fff 32767 Signed 16-bit integer maximum
INT32_MAX 0x7fffffff 2147483647 Signed 32-bit integer maximum
UINT8_MAX 0xff 255 Unsigned 8-bit integer maximum
UINT16_MAX 0xffff 65535 Unsigned 16-bit integer maximum
UINT32_MAX 0xffffffff 42949672951 Unsigned 32-bit integer maximum

1 Outputs as -1 in SOC or Lua

Angles (ANG*/ANGLE_*)

Name Angle (degrees) Hexadecimal Decimal
Actual SOC/Lua
ANG1 0x00B60B61 11930465
ANG2 0x016C16C1 23860929
ANG10 10º 0x071C71C7 119304647
ANG15 15º 0x0AAAAAAB 178956971
ANG20 20º 0x0E38E38E 238609294
ANG30 30º 0x15555555 357913941
ANG60 60º 0x2AAAAAAB 715827883
ANG64h 64.5º 0x2DDDDDDE 769514974
ANG105 105º 0x4AAAAAAB 1252698795
ANG210 210º 0x95555555 2505397589 -1789569707
ANG255 255º 0xB5555555 3042268501 -1252698795
ANG340 340º 0xF1C71C72 4056358002 -238609294
ANG350 350º 0xF8E38E39 4175662649 -119304647
Name Angle (degrees) Hexadecimal Decimal
Actual SOC/Lua
ANGLE_11hh 11.25º 0x08000000 134217728
ANGLE_22h 22.5º 0x10000000 268435456
ANGLE_45 45º 0x20000000 536870912
ANGLE_67h 67.5º 0x30000000 805306368
ANGLE_90 90º 0x40000000 1073741824
ANGLE_112h 112.5º 0x50000000 1342177280
ANGLE_135 135º 0x60000000 1610612736
ANGLE_157h 157.5º 0x70000000 1879048192
ANGLE_180 180º 0x80000000 2147483648 -2147483648
ANGLE_202h 202.5º 0x90000000 2415919104 -1879048192
ANGLE_225 225º 0xA0000000 2684354560 -1610612736
ANGLE_247h 247.5º 0xB0000000 2952790016 -1342177280
ANGLE_270 270º 0xC0000000 3221225472 -1073741824
ANGLE_292h 292.5º 0xD0000000 3489660928 -805306368
ANGLE_315 315º 0xE0000000 3758096384 -536870912
ANGLE_337h 337.5º 0xF0000000 4026531840 -268435456
ANGLE_MAX ~360º 0xFFFFFFFF 4294967295 -1

Miscellaneous constants

Name Value Description
FRACUNIT

FU

1<<FRACBITS
(1<<16, or 65536)
The basic unit of measurement for lengths, speeds, Object scales and sometimes angles. Values for these measurements are interpreted as fixed-point numbers with FRACUNIT as the base unit, i.e., FRACUNIT represents one unit (or in some cases one pixel), 2*FRACUNIT represents 2.0 units, FRACUNIT/2 represents 0.5 units, and so on.
FRACBITS 16 The number of bits to shift up to convert integers to fixed-point numbers in FRACUNIT scale, or the number of bits to shift down for vice versa. This constant is used to define the value of FRACUNIT itself – modifying the value of FRACBITS in the source code would also modify FRACUNIT's value.

Note that bit-shifting an integer by FRACBITS in either direction is equivalent to multiplication or division by FRACUNIT – i.e., x<<FRACBITS is the same as x*FRACUNIT, and x>>FRACBITS is the same as x/FRACUNIT.

TICRATE 35 The number of tics in a second, i.e., anything multiplied by this value is a measurement in seconds.
NEWTICRATERATIO 1 TODO
NEWTICRATE TICRATE*NEWTICRATERATIO
(or 35)
TODO
MUSICRATE 1000 The music playback rate, or the number of milliseconds in a second, i.e., anything multiplied by this value is a measurement in seconds (in the context of music playback). This is intended for use with SOC parameters and Lua functions that change or set positions within music tracks and/or applying fade in/out effects to them.
RING_DIST 512*FRACUNIT The maximum distance that rings can be from players with an Attraction Shield to be attracted to them. This is also used by the homing attack character ability as the maximum distance an enemy, spring or monitor can be to able to home in on it.
PUSHACCEL 2*FRACUNIT The speed at which pushable Objects with MF2_SLIDEPUSH will be pushed.
MODID 18 The executable's Mod ID. In SRB2 v2.2, 18 is the default value for this constant.
MODVERSION 54 The executable's Mod Version. In SRB2 v2.2.13, 54 is the default value for this constant.
CODEBASE 220 The SRB2 version number the executable is based on. In SRB2 v2.2, 220 is the default value for this constant.
VERSION 202 The game's version number.
VERSIONSTRING "v2.2.13" The game's version, as a string.
SUBVERSION 13 The game's sub-version number. In SRB2 2.2.13, it's 13.
FLOATSPEED FRACUNIT*4 Vertical movement speed for Objects with MF_FLOAT.
MAXSTEPMOVE 24*FRACUNIT The maximum height an Object can step up/down without being blocked by a wall or falling down.
USERANGE 64*FRACUNIT Doom's Use button effect range. Unused in SRB2.
MELEERANGE 64*FRACUNIT Doom's melee attack range. Used in SRB2 by P_CheckMeleeRange and P_SkimCheckMeleeRange.
MISSILERANGE 32*64*FRACUNIT Doom's missile attack range. Used in SRB2 by A_UnidusBall.
ONFLOORZ INT32_MIN Used by the map Thing spawning code to signify that the Thing's Z position is on the sector's floor. This is corrected to the appropriate height in P_SpawnMobj for newly spawned Objects.
ONCEILINGZ INT32_MAX Used by the map Thing spawning code to signify that the Thing's Z position is on the sector's ceiling. This is corrected to the appropriate height in P_SpawnMobj for newly spawned Objects.
INFLIVES 0x7F (or 127) Used by player.lives to indicate that this player has infinite lives.
JOYAXISRANGE 1023 The maximum magnitude for values returned by input.joyAxis and input.joyAxis2.

Objects

Object types (MT_*)

Main article: List of Object types

Primary Object flags (MF_*)

Secondary Object flags (MF2_*)

Extra Object flags (MFE_*)

Thing flags (MTF_*)

Main article: Thing > Flags

States (S_*)

Main article: List of states

Sprite prefixes (SPR_*)

Main article: List of sprites

Translucency levels (tr_*/TR_*)

Note
The lowercase versions of the tr_ constants are exclusive to Lua; tr_trans10 to tr_trans90 will always be read as the uppercase versions in SOC regardless of case.
Value Name Description
1 tr_trans10 10% translucent (90% opaque)
2 tr_trans20 20% translucent (80% opaque)
3 tr_trans30 30% translucent (70% opaque)
4 tr_trans40 40% translucent (60% opaque)
5 tr_trans50 50% translucent (50% opaque)
6 tr_trans60 60% translucent (40% opaque)
7 tr_trans70 70% translucent (30% opaque)
8 tr_trans80 80% translucent (20% opaque)
9 tr_trans90 90% translucent (10% opaque)
10 NUMTRANSMAPS Number of translucency maps
Value Name Description
65536 TR_TRANS10 tr_trans10 for SOCs (tr_trans10<<FF_TRANSSHIFT)
131072 TR_TRANS20 tr_trans20 for SOCs (tr_trans20<<FF_TRANSSHIFT)
196608 TR_TRANS30 tr_trans30 for SOCs (tr_trans30<<FF_TRANSSHIFT)
262144 TR_TRANS40 tr_trans40 for SOCs (tr_trans40<<FF_TRANSSHIFT)
327680 TR_TRANS50 tr_trans50 for SOCs (tr_trans50<<FF_TRANSSHIFT)
393216 TR_TRANS60 tr_trans60 for SOCs (tr_trans60<<FF_TRANSSHIFT)
458752 TR_TRANS70 tr_trans70 for SOCs (tr_trans70<<FF_TRANSSHIFT)
524288 TR_TRANS80 tr_trans80 for SOCs (tr_trans80<<FF_TRANSSHIFT)
589824 TR_TRANS90 tr_trans90 for SOCs (tr_trans90<<FF_TRANSSHIFT)

Frame settings (FF_*)

See also: State > Attributes
Name Decimal Hexadecimal Description
FF_FRAMEMASK 255 0xFF Frame number mask
FF_SPR2SUPER 128 0x80 Super sprite2
FF_SPR2ENDSTATE 256 0x100 State change at the end of sprite2 animation
FF_SPR2MIDSTART 512 0x200 50% chance of starting in the middle of sprite2 animation
FF_BLENDMASK 28672 0x7000 Blending mode mask
FF_BLENDSHIFT 12 0x0C Number of bits to shift up to convert AST_ constants to FF_ constants
FF_ADD 4096 0x1000 Sprite uses additive blending
FF_SUBTRACT 8192 0x2000 Sprite uses subtractive blending
FF_REVERSESUBTRACT 12288 0x3000 Sprite uses reverse subtractive blending
FF_MODULATE 16384 0x4000 Sprite uses modulative blending
FF_TRANSMASK 983040 0xF0000 Translucency mask
FF_TRANSSHIFT 16 0x10 Number of bits to shift up to convert tr_transxx constants to FF_TRANSxx constants
FF_TRANS10 65536 0x10000 Sprite is 10% translucent (90% opaque)
FF_TRANS20 131072 0x20000 Sprite is 20% translucent (80% opaque)
FF_TRANS30 196608 0x30000 Sprite is 30% translucent (70% opaque)
FF_TRANS40 262144 0x40000 Sprite is 40% translucent (60% opaque)
FF_TRANS50 327680 0x50000 Sprite is 50% translucent (50% opaque)
FF_TRANS60 393216 0x60000 Sprite is 60% translucent (40% opaque)
FF_TRANS70 458752 0x70000 Sprite is 70% translucent (30% opaque)
FF_TRANS80 524288 0x80000 Sprite is 80% translucent (20% opaque)
FF_TRANS90 589824 0x90000 Sprite is 90% translucent (10% opaque)
FF_BRIGHTMASK 3145728 0x00300000 Brightness mask
FF_FULLBRIGHT 1048576 0x00100000 Sprite is always at full brightness, not affected by lighting
FF_FULLDARK 2097152 0x00200000 Sprite is always at full darkness, not affected by lighting
FF_SEMIBRIGHT 3145728 0x00300000 Sprite is drawn between full brightness & lighting
FF_PAPERSPRITE 4194304 0x00400000 Sprite is drawn along a vertical plane
FF_FLOORSPRITE 8388608 0x00800000 Sprite is drawn along a horizontal plane
FF_VERTICALFLIP 16777216 0x01000000 Sprite is flipped vertically
FF_HORIZONTALFLIP 33554432 0x02000000 Sprite is flipped horizontally
FF_ANIMATE 268435456 0x10000000 State is animated and cycles through several frames
FF_GLOBALANIM 536870912 0x20000000 Animation is synced to a global timer
FF_RANDOMANIM 1073741824 0x40000000 Animation starts at a random frame

Render flags (RF_*)

Decimal Hexadecimal Flag name Description
1 0x0001 RF_HORIZONTALFLIP Flips the sprite horizontally.
2 0x0002 RF_VERTICALFLIP Flips the sprite vertically.
4 0x0004 RF_ABSOLUTEOFFSETS The sprite will use the values of spritexoffset and spriteyoffset absolutely, instead of relatively to the sprite's original offsets.
8 0x0008 RF_FLIPOFFSETS The values of spritexoffset and spriteyoffset will be applied flipped to the sprite's original offsets.
240 0x00F0 RF_SPLATMASK Floor sprite mask
16 0x0010 RF_SLOPESPLAT The floor sprite will be drawn along a slope plane.
32 0x0020 RF_OBJECTSLOPESPLAT The floor sprite will adjust to the slope its Object is standing on.
64 0x0040 RF_NOSPLATBILLBOARD The sprite will face its Object's angle rather than the camera.
128 0x0080 RF_NOSPLATROLLANGLE The Object will use angle sprites instead of a single rotated sprite.
768 0x0300 RF_BRIGHTMASK Lighting mask
256 0x0100 RF_FULLBRIGHT The sprite will always be drawn at full brightness.
512 0x0200 RF_FULLDARK The sprite will be drawn completely dark.
768 0x0300 RF_SEMIBRIGHT The sprite will be drawn between full brightness and sector brightness.
1024 0x0400 RF_NOCOLORMAPS The sprite will not be affected by colormaps.
12288 0x3000 RF_SPRITETYPEMASK Sprite type mask
4096 0x1000 RF_PAPERSPRITE The sprite will be drawn in a vertical plane, also known as a papersprite.
8192 0x2000 RF_FLOORSPRITE The sprite will be drawn in a horizontal plane, also known as a floor sprite, or a "splat".
16384 0x4000 RF_SHADOWDRAW The sprite will be skewed and stretched onto the floor as if it was a projected shadow.
32768 0x8000 RF_SHADOWEFFECTS The sprite will be scaled and made transparent as if it was a projected shadow.
49664 0xC200 RF_DROPSHADOW The sprite will fully behave as a projected shadow. Is a combination of RF_SHADOWDRAW, RF_SHADOWEFFECTS and RF_FULLDARK.

Blend modes (AST_*)

Value Name Description
0 AST_COPY No blending
1 AST_TRANSLUCENT Default translucency effect
2 AST_ADD Additive blend mode
3 AST_SUBTRACT Subtractive blend mode
4 AST_REVERSESUBTRACT Difference blend mode
5 AST_MODULATE Multiply blend mode
6 AST_OVERLAY Overlay blend mode

Sounds (sfx_*)

Main article: List of sounds

Sound flags (SF_*)

Main article: Sound > Attributes

Skin colors (SKINCOLOR_*)

Main article: List of skin colors

Translation colormaps (TC_*)

Value Name Description
-1 TC_DEFAULT Default colormap
-2 TC_BOSS Boss flash colormap
-3 TC_METALSONIC Metal Sonic boss flash colormap
-4 TC_ALLWHITE All-white flash colormap (used by Brak Eggman)
-5 TC_RAINBOW Remaps all colors to a skincolor range
-6 TC_BLINK Remaps all colors to a single color index
-7 TC_DASHMODE For Metal Sonic's dashmode

A_Chase directions (DI_*)

Value Name Description
-1 DI_NODIR No direction
0 DI_EAST East
1 DI_NORTHEAST Northeast
2 DI_NORTH North
3 DI_NORTHWEST Northwest
4 DI_WEST West
5 DI_SOUTHWEST Southwest
6 DI_SOUTH South
7 DI_SOUTHEAST Southeast
8 NUMDIRS Total number of directions

Damage/Death types (DMG_*)

Name Hexadecimal Decimal Description
DMG_WATER 0x01 1 Damage dealt by liquids
DMG_FIRE 0x02 2 Damage dealt by fire objects and sectors
DMG_ELECTRIC 0x03 3 Damage dealt by electricity
DMG_SPIKE 0x04 4 Damage dealt by spikes
DMG_NUKE 0x05 5 Damage dealt by the bomb shield
DMG_INSTAKILL 0x80 128 Death
DMG_DROWNED 0x81 129 Death dealt by drowning (in liquids)
DMG_SPACEDROWN 0x82 130 Death dealt by drowning (in space)
DMG_DEATHPIT 0x83 131 Death dealt by pits
DMG_CRUSHED 0x84 132 Death dealt by being crushed
DMG_SPECTATOR 0x85 133 Death dealt to spectators (Other damage types do not kill spectators)
DMG_CANHURTSELF 0x40 64 Flag - Whether the source is able to damage itself or their team
DMG_DEATHMASK 0x80 128 Flag - Whether this damage type is a death type

Players

Skin flags (SF_*)

Main article: S_SKIN > flags

Character abilities (CA_*/CA2_*)

See also: S_SKIN > ability and S_SKIN > ability2

Player states (PST_*)

Value Name Description
0 PST_LIVE The player is playing
1 PST_DEAD The player is dead and waiting to respawn
2 PST_REBORN The player just respawned after being dead

Skin sounds (SKS*)

See also: S_SKIN > Custom sounds
Value Name Description
0 SKSSPIN sfx_spin replacement sound
1 SKSPUTPUT sfx_putput replacement sound
2 SKSPUDPUD sfx_pudpud replacement sound
3 SKSPLPAN1 sfx_altow1 replacement sound
4 SKSPLPAN2 sfx_altow2 replacement sound
5 SKSPLPAN3 sfx_altow3 replacement sound
6 SKSPLPAN4 sfx_altow4 replacement sound
7 SKSPLDET1 sfx_altdi1 replacement sound
8 SKSPLDET2 sfx_altdi2 replacement sound
9 SKSPLDET3 sfx_altdi3 replacement sound
10 SKSPLDET4 sfx_altdi4 replacement sound
11 SKSPLVCT1 sfx_victr1 replacement sound
12 SKSPLVCT2 sfx_victr2 replacement sound
13 SKSPLVCT3 sfx_victr3 replacement sound
14 SKSPLVCT4 sfx_victr4 replacement sound
15 SKSTHOK sfx_thok replacement sound
16 SKSSPNDSH sfx_spndsh replacement sound
17 SKSZOOM sfx_zoom replacement sound
18 SKSSKID sfx_skid replacement sound
19 SKSGASP sfx_gasp replacement sound
20 SKSJUMP sfx_jump replacement sound

Internal player flags (PF_*)

Decimal Hexadecimal Flag name Description
1 0x1 PF_FLIPCAM Enables third-person camera flipping in reverse gravity (controlled by the console variable flipcam).
2 0x2 PF_ANALOGMODE The player is using analog control.
4 0x4 PF_DIRECTIONCHAR The player has the Character Angle option set to "Movement".
8 0x8 PF_AUTOBRAKE The player has Automatic Braking enabled.
16 0x10 PF_GODMODE The player is invincible to everything, including instant kill hazards like bottomless pits and crushers (controlled by the console command god).
32 0x20 PF_NOCLIP Turns off the player's collision, allowing them to walk through solid walls, as well as immediately move on top of raised ground regardless of height (controlled by the console command noclip).
64 0x40 PF_INVIS Prevents enemies and bosses from noticing the player, except after the player has attacked them (controlled by the console command notarget).
128 0x80 PF_ATTACKDOWN The Ring Toss control button was pressed the previous tic.
256 0x100 PF_SPINDOWN The Spin control button was pressed the previous tic.
512 0x200 PF_JUMPDOWN The Jump control button was pressed the previous tic.
1024 0x400 PF_WPNDOWN The Next Weapon or Prev Weapon control buttons were pressed the previous tic.
2048 0x800 PF_STASIS The player is not allowed to move, except for jumping. This flag can be given if the player has a value set for pw_nocontrol, or the player has PF_GLIDING and is skidding; otherwise, the flag will automatically be removed the following tic.
4096 0x1000 PF_JUMPSTASIS The player is not allowed to jump. This flag can be given if the 16th bit (1<<15) of pw_nocontrol is set, or the player has PF_GLIDING and is skidding; otherwise, the flag will automatically be removed the following tic.
6144 0x1800 PF_FULLSTASIS The player is not allowed to move or jump (PF_STASIS and PF_JUMPSTASIS combined). This flag can be given if the player has a value set for pw_nocontrol, or the player has PF_GLIDING and is skidding; otherwise, the flag will automatically be removed the following tic.
8192 0x2000 PF_APPLYAUTOBRAKE The player is slowing down due to automatic braking.
16384 0x4000 PF_STARTJUMP The player has started a jump and not yet cut their upwards momentum in half by releasing the jump button.
32768 0x8000 PF_JUMPED The player is jumping.
65536 0x10000 PF_NOJUMPDAMAGE The player's jump will not damage enemies.
131072 0x20000 PF_SPINNING The player is spinning.
262144 0x40000 PF_STARTDASH The player is charging up their spindash.
524288 0x80000 PF_THOKKED The player has used their character's ability.
1048576 0x100000 PF_SHIELDABILITY The player has used their Shield ability.
2097152 0x200000 PF_GLIDING The player is gliding.
4194304 0x400000 PF_BOUNCING The player is tail-bouncing.
8388608 0x800000 PF_SLIDING The player is in a slide, e.g., Deep Sea Zone's waterslides.
16777216 0x1000000 PF_TRANSFERTOCLOSEST NiGHTS Super Sonic is being transferred to the next axis.
33554432 0x2000000 PF_DRILLING NiGHTS Super Sonic is drilling.
67108864 0x4000000 PF_GAMETYPEOVER The player has received a Time Over in Race mode, or is has been tagged in Hide & Seek mode.
134217728 0x8000000 PF_TAGIT The player is "it" in Tag mode.
268435456 0x10000000 PF_FORCESTRAFE Forces the turn left/right controls to become strafing controls. Reserved for Lua scripting purposes.
536870912 0x20000000 PF_CANCARRY The player can carry another player as Tails with their flight.
1073741824 0x40000000 PF_FINISHED The player has finished the level. Separate from exiting, as it's for cases where players can move around while waiting for others to finish the level.

Player animations (PA_*)

Value Name Description Equivalent states
0 PA_ETC Animations that do not fit into the below All states not listed below
1 PA_IDLE Idle animations (standing, waiting)
  • S_PLAY_STND
  • S_PLAY_WAIT
  • S_PLAY_NIGHTS_STAND
2 PA_EDGE Edge teetering animation
  • S_PLAY_EDGE
3 PA_WALK Walking animations
  • S_PLAY_WALK
  • S_PLAY_SKID
  • S_PLAY_FLOAT
4 PA_RUN Running animations
  • S_PLAY_RUN
  • S_PLAY_FLOAT_RUN
5 PA_DASH Dash Mode animation
  • S_PLAY_DASH
6 PA_PAIN Pain animations
  • S_PLAY_PAIN
  • S_PLAY_STUN
7 PA_ROLL Rolling animations
  • S_PLAY_ROLL
  • S_PLAY_NIGHTS_ATTACK
8 PA_JUMP Jumping animation
  • S_PLAY_JUMP
9 PA_SPRING Spring up animation
  • S_PLAY_SPRING
10 PA_FALL Falling animations
  • S_PLAY_FALL
  • S_PLAY_NIGHTS_FLOAT
11 PA_ABILITY Character-specific main ability animations
  • S_PLAY_FLY
  • S_PLAY_FLY_TIRED
  • S_PLAY_SWIM
  • S_PLAY_GLIDE
  • S_PLAY_BOUNCE
  • S_PLAY_BOUNCE_LANDING
  • S_PLAY_TWINSPIN
12 PA_ABILITY2 Character-specific secondary ability animations
  • S_PLAY_SPINDASH
  • S_PLAY_FIRE
  • S_PLAY_FIRE_FINISH
  • S_PLAY_MELEE
  • S_PLAY_MELEE_FINISH
  • S_PLAY_MELEE_LANDING
13 PA_RIDE Riding/carried animation
  • S_PLAY_RIDE

Shield types (SH_*)

Main article: Powers
See also: Shields

Carry types (CR_*)

Main article: Powers

Player powers (pw_*)

Main article: Powers

Emerald flags (EMERALDn)

Button flags (BT_*)

See also: Controls > Configurable controls
Decimal Hexadecimal Flag name Description
8 0x8 BT_SHIELD
Currently only exists in 2.2.14 nightly.

Shield, and also Transformation/De-Transformation

15 0x0F BT_WEAPONMASK Weapon slot buttons. When checking (player.cmd.buttons & BT_WEAPONMASK), returns the value of the weapon slot button pressed, from 1 to 7.
16 0x10 BT_WEAPONNEXT Next Weapon
32 0x20 BT_WEAPONPREV Previous Weapon
64 0x40 BT_ATTACK Ring Toss
128 0x80 BT_SPIN Spin
256 0x100 BT_CAMLEFT Rotate Camera L
512 0x200 BT_CAMRIGHT Rotate Camera R
1024 0x400 BT_TOSSFLAG Toss Flag
2048 0x800 BT_JUMP Jump
4096 0x1000 BT_FIRENORMAL Ring Toss Normal
8196 0x2000 BT_CUSTOM1 Custom Action 1
16384 0x4000 BT_CUSTOM2 Custom Action 2
32768 0x8000 BT_CUSTOM3 Custom Action 3

Mouse button flags (MB_*)

Decimal Hexadecimal Flag name Description
1 0x1 MB_BUTTON1 Mouse Button 1 (Left Click)
2 0x2 MB_BUTTON2 Mouse Button 2 (Right Click)
4 0x4 MB_BUTTON3 Mouse Button 3 (Middle Click)
8 0x8 MB_BUTTON4 Mouse Button 4
16 0x10 MB_BUTTON5 Mouse Button 5
32 0x20 MB_BUTTON6 Mouse Button 6
64 0x40 MB_BUTTON7 Mouse Button 7
128 0x80 MB_BUTTON8 Mouse Button 8
256 0x100 MB_SCROLLUP Scroll Up
512 0x200 MB_SCROLLDOWN Scroll Down

Current weapon (WEP_*)

Value Name Description
1 WEP_AUTO Automatic Ring
2 WEP_BOUNCE Bounce Ring
3 WEP_SCATTER Scatter Ring
4 WEP_GRENADE Grenade Ring
5 WEP_EXPLODE Explosion Ring
6 WEP_RAIL Rail Ring
7 NUM_WEAPONS Total number of weapons

Ring weapon flags (RW_*)

Value Flag name Description
1 RW_AUTO Automatic Ring
2 RW_BOUNCE Bounce Ring
4 RW_SCATTER Scatter Ring
8 RW_GRENADE Grenade Ring
16 RW_EXPLODE Explosion Ring
32 RW_RAIL Rail Ring

P_FlashPal palettes (PAL_*)

Main article: Palette > PLAYPAL

Gotflag flags (GF_*)

Value Name Description
1 GF_REDFLAG Player is carrying the red CTF flag
2 GF_BLUEFLAG Player is carrying the blue CTF flag

Maps

TypeOfLevel flags (TOL_*)

See also: Level header > TypeOfLevel
Decimal Hexadecimal Flag name Description
1 0x01 TOL_SP Single Player
2 0x02 TOL_COOP Co-op
4 0x04 TOL_COMPETITION Competition
8 0x08 TOL_RACE Race
16 0x10 TOL_MATCH Match
32 0x20 TOL_TAG Tag
64 0x40 TOL_CTF Capture the Flag
128 0x80 TOL_CUSTOM Custom (Lua-scripted, etc.)
256 0x100 TOL_2D 2D
512 0x200 TOL_MARIO Mario
1024 0x400 TOL_NIGHTS NiGHTS
2048 0x800 TOL_ERZ3 ERZ3
4096 0x1000 TOL_XMAS Christmas NiGHTS

Gametypes (GT_*)

Value Name Description
0 GT_COOP Single Player/Co-op
1 GT_COMPETITION Competition
2 GT_RACE Race
3 GT_MATCH Match
4 GT_TEAMMATCH Team Match
5 GT_TAG Tag
6 GT_HIDEANDSEEK Hide & Seek
7 GT_CTF Capture the Flag

Intermission types (int_*)

Marathon Mode flags (MA_*)

Determines the current state of a Marathon Mode run, either is starting, in progress, the player is in-game and if cutscenes have been disabled for the run.

Value Name Description
1 MA_RUNNING Marathon Mode Run in Progress
2 MA_INIT Marathon Mode Run Startup
4 MA_NOCUTSCENES Disables Cutscenes for Marathon Mode
8 MA_INGAME Player in Marathon Mode Run

Weather types (PRECIP_*)

See also: Level header > Weather

Level flags (LF_*)

See also: Level header > LevelFlags

Menu flags (LF2_*)

See also: Level header > MenuFlags

NiGHTS grades (GRADE_*)

See also: Level header > GradesX
Value Name Description
0 GRADE_F F grade
1 GRADE_E E grade
2 GRADE_D D grade
3 GRADE_C C grade
4 GRADE_B B grade
5 GRADE_A A grade
6 GRADE_S Rainbow A grade

Linedef flags (ML_*)

Main article: Linedef > Flags

Reserved linedef tags (LE_*)

See also: Reserved tags

FOF flags (FF_*)

Main article: Linedef type 259

Slope flags (SL_*)

Value Name Description
1 SL_NOPHYSICS Slope physics are disabled for this slope.
2 SL_DYNAMIC Slope is dynamic and can be moved during level runtime.

PolyObject flags (POF_*)

Decimal Hexadecimal Flag name Description
1 0x1 POF_CLIPLINES Test against lines for collision.
2 0x2 POF_CLIPPLANES Test against tops and bottoms for collision.
3 0x3 POF_SOLID Clips things.
4 0x4 POF_TESTHEIGHT Test line collision with heights.
8 0x8 POF_RENDERSIDES Renders the sides.
16 0x10 POF_RENDERTOP Renders the top.
32 0x20 POF_RENDERBOTTOM Renders the bottom.
48 0x30 POF_RENDERPLANES Renders top and bottom.
56 0x38 POF_RENDERALL Renders everything.
64 0x40 POF_INVERT Inverts collision (like a cage).
128 0x80 POF_INVERTPLANES Render inside planes.
256 0x100 POF_INVERTPLANESONLY Only render inside planes.
512 0x200 POF_PUSHABLESTOP Pushables will stop movement.
1024 0x400 POF_LDEXEC This PO triggers a linedef executor.
2048 0x800 POF_ONESIDE Only use the first side of the linedef.
4096 0x1000 POF_NOSPECIALS Don't apply sector specials.
8192 0x2000 POF_SPLAT Use splat flat renderer (treat cyan pixels as invisible).

Sector special flags (SSF_*)

Decimal Hexadecimal Flag name Description
1 0x1 SSF_OUTERSPACE The sector is on the outer space, lack of oxygen.
2 0x2 SSF_DOUBLESTEPUP The sector is a ramp sector, doubling the step up/down size.
4 0x4 SSF_NOSTEPDOWN The sector is a non-ramp sector, negating any step up/down.
8 0x8 SSF_WINDCURRENT The sector has a wind current.
16 0x10 SSF_CONVEYOR The sector is a convellor belt.
32 0x20 SSF_SPEEDPAD The sector is a speed pad.
64 0x40 SSF_STARPOSTACTIVATOR The sector activates any starpost inside.
128 0x80 SSF_EXIT The sector is marked as the end of the level.
256 0x100 SSF_SPECIALSTAGEPIT The sector is a special stage's pit, causing players fail the stage.
512 0x200 SSF_RETURNFLAG The sector returns instantly any Capture The Flag's flag to their respective base.
1024 0x400 SSF_REDTEAMBASE The sector is marked as part of Red Team's base.
2048 0x800 SSF_BLUETEAMBASE The sector is marked as part of Blue Team's base.
4096 0x1000 SSF_FAN The sector behaves like a fan, pushes players upwards.
8192 0x2000 SSF_SUPERTRANSFORM The sector automatically transforms any player to their super form, requires having all 7 Chaos Emeralds.
16384 0x4000 SSF_FORCESPIN The sector forces any players to spin.
32768 0x8000 SSF_ZOOMTUBESTART The sector is marked as the start of a zoom tube.
65536 0x10000 SSF_ZOOMTUBEEND The sector is marked as the end of a zoom tube.
131072 0x20000 SSF_FINISHLINE The sector is marked as the Finish Line for Race/Circuit
262144 0x40000 SSF_ROPEHANG The sector behaves like a Rope Hang like on ACZ and ERZ.
524288 0x80000 SSF_JUMPFLIP The sector flips the gravity of any players that jumps.
1048576 0x100000 SSF_GRAVITYOVERRIDE The sector makes reverse gravity temporary.

Sector flags (MSF_*)

Decimal Hexadecimal Flag name Description
1 0x1 MSF_FLIPSPECIAL_FLOOR The sector triggers linedef executor via touching it's floor plane.
2 0x2 MSF_FLIPSPECIAL_CEILING The sector triggers linedef executor via touching it's ceiling plane.
4 0x4 MSF_FLIPSPECIAL_BOTH The sector triggers linedef executor via touching both of it's planes.
8 0x8 MSF_TRIGGERSPECIAL_TOUCH The sector triggers linedef executor via touching one of it's edges.
16 0x10 MSF_TRIGGERSPECIAL_HEADBUMP The sector triggers linedef executors via bumping with the head.
32 0x20 MSF_TRIGGERLINE_PLANE The sector requires to touch it's planes to trigger linedef executors.
64 0x40 MSF_TRIGGERLINE_MOBJ The sector allows non-pushable objects to trigger linedef executors.
128 0x80 MSF_INVERTPRECIP The sector inverts precipitation effects going from the floor to the ceiling.
256 0x100 MSF_GRAVITYFLIP The sector flips any objects in reverse gravity.
512 0x200 MSF_HEATWAVE The sector produces a heatwave effect.
1024 0x400 MSF_NOCLIPCAMERA The sector is intangible to the camera.

Sector damage types (SD_*)

Value Flag name Description
0 SD_NONE No type of damage applied.
1 SD_GENERIC Generic type of damage.
2 SD_WATER Acid type of damage.
3 SD_FIRE Fire type of damage.
4 SD_LAVA Lava type of damage
5 SD_ELECTRIC Electrical type of damage.
6 SD_SPIKE Spike type of damage.
7 SD_DEATHPITTILT Instakills like a death pit, the camera tilts to focus the pit.
8 SD_DEATHPITNOTILT Instakills like a death pit, except the camera doesn't tilts to focus the pit.
9 SD_INSTAKILL Instakills totally even with invulnerability, and even if not touching the sector's floor/ceiling.
10 SD_SPECIALSTAGE Old special stage damage, doesn't kills, only removes shield (if any) and knockbacks, and removes 5 seconds on the timer.

Other

Emblem flags (GE_*/ME_*)

See also: Custom unlockables and emblems
Value Name Description
1 GE_NIGHTSPULL Emblem of the NiGHTS track, required to be pulled.
2 GE_NIGHTSITEM Emblem on the NiGHTS track, acts like a NiGHTS's item.
1 ME_ALLEMERALDS Requires to have all the 7 Chaos Emeralds to be collected.
2 ME_ULTIMATE Requires to be played on Ultimate Mode to be collected.
4 ME_PERFECT Requires a Perfect Bonus to be collected.

Music slots (mus_*)

Main article: List of music

Jingle types (JT_*)

Value Name Description
0 JT_NONE Null state
1 JT_OTHER Other state
2 JT_MASTER Main level music
3 JT_1UP Extra life
4 JT_SHOES Speed shoes
5 JT_INV Invincibility
6 JT_MINV Mario Invincibility
7 JT_DROWN Drowning
8 JT_SUPER Super Sonic
9 JT_GOVER Game Over
10 JT_NIGHTSTIMEOUT NiGHTS Time Out (10 seconds)
11 JT_SSTIMEOUT NiGHTS Special Stage Time Out (10 seconds)

Console variable flags (CV_*)

Value Name Description
1 CV_SAVE The console variable's value is saved to config.cfg when changed. Currently does not really work for custom Lua-defined console variables because they are erased from config.cfg if they are not defined (i.e., if the script that defines them is not loaded) when the game is launched.
2 CV_CALL A function is called when the variable is changed.
4 CV_NETVAR The variable is synchronized for everyone in netgames; only the server or admin can modify it.
8 CV_NOINIT If a function is called when the variable is changed (CV_CALL), the function is not called when the variable is first registered.
16 CV_FLOAT The variable takes floating-point values, i.e., non-whole numbers such as 0.5 and 0.45 are accepted. These are then converted to a fixed-point integer value (e.g.: "0.5" becomes FRACUNIT/2).
32 CV_NOTINNET The variable cannot be changed in netgames.
64 CV_MODIFIED This flag is set when the variable is modified.
128 CV_SHOWMODIF The console displays a message when the variable is modified.
256 CV_SHOWMODIFONETIME The console displays a message when the variable is modified, but only once.
512 CV_NOSHOWHELP The variable is not shown in the list generated by the help console command.
1024 CV_HIDDEN

CV_HIDEN

The variable is not accessible by the console.
2048 CV_CHEAT The variable is a cheat, and can be reset to its default value by using cheats off in the console.
4096 CV_ALLOWLUA The variable can be set from Lua. Custom Lua-defined console variables will automatically have this flag set.

Command flags (COM_*)

See also: Lua > Functions > COM_AddCommand
Value Name Description
1 COM_ADMIN The command is only available to server hosts or administrators.
2 COM_SPLITSCREEN The command is only available in Splitscreen mode.
4 COM_LOCAL The command is not synchronised over the network, and should only affect the client who executed the command.

Video flags (V_*)

Main article: Video flags

HUD items (HUD_*)

Kick reasons (KR_*)

Value Name Description
1 KR_KICK Kicked intentionally by the server or an admin
2 KR_PINGLIMIT Broke ping limit
3 KR_SYNCH Synch failure
4 KR_TIMEOUT Connection timeout
5 KR_BAN Player was banned from the server
6 KR_LEAVE Player quit

Game states (GS_*)

Value Name Description
0 GS_NULL None, Game Load
1 GS_LEVEL Gameplay
2 GS_INTERMISSION Intermission screen
3 GS_CONTINUING Continue screen
4 GS_TITLESCREEN Title screen
5 GS_TIMEATTACK Record Attack/NiGHTS Mode menu
6 GS_CREDITS Credits
7 GS_EVALUATION Singleplayer/Marathon Run evaluation screen
8 GS_GAMEEND Game End Screen
9 GS_INTRO Intro cutscene
10 GS_ENDING Ending
11 GS_CUTSCENE Cutscene
12 GS_DEDICATEDSERVER Dedicated server
13 GS_WAITINGPLAYERS Waiting For Players in Multiplayer

Game controls (GC_*)

Value Name Description
0 GC_NULL Unmapped
1 GC_FORWARD Move Forward
2 GC_BACKWARD Move Backward
3 GC_STRAFELEFT Move Left
4 GC_STRAFERIGHT Move Right
5 GC_TURNLEFT Look Left
6 GC_TURNRIGHT Look Right
7 GC_WEAPONNEXT Next Weapon
8 GC_WEAPONPREV Prev Weapon
9 GC_WEPSLOT1 Normal/Infinity
10 GC_WEPSLOT2 Automatic
11 GC_WEPSLOT3 Bounce
12 GC_WEPSLOT4 Scatter
13 GC_WEPSLOT5 Grenade
14 GC_WEPSLOT6 Explosion
15 GC_WEPSLOT7 Rail
16 GC_WEPSLOT8 Weapon Slot 8
17 GC_WEPSLOT9 Weapon Slot 9
18 GC_WEPSLOT10 Weapon Slot 10
19 GC_FIRE Fire
20 GC_FIRENORMAL Fire Normal
21 GC_TOSSFLAG Toss Flag
22 GC_SPIN Spin
23 GC_CAMTOGGLE Toggle Third-Person
24 GC_CAMRESET Reset Camera
25 GC_LOOKUP Look Up
26 GC_LOOKDOWN Look Down
27 GC_CENTERVIEW Center View
28 GC_MOUSEAIMING Toggle Mouselook
29 GC_TALKKEY Talk
30 GC_TEAMKEY Talk (Team only)
31 GC_SCORES Game Status
32 GC_JUMP Jump
33 GC_CONSOLE Console
34 GC_PAUSE Pause/Run Retry
35 GC_SYSTEMMENU Open/Close Menu (ESC)
36 GC_SCREENSHOT Screenshot
37 GC_RECORDGIF Toggle GIF Recording
38 GC_VIEWPOINTNEXT Change to Next Viewpoint
39 GC_VIEWPOINTPREV Change to Previous Viewpoint
40 GC_CUSTOM1 Custom Action 1
41 GC_CUSTOM2 Custom Action 2
42 GC_CUSTOM3 Custom Action 3
43 NUM_GAMECONTROLS Total number of game controls

Joystick axes (JA_*)

Value Name Description
0 JA_NONE Null axis
1 JA_TURN Turn axis
2 JA_MOVE Move axis
3 JA_LOOK Vertical look axis
4 JA_STRAFE Side-step axis
5 JA_DIGITAL All axes below are digital rather than analog.
5 JA_JUMP Jump axis
6 JA_SPIN Spin axis
7 JA_FIRE Fire axis
8 JA_FIRENORMAL Normal fire axis

Menu types (MN_*)

Value Name Description
1 MN_NONE Not in-menu.
2 MN_MAIN Main menu.
3 MN_SP_MAIN Singleplayer.
4 MN_SP_LOAD New GameLoad Game.
5 MN_SP_PLAYER Character Select.
6 MN_SP_LEVELSELECT Level Select.
7 MN_SP_LEVELSTATS Level Stadistics.
8 MN_SP_TIMEATTACK Time Attack.
9 MN_SP_TIMEATTACK_LEVELSELECT Time Attack's Level Select.
10 MN_SP_GUESTREPLAY Time Attack's Guest Replay.
11 MN_SP_REPLAY Time Attack's Replay.
12 MN_SP_GHOST Time Attack' Ghost Replay.
13 MN_SP_NIGHTSATTACK NiGHTS Attack.
14 MN_SP_NIGHTS_LEVELSELECT NiGHTS Attack's Level Select.
15 MN_SP_NIGHTS_GUESTREPLAY NiGHTS Attack's Guest Replay.
16 MN_SP_NIGHTS_REPLAY NiGHTS Attack's Replay.
17 MN_SP_NIGHTS_GHOST NiGHTS Attack's Ghost Replay..
18 MN_MP_MAIN Multiplayer.
19 MN_MP_SPLITSCREEN Play Splitscreen game
20 MN_MP_SERVER Host Game
21 MN_MP_CONNECT Join Game
22 MN_MP_ROOM Master Server room selection
23 MN_MP_PLAYERSETUP Player Setup
24 MN_MP_SERVER_OPTIONS Host Game's Server options.
25 MN_OP_MAIN Options.
26 MN_OP_P1CONTROLS Player 1 controls.
27 MN_OP_CHANGECONTROLS Change controls.
28 MN_OP_P1MOUSE Player 1 mouse.
29 MN_OP_P1JOYSTICK Player 1 joystick/controller.
30 MN_OP_JOYSTICKSET Joystick/Controller selection.
31 MN_OP_P1CAMERA Player 1 camera.
32 MN_OP_P2CONTROLS Player 2 controls.
33 MN_OP_P2MOUSE Player 2 mouse.
34 MN_OP_P2JOYSTICK Player 2 joystick.
35 MN_OP_P2CAMERA Player 2 camera.
36 MN_OP_PLAYSTYLE Select playstyle.
37 MN_OP_VIDEO Video Options.
38 MN_OP_VIDEOMODE Video Mode selection.
39 MN_OP_COLOR Color Options.
40 MN_OP_OPENGL OpenGL Options.
41 MN_OP_OPENGL_LIGHTING OpenGL Coronas Lighting options?
42 MN_OP_SOUND Sound Options.
43 MN_OP_SERVER Server Options.
44 MN_OP_MONITORTOGGLE Gameplay Monitor Toggles.
45 MN_OP_DATA Data Options.
46 MN_OP_ADDONS Addons Options.
47 MN_OP_SCREENSHOTS Screenshots Options.
48 MN_OP_ERASEDATA Delete Data.
49 MN_SR_MAIN Extras Menu.
50 MN_SR_PANDORA Pandora's Box.
51 MN_SR_LEVELSELECT Secret Level Select.
52 MN_SR_UNLOCKCHECKLIST Unlockables Checklist
53 MN_SR_EMBLEMHINT Emblem Hints.
54 MN_SR_PLAYER Character Select from Secret Level Select.
55 MN_SR_SOUNDTEST Sound Test.
56 MN_AD_MAIN Addons.
57 MN_SPECIAL Misc.
  Lua [view]
Language features SyntaxMetatables
SRB2 data ActionsConstantsFunctionsGlobal variablesHooksUserdata structures
SRB2Kart data Kart Userdata structuresKart FunctionsKart HooksKart Global Variables and Constants
Tutorials Freeslots and Object resourcesCustom player ability
  SOC [view]
General ClearMainCfg
Objects ObjectStateSoundSprite2SpriteInfoSprite2InfoFreeslot
Unlockable content EmblemExtraEmblemUnlockableConditionSet
Miscellaneous WipesCharacterLevelCutscene / ScenePromptMenuHudItem
Related links ActionsConstantsCustom Object tutorial