ZScript spawn flags

From ZDoom Wiki
Jump to navigation Jump to search
Note: This feature is for ZScript only.


In addition to actor flags, ZScript also allows you to access and modify the flags that define an actors' spawning and origin. These flags control behavior such as if an actor is spawned as FRIENDLY by the map. A lot of these flags are handled by the HandleSpawnFlags() function.

Flags

The flag enums are defined in the EMapThingFlags enum and stored in every actors' SpawnFlags field.

Note: The spawn filter flags can be used in conjunction with each other, for example a map thing marked with MTF_COOPERATIVE and MTF_DEATHMATCH will simply be an actor that doesn't spawn in singleplayer.


  • MTF_AMBUSH
The actor is spawned with the AMBUSH flag, for monsters, this will means that they will ignore player and other monster sounds and only attack when their enemy is in sight.
  • MTF_DORMANT
The actor is spawned as DORMANT (Inert), meaning it will not do anything until reactivated.
  • MTF_SINGLE
The actor only spawns in Singleplayer games.
  • MTF_COOPERATIVE
The actor only spawns in co-op games.
  • MTF_DEATHMATCH
The actor only spawns in deathmatch games (Solo or team based).
  • MTF_SHADOW
The actor spawns as a shadow (Given the SHADOW flag, made STYLE_TRANSLUCENT, and set to an alpha of 0.25).
  • MTF_ALTSHADOW
The actor spawns with no renderstyle, being completely invisible visually, this however doesn't mean that they can't be seen by monsters.
  • MTF_FRIENDLY
The actor spawns as FRIENDLY to the player.
  • MTF_STANDSTILL
The actor spawns with the STANDSTILL flag.
  • MTF_STRIFESOMETHING
Does nothing.
  • MTF_SECRET
The actor spawns with the COUNTSECRET flag and is added to the levels' secret count.
  • MTF_NOINFIGHTING
The actor spawns with the NOINFIGHTING flag. (development version 2863717 only)
  • MTF_NOCOUNT
The actor spawns without counting to the kill or item percentage on the map.
Marks the actor as having been spawned by the level itself.
Marks the actor as having been spawned through the console (Primarily the summon CCMD).
Special flag that includes both MTF_MAPTHING and MTF_CONSOLETHING. This flag can be used to indicate that the actor wasn't spawned by either the map or the console, and so most likely spawned by a script like ZScript code or an ACS script. Like this:
if (!(SpawnFlags & MTF_NONSPAWNTHING)) //Spawned from ZScript or ACS code.