|Description:||Creates a crewed vehicle of the given type at the given position.|
All crew positions are filled (driver / pilot, co-pilot, gunner, commander). Cargo positions stay empty.
The function behaves identically to createVehicle, but also populates the crew positions.
|Syntax:||[type, position, dir, markers, placement, special, local, asl, noClip, symbol, forcePos] call fn_vbs_createVehicle|
- type: String - Type of object to be created.
- position: Position-2 - Position to create the vehicle at.
- dir: Number - Direction (in degrees) the vehicle should point at (optional, default: 0).
- markers: Array - If the array contains several marker names, the position of a random one is used to place the vehicle. Otherwise, the given position is used.
- placement: Number - Radius of a circle to randomly place the vehicle in.
- special: String - If set to
"FLY", then vehicle is created in the air (specified in
flyInHeight, in the class configuration), and will keep flying in a figure-8 pattern.
- local: Boolean - If true, then object is created only on the local computer (optional, default: false).
- asl: Boolean - If true then position is interpreted as ASL. Requires the Special option to be set to
"CAN_COLLIDE" (optional, default: false - creates the object on the ground, regardless of the position Z-value).
- noClip: Boolean - If
asl is set to true, then setting
noClip to true always creates the object above ground. PhysX vehicles are always created above ground, regardless of the
noClip setting (optional, default: false).
- symbol: String - Path to the texture to use for the object briefing display. Use
"SYMBOL" to draw a Visitor-style map symbol (only works for objects created during briefing, using the
"BRIEFING" argument in the Editor Object) (optional, default: "").
- forcePos: Boolean - If true, the object is placed exactly at the specified position, even if it ends up colliding with another object (optional, default: false) (V1.64+).
|Return Value:||Object - Created vehicle.|
When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.
_veh = ["vbs2_au_army_landroversrv_d_m2_x", getPos player] call fn_vbs_createVehicle
_veh = ["vbs_au_af_c130j_gry_x", getPos player, 90, , 0, "FLY"] call fn_vbs_createVehicle
|See also:|| createVehicle, fn vbs moveIn, fn vbs putUnitsInVehicle, fn vbs fillCrewPositions |
|Problems:||Does not work reliably with Game vehicles (normally, only the driver is created).|