Object Flags
Object Flags are a series of toggles that determine the properties of an Object. They are used for a variety of different purposes, such as the Object's interaction with the level environment and other Objects as well as the type of thinker it uses. Some of them have very specific uses while others set more general options.
There are two sets of flags: The regular FLAGS are the basic properties that must be set for every Object and that are checked on level load. In most cases, these properties won't change in-game. In contrast to these, the FLAGS2 are used for temporary properties that are added and removed by certain actions for short periods of time. While the FLAGS must be set for every custom Object in its SOC block, the FLAGS2 can only be set during runtime.
Every flag has a unique numerical value. To set a flag for an Object, its value must be added to the FLAGS property in the SOC block of that Object. The SRB2 SOC Editor lists the Object's FLAGS in the form of checkboxes, allowing users to set the flags without calculating the resulting value. However, not all FLAGS are listed correctly. The FLAGS2 are generally used for very specific purposes and rarely need to be modified manually, but if it is necessary, they can be modified with the action A_SetObjectFlags2. A_SetObjectFlags does the same for the Object's FLAGS if it is necessary to modify them during runtime.
Object Flags
| Decimal | Hexadecimal | Flag Name | Description |
|---|---|---|---|
| 1 | 0x00000001 |
MF_SPECIAL | When an Object with this flag is touched by the player, the function P_TouchSpecialThing is called to determine what should happen with the Object and/or the player. Objects that interact with the player in some way upon being touched, such as enemies, hazards or collectible items, should have this flag. |
| 2 | 0x00000002 |
MF_SOLID | This makes the Object solid, and it will act as such to the player. Note that without MF_PUSHABLE or MF2_STANDONME, the player will not be able to properly stand on the Object. |
| 4 | 0x00000004 |
MF_SHOOTABLE | The Object can be damaged. Combined with MF_SOLID, this makes it vulnerable to missiles, but not normal attacks. |
| 8 | 0x00000008 |
MF_NOSECTOR | Removes the Object from the sector links, making it invisible. Don't change this flag during runtime. To make something invisible during the game, use MF2_DONTDRAW or set the sprite to SPR_DISS. |
| 16 | 0x00000010 |
MF_NOBLOCKMAP | Removes the Object from the blockmap, making it intangible. Just like MF_NOSECTOR though, don't change this flag during runtime - use MF_NOCLIP instead. |
| 32 | 0x00000020 |
MF_AMBUSH | This flag is used for various purposes, usually to signify an alternate type of behavior for an Object. Its effect depends on the Object's other flags and the actions being used. Checking the Ambush flag on a Thing will usually activate this flag for the corresponding Object. |
| 64 | 0x00000040 |
MF_PUSHABLE | The Object can be pushed around, stood upon, and will crush players should it fall on them. It can also activate Trigger Linedef Executor (Pushable Objects). The Object's ActiveSound will be played when the Object is pushed. MF_SOLID has to be checked for this to work. |
| 128 | 0x00000080 |
MF_BOSS | The Object is a boss and will use a boss thinker. See Custom Boss Tutorial for further details. |
| 256 | 0x00000100 |
MF_SPAWNCEILING | The Object spawns on the ceiling rather than the floor. |
| 512 | 0x00000200 |
MF_NOGRAVITY | The Object is unaffected by gravity and will keep its height unless moved by something else. |
| 1024 | 0x00000400 |
MF_AMBIENT | The Object is an ambient sound effect. The Object's SeeSound is constantly played. SpawnHealth sets the interval between each time SeeSound is played. |
| 2048 | 0x00000800 |
MF_SLIDEME | The Object will slide along walls when touching them instead of turning around. |
| 4096 | 0x00001000 |
MF_NOCLIP | The Object is intangible and will go through walls and other Objects. When NOCLIP is turned on, the player will be given this flag. |
| 8192 | 0x00002000 |
MF_SPECIALFLAGS | This flag is used internally to prevent the Star Post from adhering to regular flag/Z offset properties in Objectplace mode. It has no effect for custom Objects. |
| 16384 | 0x00004000 |
MF_FLOAT | The Object (most likely to be an enemy) can change its height in midair. MF_NOGRAVITY has to be checked for this to work. |
| 32768 | 0x00008000 |
MF_BOXICON | The Object is a monitor icon and will float upwards upon being spawned. Damage sets how high the Object will rise before disappearing, and Speed sets how fast it will rise. |
| 65536 | 0x00010000 |
MF_MISSILE | The Object is a projectile of some sort. While moving, it will have no friction, go into its DeathState on collision with anything other than its target, and damage anything other than its target. It will play its SeeSound upon being fired, and its DeathSound upon colliding with something. |
| 131072 | 0x00020000 |
MF_SPRING | The Object is a spring and will be treated as such when touched. See the Spring article for further details. |
| 262144 | 0x00040000 |
MF_BOUNCE | The Object will bounce off walls and other Objects, playing its ActiveSound whenever this happens. |
| 524288 | 0x00080000 |
MF_HIRES | The Object uses a high-resolution sprite. For Character WADs, setting highres to 1 will give the player this flag. |
| 1048576 | 0x00100000 |
MF_MONITOR | The Object is a monitor; it will be popped when hit by a normal attack from the player and award a power. If the Object falls on a player, the player will be crushed and die. |
| 2097152 | 0x00200000 |
MF_NOTHINK | The Object has no AI. Use this to save CPU power for static scenery Objects. |
| 4194304 | 0x00400000 |
MF_FIRE | The Object is flaming; it will hurt players without an Elemental Shield and vanish when it touches water. |
| 8388608 | 0x00800000 |
MF_NOCLIPHEIGHT | The Object is not restricted to the top and bottom heights of the sector it is in, and can go into the floor or ceiling. The SOC editor incorrectly lists this as MF_COUNTITEM. Objects with the MF_MISSILE flag use this for a different purpose: When a missile explodes, this flag is set to indicate that is has exploded and prevent it from exploding again. |
| 16777216 | 0x01000000 |
MF_ENEMY | The Object is an enemy; it can hurt the player, can be killed by various means, and gives the player who killed it 100 points. |
| 33554432 | 0x02000000 |
MF_SCENERY | The Object is scenery and uses a reduced thinker for scenery items. It can't do anything, but it takes up less CPU power than a regular Object. |
| 67108864 | 0x04000000 |
MF_TRANSLATION | The Object is drawn with interchangeable colors that can be modified during runtime. One example of this are the team rings, whose sprites have a green placeholder color and whose actual color is determined in-game, depending on which team they belong to. The SOC editor does not list this flag. |
| 1073741824 | 0x40000000 |
MF_NOCLIPTHING | The Object is partially intangible, it will pass through other Objects, but not walls. This is used for the animals that are released from destroyed enemies, for example. |
| 2147483648 | 0x80000000 |
MF_RUNSPAWNFUNC | Normally a Object cannot perform actions during its SpawnState, this flag makes it able to. The SOC editor does not list this flag, and will crash if an Object with this flag is viewed. |
Object Flags 2
| Decimal | Hexadecimal | Flag Name | Description |
|---|---|---|---|
| 1 | 0x00000001 |
MF2_PUSHED | A temporary flag that is set by various pusher functions to indicate that the Object was already pushed and shouldn't be pushed again during this tic. It is automatically reset at the start of each tic. |
| 2 | 0x00000002 |
MF2_AXIS | This flag is automatically set for the NiGHTS Axis, Axis Transfer and Axis Transfer Line. It is used internally to make it more convenient to check if an Object is one of those three. |
| 4 | 0x00000004 |
MF2_DONTRESPAWN | The Object does not respawn. Given to any items dropped by players who have been hit. |
| 8 | 0x00000008 |
MF2_RINGORHOOP | This flag is unused. |
| 16 | 0x00000010 |
MF2_FRET | This flag is used to signify that a boss has been hit by the player. Among other things, it makes the boss's sprites flash white and makes it temporarily immune to the player. |
| 32 | 0x00000020 |
MF2_INFLOAT | If an Object has the MF_FLOAT flag set, it automatically floats at the height of its target. If it shouldn't do that, this flag is used. |
| 64 | 0x00000040 |
MF2_DEBRIS | Exploded Explosion Rings and Grenade Rings are given this flag to signify that they have already exploded. |
| 128 | 0x00000080 |
MF2_TWOD | This flag is given to Objects if they are in 2D Mode or are supposed to behave as such. |
| 256 | 0x00000100 |
MF2_NIGHTSPULL | This flag is used for the item attraction in NiGHTS Mode. Rings, Coins and Wing Logos that are inside the player's attraction radius are given this flag. |
| 512 | 0x00000200 |
MF2_JUSTATTACKED | The Object has just attacked, and cannot attack again immediately. Objects using A_Chase and A_SkimChase, or Objects with MF_BOSS, add this flag when they first attack - when they try to attack again, this flag is removed instead of attacking, and then the process repeats again once they are ready to attack again. CTF flags have this flag set when they are outside their respective bases. |
| 1024 | 0x00000400 |
MF2_FIRING | This flag is used signify that an Object is currently firing some type of projectile. Used by the Turret and the Flame Jets. A_TurretFire and A_SuperTurretFire add this flag to the Object, A_TurretStop removes it, whilst A_ToggleFlameJet can do either depending on whether the flag is already set or not. |
| 2048 | 0x00000800 |
MF2_ONMOBJ | The Object is resting on top of another Object. |
| 4096 | 0x00001000 |
MF2_SKULLFLY | This flag is set by the action A_SkullAttack to signify that the Object is currently flying at the player. If the Object is the Egg Mobile or a custom Object with MF_BOSS, ghost trails of the Object will be spawned while this flag is set. |
| 8192 | 0x00002000 |
MF2_CHAOSBOSS | This flag was used to separate bosses that are spawned in Chaos mode from regular bosses, to make sure that defeating a Chaos boss doesn't end the level. |
| 16384 | 0x00004000 |
MF2_BOSSNOTRAP | This flag is given to bosses whose map Things have the Object Special flag checked. If the flag is set and A_BossDeath is called, no Egg Trap Capsule will appear and the level will end instead. Also used as a dummy flag to mark popped monitors. |
| 32768 | 0x00008000 |
MF2_BOSSFLEE | This flag is given to bosses who are fleeing to control their movement. |
| 65536 | 0x00010000 |
MF2_AUTOMATIC | This flag is given to thrown Automatic Rings to identify them as such. |
| 131072 | 0x00020000 |
MF2_RAILRING | This flag is given to thrown Rail Rings to identify them as such. |
| 262144 | 0x00040000 |
MF2_BOUNCERING | This flag is given to thrown Bounce Rings to identify them as such. |
| 524288 | 0x00080000 |
MF2_EXPLOSION | This flag is given to thrown Explosion Rings to identify them as such. |
| 1048576 | 0x00100000 |
MF2_SCATTER | This flag is given to thrown Scatter Rings to identify them as such. |
| 2097152 | 0x00200000 |
MF2_GRENADE | This flag is given to thrown Grenade Rings to identify them as such. |
| 4194304 | 0x00400000 |
MF2_DONTDRAW | The Object does not generate a visible sprite. |
| 8388608 | 0x00800000 |
MF2_SLIDEPUSH | The Object slides after being pushed. MF_SOLID and MF_PUSHABLE have to be checked for this to work. The maximum speed at which an Object with this flag can slide is set by its Speed value. |
| 16777216 | 0x01000000 |
MF2_SHADOW | The Object is drawn fuzzy, which makes targeting harder. Set by the Force Shield when it has only one health point left. Also used to make the player translucent when the camera is too close in Single Player. |
| 33554432 | 0x02000000 |
MF2_STANDONME | The Object can be stood on even if it doesn't have the MF_PUSHABLE flag set. MF_SOLID has to be checked for this to work. |
| 67108864 | 0x04000000 |
MF2_SUPERFIRE | This flag is given to projectiles that can stop Super Sonic as well as the Objects that fire them. |
| 134217728 | 0x08000000 |
MF2_CLASSICPUSH | If the Object is falling, it will stop all horizontal movement and drop straight down. This flag is given to pushables whose map Things have both the Object Special and Ambush flag checked. |
| 268435456 | 0x10000000 |
MF2_STRONGBOX | This flag is given to Strong Random Monitors to identify them as such. |
| 536870912 | 0x20000000 |
MF2_REFLECTED | This flag is given to weapons that were reflected by the Force Shield. |
| 1073741824 | 0x40000000 |
MF2_OBJECTFLIP | This flag is given to Objects whose gravity is permanently flipped. |