Arma 3 Scripting

Function in Vehicles

BIS_fnc_initVehicle

Also available as Markdown and JSON, or read the original wiki page.

Description

This function changes the textures, animation sources and/or mass of a given vehicle.

Unless explicitly mentioned , the function will restore the initial state of every animation sources of the given object (see #Example 3).

Syntax

[vehicle, variant, animations, mass] call BIS_fnc_initVehicle

Parameters:

Returns: Boolean - function success or not

Examples

Example 1

result = [this, "", []] call BIS_fnc_initVehicle;

Example 2

result = [this, ["MyTextureSource1", 0.5, "MyTextureSource2", 0.6], []] call BIS_fnc_initVehicle;

Example 3

result = [this, nil, ["MyAnimationSource1", 0.5, "MyAnimationSource2", 0.7]] call BIS_fnc_initVehicle;

Example 4

// randomise camo net options with 50% probability
[vehicle player, false, ["showcamonethull", 0.5, "showcamonetturret", 0.5, "showcamonetcannon", 0.5, "showslathull", 0.5]] call BIS_fnc_initVehicle;

Example 5

// force show all camo net options. Use animationNames to get all available animation sources. Vehicles that don't support certain animations are simply ignored.
[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