Monster spawners

Monster spawners

Classnames: func_monsterspawner
func_monsterspawner_mp (PoP)
Purpose: Nasty surprises.
H2 Code: ai.hc
fields required: origin, spawnflags
Spawns a monster when triggered. The monster can be spawned either at the monsterspawner itself, or at a func_monsterspawn_spot entity sharing the same spawnername, although this will crash the game without proper use of the cnt field. With spawn spots, the monster generation will cycle between them in the order of their aflag fields until the cnt value is reached.

For the Portal of Praevus mission pack, the same functionality is provided by func_monsterspawn_mp and func_monsterspawn_spot_mp, but with different monsters.

I'm not sure if my explanatory powers are at an especially low ebb this week, or these entities are especially complicated, but these attempted explanations seem unusually convoluted and confusing, even to me. And I suspect these entities might be worth some more coding effort, for example to spawn monsters who were awake and would head off to some path corner upon spawning.

Fields

origin Value is a triple of numbers, location of item. Your editor should manage this visually, automatically.
targetname Value is a name, targetted by some trigger. If it is specified, the first monster will spawn when triggered, otherwise when the level starts.
spawnername Value is a name, shared by associated func_monsterspawn_spot(_mp)s. The game will crash if you use this field without the spawn spots (and you should also have a cnt field).
cnt Value is a number, number of monsters produced, default = 17. For a cnt-value other than 1 to be useful, either the ONDEATH or TRIGGERONLY spawnflag should be set, otherwise the monsters will spawn out in succession, each telefragging the previous one (unless some kind of special machinery is set up to shift them out of each other's way).

If func_monsterspawn_spot(_mp)s are used, a cnt value should be set on the func_monsterspawner(_mp), otherwise the game will crash, unless the spawnspots themselves all have a cnt field, in which case the game will crash when a monster tries to be spawned at a spot whose cnt-value is used up. Hey, that's pretty complicated! Better to just keep things simple and put cnt on the monsterspawner itself!

wait Value is a number, time before next monster is spawned. Doesn't seem to interact well with the TRIGGERONLY spawnflag: when this is set, wait doesn't work and seems to inhibit multiple spawning.
angle Value is a number, direction monster faces when spawned. Used in maps for spawnspots as well, but doesn't seem to actually work for them.
spawnflags For func_monsterspawner:
  • 1 - IMP : an ice and fire imp will alternately be spawned
  • 2 - ARCHER : an archer will be spawned
  • 4 - WIZARD : a wizard will be spawnwed
  • 8 - SCORPION : a yellow and black scorpion will alternately be spawned
  • 16 - SPIDER : a red and yellow spider will alternately be spawned
  • 32 - ONDEATH : next monster will not spawn until the previous one dies. `Not recommended if spawner spots are used', but these don't seem to work anyway.
  • 64 - QUIET : no spawning sound will be produced during spawning
  • 128 - TRIGGERONLY : Will only spawn a monster when the spawnwer is used by a trigger. The default is continous spawning. If this and ONDEATH are both checked, next monster won't spawn until current is dead and the trigger fires agtain.
For func_monsterspawner_mp (PoP Mission Pack):
  • 1 - ICE_ARCHER
  • 2 - ICE_IMP
  • 4 - SNOW_LEOPARD
  • 8 - WERETIGER
  • 16 - YAKMAN
  • 32 - ONDEATH
  • 64 - QUIET
  • 128 - TRIGGERONLY


Back to the list.