Left 4 Dead 2

Left 4 Dead 2

Speedrunner Tools
This topic has been locked
シェイディ♑  [developer] 21 Jun, 2017 @ 10:21am
Speedrunner Tools API
Note: this page is no longer updated. Read the new one list there https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1455798758
Below is the custom functions of the Speedrunner Tools.

TeleportEntity
Sets the world entity position, orientation and speed. Use "null" if you want to keep current vector without changes.

void TeleportEntity(CBaseEntity entity, Vector origin, Vector angles, Vector velocity)
TeleportEntity(Ent("!player"), Vector(0, 0, 0), Vector(0, 0, 0));

SpawnItem
Returns CBaseEntity. Function for entity spawning. To spawn easier, it can be used with "!picker" command. Keywords: "item0", "item1" etc. List of items: https://pastebin.com/iiE1spgt

handle SpawnItem(string itemName, Vector origin, Vector angles, int itemCount, string targetName)
SpawnItem("item0", Vector(0, 0, 0));

RemoveItem
Returns the number of removed items. Set the item name to remove. Note that function removes all items this class. Keywords: "item0", "item1" etc. List of items: https://pastebin.com/iiE1spgt

int RemoveItem(string itemName)
RemoveItem("item0");

RemoveItemEx
Removes items at specific area.

int RemoveItemEx(Vector origin, float radius)
RemoveItemEx(Vector(0, 0, 0), 100.0);

SpawnZombie
Function for zombie spawning. Also, you can collect this functions, by typing in chat "!zdump" command – file will be created in "left4dead2/ems/st_configs/zdump.txt". Keywords: "tank", "witch", "hunter" etc.

void SpawnZombie(string zombieName, Vector origin)
SpawnZombie("tank", Vector(0, 0, 0));

SpawnZombieEx
Extended function for zombie spawning, which allows specify certain angles for infecteds (except PZs). For random zombie orientation set "null" in angles parameter. To spawn Uncommon Infected type a zombie model name: "common_male_ceda", "common_male_clown", "common_male_fallen_survivor", "common_male_jimmy", "common_male_mud", "common_male_riot", "common_male_roadcrew" etc. Infected ZOMBIE_TANK can attack on spawn, if 4th parameter is equal true value.

void SpawnZombieEx(string zombieName, Vector origin, Vector angles, bool AttackOnSpawn)
SpawnZombieEx("tank", Vector(0, 0, 0), Vector(0, 0, 0), true);

SpawnTrigger
Returns CBaseEntity. Spawns trigger at specified position. When it's called, the activating and calling entities Script Handles are written to the receiving entitys Script Scope in the "activator" and "caller" variables. By default сallback function is "OnEntityOutput()", spawnflags set to 1, triggered output is "OnStartTouch" and trigger classname is "trigger_multiple".

handle SpawnTrigger(string targetName, Vector origin, Vector maxs, Vector mins, string funcCallback, int spawnflags, string Output, string clsName)
SpawnTrigger("trigger_area", Vector(0, 0, 0));

SpawnZombieForCB
Returns CBaseEntity. Function for spawning common infected for Commonboost trick. To interact, press "MOUSE1" (+attack) key to trigger a mobs, which were spawned by this function. Specify start time or set "null" to create idle zombie. Force a player to trigger a mob immediately after creation. Also, Commonboost can be even easier with this SourceMod plugin: https://forums.alliedmods.net/showthread.php?t=302498

handle SpawnZombieForCB(Vector origin, Vector angles, float startTime, CTerrorPlayer forcePlayer)
SpawnZombieForCB(Vector(0, 0, 0));
Last edited by シェイディ♑; 16 Aug, 2018 @ 11:28pm