func_spawner
LevelEditor Info:
Usage: Spawns specified entities. Target any number of target_nulls as possible spawn locations.
def_spawn: Set to the classname of the entity to be spawned (for example, 'def_spawn_1' 'monster_berserker'). Increment in the form def_spawn_X to spawn multiple types of entities from a single spawner.
count: Number of entities to spawn before being used up. Defaults to -1 (spawn infinitely).
max_active: If there are more than this number of entities from this spawner active, spawning will pause. Defaults to 4.
delay: Time between spawning. Defaults to 2.
auto_target: If set to 1, spawned enemies will automatically target their nearest foe. Defaults to 1.
face_enemy: If set to 1, spawned enemies will be facing their enemy when they spawn. Defaults to 0.
call: Script function to be called at the time of spawn. The entity parameter will be the spawner itself.
call_spawned: Script function to be called at the time of spawn. The entity parameter will be the spawned entity.
script_used_up: Script function to be called when the spawner has exhausted its available enemies.
skipVisible: If set to 1, spawn targets will be skipped if the player can see them (in PVS). Defaults to 1.
trigger_only If set to 1 the spawner will only spawn when triggered. Each trigger will spawn 1 enemy.
waves: Number of enemies to spawn simultaneously. Defaults to 1.
remove: If set to 1 the spawner will be removed when triggered off. Defaults to 1.
target def_spawn: Set this on the spawn target to override the spawn type of the spawner for the spawn target. Ex: Targets set to "def_spawn" "monster_grunt" will only spawn Grunts.
target remove: If set on a spawn target, target will be removed after it has been used. Defaults to 0.
Additional Information:
- All keys prefixed with 'spawn_' will be copied over directly without the spawn_ to newly created enemies. spawn_target, for example, will set the spawned entity's target.
- Any fields on the target_nulls prefixed with 'spawn_' will also be copied over.
Entering an entity more than once in def_spawn fields will 'weight' spawning in favor of that entity. For example if monster_berserker is listed as def_spawn_1 and def_spawn_2, and monster_strogg_marine is listed as def_spawn_3, the monster_berserker has a 66% chance of spawning, while the monster_strogg_marine only has a 33% chance to spawn.
- When skipVisible is set to 1, target_nulls whose origins lie flat on the floor may register as out of the PVS even when right in front of the player, resulting in monsters spawning in view. Consider nudging these spawns 1-2 units off the floor.
Manually placed monster Entities can be targeted from a func_spawner to be included in the max_active count. Ex: Targetting a monster_gunner from a spawner with 'max_active' '3' will only spawn up to 2 enemies until the Gunner is dead.
Back to Entities.