Skip to main content

spawnSingleAI

An eventCall to maintainspawn a certain quantity of respawningsingle idAI2 entity in an idEncounterManager.

Usage


item[0] = {
    eventCall = {
        eventDef = "maintainAICount"spawnSingleAI";
        args = {
            num = 8;3;
            item[0] = {
                eEncounterSpawnType_t = ""; // spawnType
            }
            item[1] = {
                int = 5; // desired_count
            }
            item[2] = {
                int = 10; // max_spawn_count
            }
            item[3] = {
                float = 5; // min_spawn_delay
            }
            item[4] = {
                int = 1; // min_ai_for_respawn
            }
            item[5] = {
                entity = ""; // spawnGroupspawnTarget
            }
            item[6]2] = {
                string = ""; // group_label
            }
        item[7] = {
                float = 10; // max_spawn_delay
            }
        }
    }
}
  • spawnType areis thewhat eEncounterSpawnType_tai thattype you want to beis spawned. Multiple types can be listed, andbut theonly spawneda single ai typesentity will be spawned. Its type will be randomly chosen from this list. ENCOUNTER_SPAWN_ANY can also be used.
  • desired_count is how many ai this eventCall should spawn up to. To avoid overlapping spawns, desired_count should be <= the number of idTarget_Spawns listed under your idTargetSpawnGroup.
  • max_spawn_count is the maximum number of ai that can be spawned by this eventCall in total. This can be set to -1 for infinite respawns.
  • min_spawn_delay is the minimum delay between each spawn, in seconds. This value also affects how soon before this eventCall spawns its first ai.
  • min_ai_for_respawn triggers the ai respawns when they fall below the value it's set to. min_ai_for_respawn must also be < desired_count.
  • spawnGroupspawnTarget is the idTargetSpawnGroupidTarget_Spawn entity you want to use.
  • group_label is whatthe label you want to give to the aithis spawned by this eventCall.ai. This parameter is optional,optional and can be left blank.
  • max_spawn_delay is the maximum delay between each spawn, in seconds.

Example Usage


item[0] = {
    eventCall = {
        eventDef = "maintainAICount"spawnSingleAI";
        args = {
            num = 8;3;
            item[0] = {
                eEncounterSpawnType_t = "ENCOUNTER_SPAWN_ZOMBIE"ENCOUNTER_SPAWN_IMP"; // spawnType
            }
            item[1] = {
                intentity = 10;"ai_target_spawn_47"; // desired_countspawnTarget
            }
            item[2] = {
                int = 20; // max_spawn_count
            }
            item[3] = {
                float = 3; // min_spawn_delay
            }
            item[4] = {
                int = 5; // min_ai_for_respawn
            }
            item[5] = {
                entity = "ai_target_spawn_volume_76"; // spawnGroup
            }
            item[6] = {
                string = ""fodder"; // group_label
            }
            item[7] = {
                float = 5; // max_spawn_delay
            }
        }
    }
}

In this example, 10 Zombies will be spawned, with a 3-5s delay between each (re)spawn. When only 5 Zombies remain, they will begin respawning until there are 10 Zombies again. Once 20 Zombies have been spawned in total, this eventCall is complete.