Constants

From SRB2 Wiki
Jump to: navigation, search

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.

NoteIcon.png 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 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.
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 12 The executable's Mod ID. In SRB2 v2.1, 12 is the default value for this constant.
CODEBASE 210 The SRB2 version number the executable is based on. In SRB2 v2.1, 210 is the default value for this constant.
VERSION 201 The game's version number.
SUBVERSION 21 The game's sub-version number.
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.

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_*)

NoteIcon.png 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 16383 0x3FFF Frame number mask
FF_ANIMATE 16384 0x4000 State is animated and cycles through several frames
FF_FULLBRIGHT 32768 0x8000 Sprite is not affected by lighting
FF_TRANSMASK 983040 0xF0000 Translucency mask
FF_TRANSSHIFT 16 0x10 Number of bits to shift up to convert tr_transxx constants to TR_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)

Sounds (sfx_*)

Main article: List of sounds

Sound flags (SF_*)

Main article: Sound > Attributes

Skin colors (SKINCOLOR_*)

Main article: List of skin colors
Value Name Color
0 SKINCOLOR_NONE None
1 SKINCOLOR_WHITE White
2 SKINCOLOR_SILVER Silver
3 SKINCOLOR_GREY Grey
4 SKINCOLOR_BLACK Black
5 SKINCOLOR_CYAN Cyan
6 SKINCOLOR_TEAL Teal
7 SKINCOLOR_STEELBLUE Steel Blue
8 SKINCOLOR_BLUE Blue
9 SKINCOLOR_PEACH Peach
10 SKINCOLOR_TAN Tan
11 SKINCOLOR_PINK Pink
12 SKINCOLOR_LAVENDER Lavender
13 SKINCOLOR_PURPLE Purple
Value Name Color
14 SKINCOLOR_ORANGE Orange
15 SKINCOLOR_ROSEWOOD Rosewood
16 SKINCOLOR_BEIGE Beige
17 SKINCOLOR_BROWN Brown
18 SKINCOLOR_RED Red
19 SKINCOLOR_DARKRED Dark Red
20 SKINCOLOR_NEONGREEN Neon Green
21 SKINCOLOR_GREEN Green
22 SKINCOLOR_ZIM Zim
23 SKINCOLOR_OLIVE Olive
24 SKINCOLOR_YELLOW Yellow
25 SKINCOLOR_GOLD Gold
26 MAXSKINCOLORS Total number of skin colors

Super skin colors

Value Name Color
26 SKINCOLOR_SUPER1 Super Sonic #1
27 SKINCOLOR_SUPER2 Super Sonic #2
28 SKINCOLOR_SUPER3 Super Sonic #3
29 SKINCOLOR_SUPER4 Super Sonic #4
30 SKINCOLOR_SUPER5 Super Sonic #5
31 SKINCOLOR_TSUPER1 Super Tails #1
32 SKINCOLOR_TSUPER2 Super Tails #2
33 SKINCOLOR_TSUPER4 Super Tails #3
34 SKINCOLOR_TSUPER5 Super Tails #4
35 SKINCOLOR_TSUPER5 Super Tails #5
36 SKINCOLOR_KSUPER1 Super Knuckles #1
37 SKINCOLOR_KSUPER2 Super Knuckles #2
38 SKINCOLOR_KSUPER3 Super Knuckles #3
39 SKINCOLOR_KSUPER4 Super Knuckles #4
40 SKINCOLOR_KSUPER5 Super Knuckles #5
41 MAXTRANSLATIONS Total number of translations

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

Players

Skin flags (SF_*)

Main article: S_SKIN > flags

Character abilities

See also: S_SKIN > ability and S_SKIN > ability2
Value Name Description
Primary (CA_*)
0 CA_NONE No ability
1 CA_THOK Speed thok
2 CA_FLY Flying
3 CA_GLIDEANDCLIMB Gliding/Climbing
4 CA_HOMINGTHOK Homing attack
5 CA_SWIM Swimming
6 CA_DOUBLEJUMP Double jump
7 CA_FLOAT Floating
8 CA_SLOWFALL Floating with slow descent
9 CA_TELEKINESIS Telekinesis
10 CA_FALLSWITCH Fall switch
11 CA_JUMPBOOST Jump boost
12 CA_AIRDRILL Air drill
13 CA_JUMPTHOK Jump-thok
Secondary (CA2_*)
0 CA2_NONE No ability
1 CA2_SPINDASH Spindash
2 CA2_MULTIABILITY Multiability

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 0x01 PF_FLIPCAM Enables third-person camera flipping in reverse gravity (controlled by the console variable flipcam).
2 0x02 PF_GODMODE The player is invincible to everything, including instant kill hazards like bottomless pits and crushers (controlled by the console command god).
4 0x04 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).
8 0x08 PF_INVIS Prevents enemies and bosses from noticing the player, except after the player has attacked them (controlled by the console command notarget).
16 0x10 PF_ATTACKDOWN The Ring Toss control button was pressed the previous tic.
32 0x20 PF_USEDOWN The Spin control button was pressed the previous tic.
64 0x40 PF_JUMPDOWN The Jump control button was pressed the previous tic.
128 0x80 PF_WPNDOWN The Next Weapon or Prev Weapon control buttons were pressed the previous tic.
256 0x100 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_ingoop or pw_nocontrol, or the player has PF_GLIDING and is skidding; otherwise, the flag will automatically be removed the following tic.
512 0x200 PF_JUMPSTASIS The player is not allowed to jump. This flag can be given if the player has a value set for pw_ingoop, 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.
768 0x300 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_ingoop or pw_nocontrol, or the player has PF_GLIDING and is skidding; otherwise, the flag will automatically be removed the following tic.
1024 0x400 PF_TIMEOVER The player has received a Time Over.
2048 0x800 PF_SUPERREADY The player is ready to transform into their Super form.
4096 0x1000 PF_JUMPED The player has just jumped.
8192 0x2000 PF_SPINNING The player is spinning.
16384 0x4000 PF_STARTDASH The player is charging up their spindash.
32768 0x8000 PF_THOKKED The player has used their character's ability.
65536 0x10000 PF_GLIDING The player is gliding.
131072 0x20000 PF_CARRIED The player is being carried by a flying player character, e.g., Tails.
262144 0x40000 PF_SLIDING The player is in a slide, e.g., Deep Sea Zone's waterslides.
524288 0x80000 PF_ROPEHANG The player is hanging on a rope pulley.
1048576, 0x100000 PF_ITEMHANG The player is hanging on to an Object besides flying player characters or rope pullies, e.g., swinging chains or v2.0 Brak Eggman's missiles.
2097152 0x200000 PF_MACESPIN The player is being spun by a spinning chain.
4194304 0x400000 PF_NIGHTSMODE The player is playing as NiGHTS Super Sonic.
8388608 0x800000 PF_TRANSFERTOCLOSEST NiGHTS Super Sonic is being transferred to the next axis.
16777216 0x1000000 PF_NIGHTSFALL The player spills rings from falling after running out of time as NiGHTS Super Sonic.
33554432 0x2000000 PF_DRILLING NiGHTS Super Sonic is drilling.
67108864 0x4000000 PF_SKIDDOWN NiGHTS Super Sonic has used the "Immediate Stop" technique.
134217728 0x8000000 PF_TAGGED The player has been tagged, and is awaiting the next round in Hide & Seek.
268435456 0x10000000 PF_TAGIT The player is "it" in Tag mode.
536870912 0x20000000 PF_FORCESTRAFE Forces the turn left/right controls to become strafing controls. Reserved for Lua scripting purposes.
1073741824 0x40000000 PF_ANALOGMODE The player is using analog control.

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, teetering, and Tails carry)
  • S_PLAY_STND
  • S_PLAY_TAP1 and S_PLAY_TAP2
  • S_PLAY_TEETER1 and S_PLAY_TEETER2
  • S_PLAY_CARRY
  • S_PLAY_SUPERSTAND
  • S_PLAY_SUPERTEETER
2 PA_WALK Walking animation
  • S_PLAY_RUN1 through S_PLAY_RUN8
  • S_PLAY_SUPERWALK1 and S_PLAY_SUPERWALK2
3 PA_RUN Running animation
  • S_PLAY_SPD1 through S_PLAY_SPD4
  • S_PLAY_SUPERFLY1 and S_PLAY_SUPERFLY2
4 PA_ROLL Spinning animation
  • S_PLAY_ATK1 through S_PLAY_ATK4
5 PA_FALL Falling animation
  • S_PLAY_FALL1 and S_PLAY_FALL2
6 PA_ABILITY Ability animation
  • S_PLAY_ABL1 and S_PLAY_ABL2

Shield types (SH_*)

See also: Shields
Name Value Description
SH_NONE 0 No shield
SH_JUMP 1 Whirlwind Shield
SH_ATTRACT 2 Attraction Shield
SH_ELEMENTAL 3 Elemental Shield
SH_BOMB 4 Armageddon Shield
SH_BUBBLEWRAP 5 S3&K Bubble Shield (unimplemented)
SH_THUNDERCOIN 6 S3&K Thunder Shield (unimplemented)
SH_FLAMEAURA 7 S3&K Flame Shield (unimplemented)
SH_PITY 8 Pity Shield
SH_FIREFLOWER 0x100 (256) Fire Flower shield flag. Note: This can be combined with any of the other shields.

Use (player.powers[pw_shield] & SH_FIREFLOWER) to check if a player has this shield.

SH_FORCE 0x200 (512) Force Shield flag. On its own this flag only gives one health point to the shield – the lower 8 bits can be used as extra health points (max extra health is 0xFF, or 255). Note: This cannot be combined with any of the values SH_JUMP to SH_PITY.

Use (player.powers[pw_shield] & SH_FORCE) to check if a player has this shield.

SH_STACK 0x100 (256) Mask for all shields that can be combined with others (only includes Fire Flower currently).

Use (player.powers[pw_shield] & SH_STACK) to get all shields that can be stacked with others.

SH_NOSTACK ~SH_STACK Inverse of SH_STACK, mask for all shields that cannot be combined with others. (player.powers[pw_shield] & SH_NOSTACK) would therefore return any of the values from SH_NONE to SH_PITY, or instead SH_FORCE plus the extra health points

Player powers (pw_*)

Main article: A_CustomPower

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_USE 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

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

Weather types (PRECIP_*)

See also: Level header > Weather
Value Name Description
0 PRECIP_NONE None
1 PRECIP_STORM Storm (thunder, lightning and rain)
2 PRECIP_SNOW Snow
3 PRECIP_RAIN Rain
4 PRECIP_BLANK Preloaded precipitation
5 PRECIP_STORM_NORAIN Storm (no rain)
6 PRECIP_STORM_NOSTRIKES Storm (no lightning strikes)

Level flags (LF_*)

See also: Level header > LevelFlags
Value Name Description
1 LF_SCRIPTISFILE ScriptName is an external file to load, rather than a WAD or PK3 file lump.
2 LF_SPEEDMUSIC Music will be sped up when the Super Sneakers power-up is in effect, rather than playing mus_shoes.
4 LF_NOSSMUSIC Super Sonic music is not played when the player turns Super.
8 LF_NORELOAD Level is not reset when the player dies in Single Player.
16 LF_NOZONE "Zone" is not added to the level's name.

Menu flags (LF2_*)

See also: Level header > MenuFlags
Value Name Description
1 LF2_HIDEINMENU Level will not appear in the list of maps presented when creating a server.
2 LF2_HIDEINSTATS Level will not appear in the Statistics screen.
4 LF2_RECORDATTACK Level is accessible in Record Attack.
8 LF2_NIGHTSATTACK Level is accessible in NiGHTS Mode.
16 LF2_NOVISITNEEDED Level will be accessible in Record Attack/NiGHTS Mode without requiring the player to visit the level beforehand.

Save override (SAVE_*)

See also: Level header > SaveOverride
Value Name Description
-1 SAVE_NEVER Never save the game's progress.
0 SAVE_DEFAULT Use the default saving behavior.
1 SAVE_ALWAYS Always save the game's progress.

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
Tag Name Description
-2 LE_PINCHPHASE Trigger linedefs with this tag are called whenever a boss enters its pinch phase.
-3 LE_ALLBOSSESDEAD Trigger linedefs with this tag are called when all bosses in the map have been defeated.
-4 LE_BOSSDEAD Trigger linedefs with this tag are called whenever a boss has been defeated.
-5 LE_BOSS4DROP Trigger linedefs with this tag are called when Eggscalibur drops its cage.
-6 LE_BRAKVILEATACK Trigger linedefs with this tag are called when Brak Eggman starts his line-of-sight attack.

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_NODYNAMIC Slope is static and cannot be moved during level runtime.
4 SL_ANCHORVERTEX Slope is using a Slope Vertex Thing to anchor its position (currently unimplemented and has no effect).
8 SL_VERTEXSLOPE Slope is built from three Slope Vertex Things.

Other

Music slots (mus_*)

Main article: List of music

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_HIDEN (or CV_HIDDEN) 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.

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
  Lua [view]
Language features SyntaxMetatables
SRB2 data ActionsConstantsFunctionsGlobal variablesHooksUserdata structures
Tutorials Freeslots and Object resourcesCustom player ability
  Sonic Object Configuration [view]
General ClearMainCfg
Objects ObjectStateSoundFreeslot
Unlockable content EmblemExtraEmblemUnlockableConditionSet
Miscellaneous WipesCharacterLevelCutscene / SceneHudItem
Related links ActionsConstantsCustom Object tutorial