spawnSoldierOnVehicle 69

Spawn an AI soldier on a vehicle. Faction Ids and loadout Ids can be acquired in the Script Settings menu -> Id tables section


Return value

Return TypeDescription
SoldierReference to the spawned soldier

Parameters

ParameterTypeDescription
1vec3World position where the soldier should spawn
2stringID of the faction that the soldier belong to
3integerRank value: 0 = private, 1 = pre-corporal, 2 = corporal, 3 = pre-sergeant, 4 = sergeant, 5 = staff sergeant, 6 = technical-sergeant, 7 = first-sergeant, 8 = leutenant, 9 = captain, 10 = major, 11 = general
4stringId to the vanilla or custom loadout to give to the soldier. Will have a placeholder loadout if empty. Notice: List of possible loadouts will be given soon
5VehicleReference to the vehicle to spawn in

Examples

Spawn a vehicle, then spawn a squad inside it

-- spawn a vehicle
local veh = spawnVehicle("JeepWillys", vec3(0,1.5,0), vec3(0,90,0))

-- spawn a unit onto that vehicle
local soldierToKill = spawnSoldierOnVehicle(vec3(6,0,2), "Germany_allies", 4, "", veh)

Back to Scripting API