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 Type | Description |
---|---|
Soldier | Reference to the spawned soldier |
Parameters
Parameter | Type | Description |
---|---|---|
1 | vec3 | World position where the soldier should spawn |
2 | string | ID of the faction that the soldier belong to |
3 | integer | Rank 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 |
4 | string | Id 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 |
5 | Vehicle | Reference 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)