Left 4 Dead 2/Scripting/Script Functions/ZSpawn: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(→‎Returns: Added spawning bug)
Line 22: Line 22:


''bool'' - Whether the zombie spawned successfully.
''bool'' - Whether the zombie spawned successfully.
{{bug|The function will fail to spawn the zombie if not all players have fully loaded.|only=l4d2}}


== Input Parameters ==
== Input Parameters ==

Revision as of 10:26, 27 August 2023

Function Description

bool ZSpawn(table spawnTable)

Spawns a zombie. This is essentially the z_spawn console command, except (a) you pass a table and (b) no raycast, you give it the position vector.


Parameters

Type Name Description
table spawnTable Table used for spawn parameters.


Returns

bool - Whether the zombie spawned successfully.

Icon-Bug.pngBug:The function will fail to spawn the zombie if not all players have fully loaded.  [todo tested in ?]

Input Parameters

Passed to spawnTable to set up the spawn parameters.

Type Name Description
int type Zombie type enumeration. ZOMBIE_WITCH, etc - or the special ZSPAWN_MOB, or WITCHBRIDE, etc.
Vector pos Vector position at which to spawn, optional (defaults to automatically spawn somewhere in the world).
QAngle ang Angle for spawn, optional (defaults to 0,0,0).

Zombie types

ZOMBIE_SMOKER = 1
ZOMBIE_BOOMER = 2
ZOMBIE_HUNTER = 3
ZOMBIE_SPITTER = 4
ZOMBIE_JOCKEY = 5
ZOMBIE_CHARGER = 6
ZOMBIE_WITCH = 7
ZOMBIE_TANK = 8
ZSPAWN_WITCHBRIDE = 11