squadmaker

Modified

12-Jul-2023

A point entity which allows you to spawn any amount of a specific monster type. This can also be used to spawn other entities as well, though only partially supported. It can be toggled on and off or spawn one monster every time it is triggered and allows many options to be set for the spawned monster(s). You must specify monster type, otherwise it will crash the game with "Spawned a NULL entity!" error message.

Keyvalues


OnDestroy Function ondestroyfn : Name of the function to use from already parsed .as script files when entity is destroyed (killed) in any way. If the function belongs to namespace, you must use prefix with the namespace name (e.g. mynamespace::MyFunction) for the keyvalue.

Name targetname : Set name of squadmaker so other entities can trigger it to spawn monsters. With 'Cyclic' flag disabled the behaviour is based on trigger use-type: 'On'- turn spawner on, 'Off'- turn spawner off, 'Toggle'- toggle spawner. With 'Cyclic' flag enabled every trigger use-type works uniformly to spawn a single monster. Can be kill-targeted but monsters already spawned are not removed.

Pitch Yaw Roll (X Y Z) angles : Where Z means Y and Y means Z, that is, when you're thinking Hammer-grid. (Hammer uses Z for height and Y for depth, while every other sane 3D-application does this the other way round; nonetheless this keyvalue description has the letters in the conventional order) This, technically, is a 3D-vector containing Euler-angles to describe either the entity's rotation or direction of effect. E.g. a func_door_rotating will use this as its initial rotation, while a trigger_push will keep its original alignment and use this for the direction of its push-effect instead. Euler-angles are a hierarchical system to determine an object's orientation in 3D-space. A yaw-value of 0 would mean the entity would face east. (right in top-down view) 90 would mean it would face north. (up in top-down-view) After yaw, pitch is applied. Think aiming up/down with your character in first person. At last, the roll-value is applied. Think your character falling over sideways in first person. Some entities, mostly point entities, do not use the angles keyvalue for any purpose.

Render FX renderfx : Set custom render FX effect. Only works when "Render Mode" is set to different than 'Normal'

  • 0 : Normal : Default rendering.
  • 1 : Slow Pulse : Transparency slow fading in and out in a loop.
  • 2 : Fast Pulse : Transparency fast fading in and out in a loop.
  • 3 : Slow Wide Pulse : Transparency slow fading in and out widely in a loop.
  • 4 : Fast Wide Pulse : Transparency fast fading in and out widely in a loop.
  • 9 : Slow Strobe : Regular slow appearing/dissapearing.
  • 10 : Fast Strobe : Regular fast appearing/dissapearing.
  • 11 : Faster Strobe : Regular very fast appearing/dissapearing.
  • 12 : Slow Flicker : Random slow appearing/dissapearing.
  • 13 : Fast Flicker : Random fast appearing/dissapearing.
  • 5 : Slow Fade Away : Not working. Fading out slowly until reaching invisibility. Works once when entity spawns or have changed it's "Render FX" at a runtime (e.g. through env_render). Requires high "FX Amount"
  • 6 : Fast Fade Away : Not working. Fading out quickly until reaching invisibility. Works once when entity spawns or have changed it's "Render FX" at a runtime (e.g. through env_render). Requires high "FX Amount"
  • 7 : Slow Become Solid : Not working. Fading in slowly from invisible to fully visible. Works once when entity spawns or have changed it's "Render FX" at a runtime (e.g. through env_render). Requires low or zero "FX Amount"
  • 8 : Fast Become Solid : Not working. Fading in quickly from invisible to fully visible. Works once when entity spawns or have changed it's "Render FX" at a runtime (e.g. through env_render). Requires low or zero "FX Amount"
  • 14 : Constant Glow : Sprites with 'Glow' render mode only. Disables sprite resizing.
  • 15 : Distort : Random distortion, looped.
  • 16 : Hologram (Distort + fade) : 'Random distortion' + 'Pulse' applied, looped.
  • 17 : Dead Player (DONT USE!)
  • 18 : Explode (Garg Like)
  • 19 : Glow Shell : Applies nice animated glowing shell on model. Color can be applied. "FX Amount" manipulates glow shell size.
  • 20 : ClampMinScale (Sprites)

Render Mode rendermode : Render mode determines how this entity is rendered.

  • 0 : Normal : Normal rendering. Entity will receive light, except if it is a sprite. "FX Amount" is obsolete when this is used.
  • 1 : Color : Brush entities only: Instead of rendering the texture, the whole entity will appear in one color, set by "FX Color". "FX Amount" sets the transparency. 0 means invisible. 255 means fully opaque.
  • 2 : Texture : Texture-only rendering. Entity will not receive light. Instead, only the texture will be rendered as is. "FX Amount" sets the transparency. 0 means invisible. 255 means fully opaque. This is used for transparent things such as windows. Tip: If you have a window separating a dark and a bright room using only one entity, you can apply a brighter glass texture to the side of the window seen from within the dark room than to the side seen from the bright room. That way, the window's brightness will look realistic from both sides, instead of from just one. Generally, darker rooms require the render amount to be lower, making the glass more transparent, or it would look illogically bright.
  • 3 : Glow : Sprites only. The sprite will appear in the same size regardless of your distance to it. In addition to that, the further away you are from it, the less visible it will be. (It's only barely visible at about 500 units far away) Good for light coronas. This renders the sprite in additive mode.
  • 4 : Solid : Brush entities only. All textures of the brush entity starting with '{' will have the last color of their palette (usually blue, black or purple) be rendered fully transparent. This is used for textures with see-through parts, such as grates and railings. Requires "FX Amount" to be set to a value greater than 0, commonly 255.
  • 5 : Additive : Works just as the "Render Mode" 'Texture', except that the entity's appearance will be added to the background instead of forming a mean. This means, black pixels of textures will be fully transparent, while full-bright pixels are added with a factor of "FX Amount" divided by 255. This is often used for sprites indicating a glowing light, as well as for overlay func_illusionaries to give a computer texture the appearance of having many small, glowing lights, screens and whatever other elements. Render-amount of 255 makes it bright. 0 makes it invisible.

FX Amount (1 - 255) renderamt : Render amount to use when other than "Render Mode" 'Normal' is used.

FX Color (R G B) rendercolor : Used with "Render Mode" 'Color' and 'Glow' to set color. Also sets color of 'Glow Shell' "Render Mode".

Classification classify : Set the class of the spawned squadmaker. Think of how even though zombies and human grunts, by default, both are the players' enemies, yet have a dislike for and attack each other as well. This relation is created through the respective classes of the two entity types. For a complete table of how different classes react to each other, see monster class relation table.

  • -1 : None
  • 0 : Object Default : Keep default classification.
  • 1 : Machine
  • 2 : Player
  • 3 : Human Passive
  • 4 : Human Military
  • 5 : Alien Military
  • 6 : Alien Passive
  • 7 : Alien Monster
  • 8 : Alien Prey
  • 9 : Alien Predator
  • 10 : Insect
  • 11 : Player Ally
  • 12 : Player Hornet/Snark
  • 13 : Alien Hornet/Snark
  • 14 : X-Race
  • 15 : X-Race: Shocktrooper/Voltigore
  • 16 : Team 1 : Use it to classify to custom team.
  • 17 : Team 2 : Use it to classify to custom team.
  • 18 : Team 3 : Use it to classify to custom team.
  • 19 : Team 4 : Use it to classify to custom team.

Is not revivable is_not_revivable : If set to 'Yes', the monster cannot be revived by player's weapon_medkit or other allied monsters.

  • 0 : No
  • 1 : Yes

Target On Release target : Entity to trigger whenever a monster is spawned. Trigger use-type is 'Toggle'.

Monster Type monstertype : Set the classname of the monster, weapon, item, ammunition or whatever else may be spawned by squadmaker without working incorrectly here. You must specify monster type, otherwise it will crash the game with "Spawned a NULL entity!" error message.

Childrens' Name netname : If set, everything that is spawned by this squadmaker will receive this as it's targetname.

Monster count monstercount : Total amount of monsters which can be spawned by this squadmaker. If this value runs, the squadmaker won't spawn anything anymore. Setting this to '-1' means an endless supply.

Delay between spawns delay : Delay, in seconds, between spawns.

Max live children m_imaxlivechildren : Maximum amount of spawns by this squadmaker which may exist at a time. Note that for monsters, they will be counted as a live child till their corpse has faded out.

Blocked Spawn Handling spawn_mode : Determines how monster spawn is handled when there is no room for monster to spawn.

  • 0 : Legacy, no special handling : The next monster will spawn as soon as the delay between spawns is over and the spawn area is free.
  • 1 : Block, spawn as soon as clear : Ignore the delay between spawns and spawn as soon as the spawn area is clear. Not recommendable for spawning multiple monsters.
  • 2 : Force spawn, never block : Causes a monster to spawn every instant the delay between spawns is over, ignoring whether the spawn area is free or not. If "Cyclic" is selected, this will be used as well.

Amount of Telefrag Damage dmg : Amount of damage to apply to entities that are blocking this spawner. If the entity dies by this a new monster is spawned.

TriggerTarget trigger_target : Entity to trigger when condition in "Trigger Condition" is met. Trigger use-type is 'Toggle'.

Trigger Condition trigger_condition : Choose trigger condition for spawned monster. When condition is met, the entity specified in "TriggerTarget" is triggered.

  • 0 : No Trigger
  • 1 : See Player, Mad at Player : When enemy player is seen by monster, or player became an enemy of this monster.
  • 2 : Take Damage : When damage is taken, no matter if it's ally, enemy or trigger.
  • 3 : 50% Health Remaining : When monster health drops to 50% or below.
  • 4 : Death : When monster dies.
  • 7 : Hear World : When monster hear environmental sounds like door opening/closing or glass breaking.
  • 8 : Hear Player : When monster hear a player for the first time, his footsteps or weapons. Note that crouching makes player harder to hear, just like some quieter weapons are harder to heard by monsters. Allies might ignore hearing player when they are moving behind monster's back, but still this trigger will fire when monster saw player.
  • 9 : Hear Combat : When monster hear combat sounds like weapon shooting or explosions.
  • 10 : See Player Unconditional : When monster see a player for the first time.
  • 11 : See Player, Not In Combat : When monster see a player for the first time, but it's not in combat of any kind. When player attack a monster before monster even saw him, the trigger will fire.

Body (-1 off) new_body : This will set which body to use. Body's are different submodels/appearances in model files. Think of the different scientists. Not all models do have multiple body's. '-1' means random.

Is Player Ally respawn_as_playerally : Set whether the spawned monster is an ally or a foe of the players. Note that keyvalue name is misleading.

  • 0 : Default (0) : Keep game defaults.
  • 1 : Opposite (1) : Invert relationship, e.g. monster_barney becomes enemy because he is friendly by default; monster_zombie becomes friendly because he is an enemy by default e.t.c.

Override Render Mode change_rendermode : If set to 'Yes', the rendermode of the spawned entity will be changed to the one set in this squadmaker.

  • 0 : No
  • 1 : Yes

Xenmaker Template Name xenmaker : If you set the name of an env_xenmaker here, its effects will appear every time the squadmaker spawns something.

Not Solid notsolid : Set whether the spawned monsters will appear solid to each other and the players or not.

  • -1 : Default
  • 0 : No
  • 1 : Yes

Gag gag : Allows you to mute the spawned monsters.

  • -1 : Default
  • 0 : No
  • 1 : Yes

Weapons (Grunt/Massn/etc) weapons : You can choose which weapon the monster uses (HG = Hand Grenade, GL= M16 Grenade Launcher e.t.c.). Remember that monster must support chosen weapon.

  • 0 : Default / No setting
  • 1 : MP5
  • 3 : MP5 + HG
  • 5 : M16 + GL
  • 8 : Shotgun / Sniper Rifle
  • 10 : Shotgun / Sniper Rifle + HG
  • 16 : SAW (human_grunt_ally only!)
  • 32 : No Weapons (male_assassin only!)
  • 64 : Rocket Launcher
  • 66 : Rocket Launcher + HG
  • 128 : Sniper Rifle (human_grunt only!)
  • 130 : Sniper Rifle + HG (human_grunt only!)
  • 256 : Don't drop weapon (HWG etc)

Squad Name squadname : Name of a squad for this monster to be part of. Monsters which share the same squadname/are in the same squad, will attempt to stay together and follow their squad's leader (monster with "SquadLeader" set to 'Yes').

Squad Leader is_squad_leader : Set whether the spawned monsters will be leaders of their squad or not.

  • 0 : No
  • 1 : Yes

In-game Name displayname : If set, this will overwrite the monster's default in-game name, which appears in the HUD monsterinfo, which can be enabled/disabled using the CVar 'mp_allowmonsterinfo'. You can use '\n' here to perform a line-break.

Blood Color bloodcolor : Allows you to customize the monster's blood color (or disable it).

  • 0 : Monster Default
  • -1 : No Blood
  • 1 : Red
  • 2 : Yellow

Custom Health health : If set, this will overwrite the monster's default health value managed by the skill configuration.

Custom Model new_model : If set, this will overwrite the monster's default model. This needs to be precached using a custom_precache point entity.

Custom Min Hull Size (X Y Z) minhullsize : If set, this will overwrite the monster's default minimum hullsize. Minimum and maximum hullsize form a solid cuboid which define the monster's collision hull. Think of them as two span-vectors originating from the monster's origin.

Custom Max Hull Size (X Y Z) maxhullsize : If set, this will overwrite the monster's default maximum hullsize. Minimum and maximum hullsize form a solid cuboid which define the monster's collision hull. Think of them as two span-vectors originating from the monster's origin.

Sound Replacement File soundlist : Allows you to setup a sound replacement file for the squadmaker sounds. The path begins in 'svencoop/sound/mapname', whereas 'mapname' would be your map's name. You can go to the parent directory using '../'. A valid sound replacement file contains one or more lines with two sound-paths, which are separated by a space and wrapped into quotes. The first sound is the sound to be replaced. The second sound is the new sound. Sound-paths start in the sound directory. You cannot go to the parent directory using '../' in that case. These sounds do not need to be precached using a custom_precache point entity.

Monster Roaming (nodes) freeroam : Set whether monsters spawned by this squadmaker use nodes to free roam and find their way or don't use nodes at all.

  • 0 : Map Default : Keep game defaults.
  • 1 : Never : Disable nodes roaming.
  • 2 : Always : Enable nodes roaming.

Path Name path_name : Name of the optional path_waypoint to go to.

Entity to Guard guard_ent : If set, the monster will try to follow and protect (attack its attackers) the given entity.

V_model (Weapons Only) wpn_v_model : If spawning a weapon, this will replace its view model (the weapon as seen in first person view).

W_model (Weapons Only) wpn_w_model : If spawning a weapon, this will replace its world model (the weapon as seen when lying somewhere).

P_model (Weapons Only) wpn_p_model : If spawning a weapon, this will replace its player model (the model as seen held by other players).

Angelscript function name function_name : Name of the function to use from already parsed .as script files. If the function belongs to namespace, you must use prefix with the namespace name (e.g. mynamespace::MyFunction) for the keyvalue.

Flags


  • 1 : Start ON : The squadmaker will start on and start spawning as soon as the map loads.

  • 4 : Cyclic : Changes the squadmaker toggle-behaviour to a single-fire-behaviour. With this flag set, the entity will spawn one time every time it is fired.

  • 8 : MonsterClip : Monsters spawned by a squadmaker with this flag set will be blocked by the func_monsterclip brush entity.

  • 16 : Prisoner : Causes the spawned monster to be an enemy regardless of the ally setting, but it won't attack or harm you in any way.

  • 32 : Auto Size BBox : When trying to spawn something, the squadmaker checks whether the spawn area is free or not. If it is not free, it won't spawn. By default, the checked area is way larger than the average monster. Checking this flag will resize the checked area depending on what you set the squadmaker to spawn. Setting this flag is highly recommended.

  • 64 : Cyclic Backlog : When "Cyclic" flag is selected this will keep track of that and spawn the monster as soon as the spawn is free. This works for multiple monsters and makes a sort of spawn queue. This is useful when a game_counter of yours is triggered by monster death events and thus expects a minimum amount of monsters to be spawned, so the trigger can ever fire.

  • 128 : WaitForScript : If set, a spawned monster won't react to anything after being spawned until it enters a scripted sequence.

  • 1024 : No Respawn (Collectible) : If the spawned entity is a weapon, an item or ammunition, it won't respawn after being collected when this flag is set.

  • 2048 : Not in Deathmatch : Obsolete in Sven Co-op. Makes the entity don't appear in Multiplayer Games.

You must specify monster type, otherwise it will crash the game with "Spawned a NULL entity!" error message.

Not Solid key does not work.