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. |
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:
|