{"name":"BIS_fnc_initVehicle","title":"BIS fnc initVehicle","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_initVehicle","revid":379272,"updated":"2026-10-30T23:44:27Z","groups":["Vehicles"],"status":"ok","games":{"arma3":"1.42"},"since":"arma3 1.42","arma3_since":"1.42","locality":{"argument":"local","effect":"global"},"description":"This function changes the textures, animation sources and/or mass of a given vehicle.\nUnless explicitly mentioned , the function will restore the initial state of every animation sources of the given object (see Example 3).","syntaxes":[{"syntax":"[vehicle, variant, animations, mass] call BIS_fnc_initVehicle","params":[{"name":"vehicle","type":"Object","description":"vehicle to customize","type_expr":"Object"},{"name":"variant","type":"Boolean, Array, String or Number","optional":true,"default":"false","description":"Boolean - true to restore default texture source, false to skip texture source change\n- Array - texture sources with their probability in format `[\"textureSource1\", 0.5, \"textureSource2\", 0.5]`\n- String - variant class name - from `configFile >> \"CfgVehicles\"` or `missionConfigFile >> \"CfgVehicleTemplates\"` (see CfgVehicleTemplates)\n- Number - index of the texture source (same as the old system)","type_expr":"Boolean | Array | String | Number","text":"variant: Boolean, Array, String or Number - (Optional, default false)\n\n- Boolean - true to restore default texture source, false to skip texture source change\n- Array - texture sources with their probability in format `[\"textureSource1\", 0.5, \"textureSource2\", 0.5]`\n- String - variant class name - from `configFile >> \"CfgVehicles\"` or `missionConfigFile >> \"CfgVehicleTemplates\"` (see CfgVehicleTemplates)\n- Number - index of the texture source (same as the old system)"},{"name":"animations","type":"Boolean, Array or String","optional":true,"default":"false","description":"Boolean - true to restore init phase of every animation sources\n- Array - animation sources with their probability in format `[\"animationSource1\", 0.5, \"animationSource2\", 0.5]`\n\n  > [!IMPORTANT]\n  > If the first element is wrong, it will skip the rest of the animation sources!\n- String - variant class name - from `configFile >> \"CfgVehicles\"` or `missionConfigFile >> \"CfgVehicleTemplates\"` (see CfgVehicleTemplates)","type_expr":"Boolean | Array | String","text":"animations: Boolean, Array or String - (Optional, default false)\n\n- Boolean - true to restore init phase of every animation sources\n- Array - animation sources with their probability in format `[\"animationSource1\", 0.5, \"animationSource2\", 0.5]`\n\n  > [!IMPORTANT]\n  > If the first element is wrong, it will skip the rest of the animation sources!\n- String - variant class name - from `configFile >> \"CfgVehicles\"` or `missionConfigFile >> \"CfgVehicleTemplates\"` (see CfgVehicleTemplates)"},{"name":"mass","type":"Boolean or Number","optional":true,"default":"false","description":"Boolean - true to set the default mass, false to disable the mass change\n- Number - mass to remove/add to the vehicle","type_expr":"Boolean | Number","text":"mass: Boolean or Number - (Optional, default false)\n\n- Boolean - true to set the default mass, false to disable the mass change\n- Number - mass to remove/add to the vehicle"}],"returns":{"type":"Boolean","type_expr":"Boolean","description":"function success or not"}}],"examples":[{"code":["result = [this, \"\", []] call BIS_fnc_initVehicle;"]},{"code":["result = [this, [\"MyTextureSource1\", 0.5, \"MyTextureSource2\", 0.6], []] call BIS_fnc_initVehicle;"]},{"code":["result = [this, nil, [\"MyAnimationSource1\", 0.5, \"MyAnimationSource2\", 0.7]] call BIS_fnc_initVehicle;"]},{"code":["// randomise camo net options with 50% probability\n[vehicle player, false, [\"showcamonethull\", 0.5, \"showcamonetturret\", 0.5, \"showcamonetcannon\", 0.5, \"showslathull\", 0.5]] call BIS_fnc_initVehicle;"]},{"code":["// force show all camo net options. Use animationNames to get all available animation sources. Vehicles that don't support certain animations are simply ignored.\n[vehicle player, false, [\"showcamonethull\", 1, \"showcamonetturret\", 1, \"showcamonetcannon\", 1, \"showslathull\", 1]] call BIS_fnc_initVehicle;"]}],"see_also":["BIS_fnc_saveVehicle","BIS_fnc_loadVehicle","Arma 3: Vehicle Customisation"]}