{"name":"createVehicleCrew","operator":null,"title":"createVehicleCrew","type":"command","url":"https://community.bistudio.com/wiki/createVehicleCrew","revid":369241,"updated":"2024-09-03T10:35:01Z","groups":["Object Manipulation"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"0.76"}],"since":{"game":"arma3","name":"Arma 3","version":"0.76"},"arma3_since":"0.76","branch":null,"locality":{"argument":"global","effect":"global","server_exec":false},"exec":null,"description":"Creates vehicle crew corresponding to the provided vehicle's faction. If the vehicle is already occupied, the command will only create missing crew in the existing vehicle's group.\n\nTo find out which crew will be created, use BIS_fnc_vehicleCrewTurrets.\n\n|  |  |  |\n|---|---|---|\n| + This command: | Does | Does not |\n| - Arma 3 v1.26 create a group if one is needed (otherwise uses `group _vehicle`)<br>- create a driver if the vehicle needs one (`hasDriver = 1;` in config)<br>- create all non-FFV turrets gunners (if the turret needs one - config {`hasGunner` without `dontCreateAI`)<br>- create crew with **ranks** - with the driver as `\"LIEUTENANT\"` and all turret units as `\"SERGEANT\"`, unlike a crewed vehicle placed in Eden Editor where all units are `\"PRIVATE\"`. | - add vehicle to the group, unlike a crewed vehicle placed in Eden Editor. See BIS_fnc_spawnVehicle to spawn a crew-full vehicle with group addition<br>- create cargo units. |  |","syntaxes":[{"syntax":"createVehicleCrew vehicle","since":null,"effect":null,"exec":null,"params":[{"name":"vehicle","type":"Object","optional":false,"default":null,"description":"vehicle to populate with crew","types":["Object"],"since":null,"text":"vehicle: Object - vehicle to populate with crew"}],"returns":{"type":"Group","types":["Group"],"description":"the group of the created crew (since Arma 3 v1.94; before that returned Nothing)","text":"Group - the group of the created crew (since Arma 3 v1.94; before that returned Nothing)"},"form":"unary","operator":null,"left":null,"right":{"text":"vehicle","types":["Object"]}},{"syntax":"group createVehicleCrew vehicle","since":"arma3 2.14","effect":null,"exec":null,"params":[{"name":"group","type":"Group","optional":false,"default":null,"description":"group to put crew in","types":["Group"],"since":null,"text":"group: Group - group to put crew in"},{"name":"vehicle","type":"Object","optional":false,"default":null,"description":"vehicle to populate with crew","types":["Object"],"since":null,"text":"vehicle: Object - vehicle to populate with crew"}],"returns":{"type":"Group","types":["Group"],"description":"the group of the created crew or grpNull","text":"Group - the group of the created crew or grpNull"},"form":"binary","operator":null,"left":{"text":"group","types":["Group"]},"right":{"text":"vehicle","types":["Object"]}},{"syntax":"side createVehicleCrew vehicle","since":"arma3 2.14","effect":null,"exec":null,"params":[{"name":"side","type":"Side","optional":false,"default":null,"description":"side to create crew on","types":["Side"],"since":null,"text":"side: Side - side to create crew on"},{"name":"vehicle","type":"Object","optional":false,"default":null,"description":"vehicle to populate with crew","types":["Object"],"since":null,"text":"vehicle: Object - vehicle to populate with crew"}],"returns":{"type":"Group","types":["Group"],"description":"the group of the created crew or grpNull","text":"Group - the group of the created crew or grpNull"},"form":"binary","operator":null,"left":{"text":"side","types":["Side"]},"right":{"text":"vehicle","types":["Object"]}}],"examples":[{"text":"```sqf\n_veh = createVehicle [\"B_MRAP_01_F\", getMarkerPos \"createVeh\", [], 0, \"NONE\"];\ncreateVehicleCrew _veh;\n```","code":["_veh = createVehicle [\"B_MRAP_01_F\", getMarkerPos \"createVeh\", [], 0, \"NONE\"];\ncreateVehicleCrew _veh;"]},{"text":"```sqf\n_veh = createVehicle [\"O_MRAP_02_hmg_F\", position player, [], 0, \"NONE\"];\ncreateVehicleCrew _veh;\n{\n    diag_log [_x, faction _x, side _x, side group _x];\n} forEach crew _veh;\n\n// [O Alpha 1-1:1,\"OPF_F\",EAST,EAST]\n// [O Alpha 1-1:2,\"OPF_F\",EAST,EAST]\n```","code":["_veh = createVehicle [\"O_MRAP_02_hmg_F\", position player, [], 0, \"NONE\"];\ncreateVehicleCrew _veh;\n{\n\tdiag_log [_x, faction _x, side _x, side group _x];\n} forEach crew _veh;\n\n// [O Alpha 1-1:1,\"OPF_F\",EAST,EAST]\n// [O Alpha 1-1:2,\"OPF_F\",EAST,EAST]"]}],"multiplayer":"This command seems to be Local Argument with UAVs.","problems":null,"aliases":[],"see_also":["deleteVehicleCrew","moveInDriver","moveInGunner","moveInCommander","moveInTurret","moveInCargo","BIS_fnc_spawnVehicle"],"notes":[{"user":"SilentSpike","date":"2014-08-20T14:01:00Z","text":"As of Arma 3 v1.26 the command will work on non-empty vehicles. If any of the crew defined in config are missing they will be added."},{"user":"DrPastah","date":"2015-12-22T14:19:00Z","text":"createVehicleCrew does not work with Transport Unload waypoints for helicopters. You need to spawn the pilots separately and then get them into the helicopter in order to get Transport Unload waypoints to work."},{"user":"AgentRev","date":"2017-06-02T03:26:00Z","text":"The particular seats to which units are added depend on the `dontCreateAI` property, the `hasDriver` property of the base class, and the `hasGunner` propery of turret classes.\n\nFor instance, the following snippet calculates how many seats will be occupied by the created crew:\n\n```sqf\nprivate _vehCfg = configFile >> \"CfgVehicles\" >> typeOf _vehicle;\nprivate _crewCount = {\n    round getNumber (_x >> \"dontCreateAI\") < 1 && \n    ((_x == _vehCfg && { round getNumber (_x >> \"hasDriver\") > 0 }) ||\n    (_x != _vehCfg && { round getNumber (_x >> \"hasGunner\") > 0 }))\n} count ([_vehicle, configNull] call BIS_fnc_getTurrets);\n```\n\nAlso, I've written a function to create a UAV crew for a specific side: https://gist.github.com/AgentRev/cb25d30e464f2239b6cee51fa0110c78"}],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Manipulation","Introduced with Arma 3 version 0.76","Scripting Commands","Scripting Commands: Global Effect"]}