spawnSquad_script 39

Spawn an AI squad and assign a script to each AI. Faction Ids and Squad Ids can be acquired in the Script Settings menu -> Id tables section. Can spawn custom squads made with Squad Editor


Return value

Return TypeDescription
SquadReference to the spawned squad

Parameters

ParameterTypeDescription
1vec3Position where to spawn the squad
2floatRadius where soldiers will be spawn within
3stringFaction to assign the squad to
4stringId of the squad to spawn.
5stringFile name of the AI script to assign

Examples

Example 160

-- spawn squad and assign to each AI a script "example.lua", located inside <mission>/scripts/ai/
local squad = spawnSquad_script(vec3(0,1.5,0), 50, "Canada_allies", "can_infantry", "example.lua")

Back to Scripting API