Constants

From SRB2 Wiki
(Redirected from Lua/Constants)
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
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_*)

To do
Elaborate.
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
To do
Add a description
2 0x2 SSF_DOUBLESTEPUP
To do
Add a description
4 0x4 SSF_NOSTEPDOWN
To do
Add a description
8 0x8 SSF_WINDCURRENT
To do
Add a description
16 0x10 SSF_CONVEYOR
To do
Add a description
32 0x20 SSF_SPEEDPAD
To do
Add a description
64 0x40 SSF_STARPOSTACTIVATOR
To do
Add a description
128 0x80 SSF_EXIT
To do
Add a description
256 0x100 SSF_SPECIALSTAGEPIT
To do
Add a description
512 0x200 SSF_RETURNFLAG
To do
Add a description
1024 0x400 SSF_REDTEAMBASE
To do
Add a description
2048 0x800 SSF_BLUETEAMBASE
To do
Add a description
4096 0x1000 SSF_FAN
To do
Add a description
8192 0x2000 SSF_SUPERTRANSFORM
To do
Add a description
16384 0x4000 SSF_FORCESPIN
To do
Add a description
32768 0x8000 SSF_ZOOMTUBESTART
To do
Add a description
65536 0x10000 SSF_ZOOMTUBEEND
To do
Add a description
131072 0x20000 SSF_FINISHLINE
To do
Add a description
262144 0x40000 SSF_ROPEHANG
To do
Add a description
524288 0x80000 SSF_JUMPFLIP
To do
Add a description
1048576 0x100000 SSF_GRAVITYOVERRIDE
To do
Add a description

Sector flags (MSF_*)

Decimal Hexadecimal Flag name Description
1 0x1 MSF_FLIPSPECIAL_FLOOR
To do
Add a description
2 0x2 MSF_FLIPSPECIAL_CEILING
To do
Add a description
4 0x4 MSF_FLIPSPECIAL_BOTH
To do
Add a description
8 0x8 MSF_TRIGGERSPECIAL_TOUCH
To do
Add a description
16 0x10 MSF_TRIGGERSPECIAL_HEADBUMP
To do
Add a description
32 0x20 MSF_TRIGGERLINE_PLANE
To do
Add a description
64 0x40 MSF_TRIGGERLINE_MOBJ
To do
Add a description
128 0x80 MSF_INVERTPRECIP
To do
Add a description
256 0x100 MSF_GRAVITYFLIP
To do
Add a description
512 0x200 MSF_HEATWAVE
To do
Add a description
1024 0x400 MSF_NOCLIPCAMERA
To do
Add a description

Sector damage types (SD_*)

Value Flag name Description
0 SD_GENERIC
To do
Add a description
1 SD_GENERIC
To do
Add a description
2 SD_WATER
To do
Add a description
3 SD_FIRE
To do
Add a description
4 SD_LAVA
To do
Add a description
5 SD_ELECTRIC
To do
Add a description
6 SD_SPIKE
To do
Add a description
7 SD_DEATHPITTILT
To do
Add a description
8 SD_DEATHPITNOTILT
To do
Add a description
9 SD_INSTAKILL
To do
Add a description
10 SD_SPECIALSTAGE
To do
Add a description

Other

Emblem flags (GE_*/ME_*)

See also: Custom unlockables and emblems
Value Name Description
1 GE_NIGHTSPULL
2 GE_NIGHTSITEM
1 ME_ALLEMERALDS
2 ME_ULTIMATE
4 ME_PERFECT

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_VIEWPOINT Change Viewpoint
39 GC_CUSTOM1 Custom Action 1
40 GC_CUSTOM2 Custom Action 2
41 GC_CUSTOM3 Custom Action 3
42 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
To do
Add a description
2 MN_MAIN
To do
Add a description
3 MN_SP_MAIN
To do
Add a description
4 MN_SP_LOAD
To do
Add a description
5 MN_SP_PLAYER
To do
Add a description
6 MN_SP_LEVELSELECT
To do
Add a description
7 MN_SP_LEVELSTATS
To do
Add a description
8 MN_SP_TIMEATTACK
To do
Add a description
9 MN_SP_TIMEATTACK_LEVELSELECT
To do
Add a description
10 MN_SP_GUESTREPLAY
To do
Add a description
11 MN_SP_REPLAY
To do
Add a description
12 MN_SP_GHOST
To do
Add a description
13 MN_SP_NIGHTSATTACK
To do
Add a description
14 MN_SP_NIGHTS_LEVELSELECT
To do
Add a description
15 MN_SP_NIGHTS_GUESTREPLAY
To do
Add a description
16 MN_SP_NIGHTS_REPLAY
To do
Add a description
17 MN_SP_NIGHTS_GHOST
To do
Add a description
18 MN_MP_MAIN
To do
Add a description
19 MN_MP_SPLITSCREEN
To do
Add a description
20 MN_MP_SERVER
To do
Add a description
21 MN_MP_CONNECT
To do
Add a description
22 MN_MP_ROOM
To do
Add a description
23 MN_MP_PLAYERSETUP
To do
Add a description
24 MN_MP_SERVER_OPTIONS
To do
Add a description
25 MN_OP_MAIN
To do
Add a description
26 MN_OP_P1CONTROLS
To do
Add a description
27 MN_OP_CHANGECONTROLS
To do
Add a description
28 MN_OP_P1MOUSE
To do
Add a description
29 MN_OP_P1JOYSTICK
To do
Add a description
30 MN_OP_JOYSTICKSET
To do
Add a description
31 MN_OP_P1CAMERA
To do
Add a description
32 MN_OP_P2CONTROLS
To do
Add a description
33 MN_OP_P2MOUSE
To do
Add a description
34 MN_OP_P2JOYSTICK
To do
Add a description
35 MN_OP_P2CAMERA
To do
Add a description
36 MN_OP_PLAYSTYLE
To do
Add a description
37 MN_OP_VIDEO
To do
Add a description
38 MN_OP_VIDEOMODE
To do
Add a description
39 MN_OP_COLOR
To do
Add a description
40 MN_OP_OPENGL
To do
Add a description
41 MN_OP_OPENGL_LIGHTING
To do
Add a description
42 MN_OP_SOUND
To do
Add a description
43 MN_OP_SERVER
To do
Add a description
44 MN_OP_MONITORTOGGLE
To do
Add a description
45 MN_OP_DATA
To do
Add a description
46 MN_OP_ADDONS
To do
Add a description
47 MN_OP_SCREENSHOTS
To do
Add a description
48 MN_OP_ERASEDATA
To do
Add a description
49 MN_SR_MAIN
To do
Add a description
50 MN_SR_PANDORA
To do
Add a description
51 MN_SR_LEVELSELECT
To do
Add a description
52 MN_SR_UNLOCKCHECKLIST
To do
Add a description
53 MN_SR_EMBLEMHINT
To do
Add a description
54 MN_SR_PLAYER
To do
Add a description
55 MN_SR_SOUNDTEST
To do
Add a description
56 MN_AD_MAIN
To do
Add a description
57 MN_SPECIAL
To do
Add a description
  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