Skip to content

L4D2 spawning mechanics

brxce edited this page Feb 3, 2021 · 5 revisions

Spawning with coordinates

  • Uses L4DHooks
    • // Attempts to find a random valid position to spawn a Special Infected native bool L4D_GetRandomPZSpawnPosition(int client, int zombieClass, int attempts, float vecPos[3]);
    • // Given a vector position, returns the relative NavArea. native int L4D_GetNearestNavArea(const float vecPos[3]);
    • // Given a nav area value, returns a randomly selected position for spawning. native void L4D_FindRandomSpot(int NavArea, float vecPos[3]);
    • // L4D2 only. Checks if a world position is accessible to a player. native bool L4D2_IsReachable(int client, const float vecPos[3]);
    • // Spawns a Special Infected native int L4D2_SpawnSpecial(int zombieClass, const float vecPos[3], const float vecAng[3]);
      • when this is called on invalid locations (no navmesh, sky), this function will eventually brick, and the spawned SI will not be seen, although at times heard
Clone this wiki locally