L4D2 Director Scripts/AllowFallenSurvivorItem

From Valve Developer Community
Jump to: navigation, search

When its DirectorOptions is loaded, this callback for every spawned item from a Fallen Survivor. Arguments given are strings representing a weapon's classname; returntrueto allow Fallen Survivors to have a chance in equipping the weapon.

With theprintlfunction, the arguments are:


Note.png Note: Despite the name similarity to the AllowWeaponSpawn callback, this callback can only disallow existing Fallen Survivor items, and allowing new weapons will not work, unless a custom system is built and then initiated in this callback function.

Debugging

Not only that Fallen Survivors spawn in certain maps only, likec10m4_mainstreet(Death Toll - Streets) orc6m2_bedlam(The Passing - Bedlam), they also are too rare to reliably debug any code with them on those maps. With these commands, once set up properly can be used to debug Fallen Survivors efficiently:

ConVar/CommandParameters or default valueDescriptorEffect
z_fallen_kill_suppress_time300SecondsWhen a Fallen Survivor is killed, how long in seconds should pass before another can spawn.
z_fallen_max_count1Arbitrary numberHow many Fallen Survivors can be active at once.
z_forcezombiemodel00 disables, 1 enablesDetermines ifz_forcezombiemodelnameis allowed to be used.
z_forcezombiemodelnamecommon_male01Name of a Common's modelWhenz_forcezombiemodelis active, force all Common Infected to use this model. If the model isn't precached, ignore.

Parameters

bool AllowFallenSurvivorItem(string classname)

Type Name Arguments Description
string classname

Name of a weapon's classname; Only 4 are given.

Expected Returns

Type Description
bool Return true to allow the respective weapon from spawning; false or none is otherwise.

Code Samples

Health-pack-alypse Fallens

L4D2DirectorScript Callbacks-Health-pack-alypseFallens.jpg

When ran, Fallen Survivors will sometimes only spawn with a weapon_first_aid_kit equipped, and never spawn equipped with any other gear.