BIS fnc initVehicle: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "{{Function " to "{{RV|type=function ")
m (some minor fixes)
Line 17: Line 17:
'''Additional information:'''
'''Additional information:'''
* [http://dev.arma3.com/post/oprep-vehicle-customization OPREP]
* [http://dev.arma3.com/post/oprep-vehicle-customization OPREP]
* [[Vehicle_Customization_(VhC)]]
* [[Arma 3 Vehicle Customization]]
<!--
=========================
The following are examples from function's header
=========================
 
1) Do nothing because default VAR texture and VAR animation are "false"
result = [this] call bis_fnc_initVehicle;
 
2) Restore default texture and animation sources (reset)
result = [this, true, true] call bis_fnc_initVehicle;
 
3) Randomize everything according to the config file
result = [this, "", []] call bis_fnc_initVehicle; //<-- Preferred
result = [this, "", ""] call bis_fnc_initVehicle;
 
4) Skip everything
result = [this, nil, nil] call bis_fnc_initVehicle; //<-- Prefered
result = [this, false, false] call bis_fnc_initVehicle;
 
5) Apply the given texture and ignore the animations
Priority is given to [missionConfigFile, "CfgVehicleTemplates"]
result = [this, "TemplateName", nil] call bis_fnc_initVehicle;
 
6) random weighted on the given texture sources and their probability, then randomize the animation sources according to the config file
result = [this, ["MyTextureSource1", 0.5, "MyTextureSource2", 0.6], []] call bis_fnc_initVehicle;
 
7) MyAnimationSource1 phase has a 50% chance to be set to 1 and MyAnimationSource2 has a 70% chance to be set to 1
result = [this, nil, ["MyAnimationSource1", 0.5, "MyAnimationSource2", 0.7]] call bis_fnc_initVehicle;
 
8) MyAnimationSource1 phase will be 1 whereas MyAnimationSource2 will be set to 0
result = [this, nil, ["MyAnimationSource1", 1, "MyAnimationSource2", 0]] call bis_fnc_initVehicle;
 
9) Change animation sources with a given template
result = [this, nil, "MyTemplate"] call bis_fnc_initVehicle;
 
10) Change animation source with a given array of probabilities but skip the reset of all animation sources
// Algo: Skip the change of texture, [don't reste of the animation sources, proceed the given animation sources with their, probabilities], skip the change of mass
result = [this, nil, [false,"MyAnimationSource1", 0.5, "MyAnimationSource2", 0.8], nil] call bis_fnc_initVehicle;
 
11) Restore the vehicle to its default state as defined in the config (texture, animation sources, mass) (For the texture, the first item of the texture list is used)
result = [this, true, true, true] call bis_fnc_initVehicle;
-->


| [vehicle, variant, animations, mass] call [[BIS_fnc_initVehicle]]
| [vehicle, variant, animations, mass] call [[BIS_fnc_initVehicle]]

Revision as of 17:03, 29 January 2021

Hover & click on the images for description

Description

Description:
Description needed
Execution:
call
Groups:
Vehicles

Syntax

Syntax:
Syntax needed
Parameters:
vehicle: Object - vehicle to customize
variant: (Optional, default false)
animations: (Optional, default false)
mass: (Optional, default false)
  • Boolean - true to set the default mass, false to disable the mass change
  • Number - mass to remove/add to the vehicle
Return Value:
Return value needed

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:
this setVariable ["BIS_fnc_initVehicle_customization", false, false]; // set in an init field

Additional Information

See also:
See also needed

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Posted on December 1, 2018 - 00:25 (UTC)
HazJ
Randomise camo net options with 50% probability: result = [vehicle player, FALSE, ["showcamonethull", 0.5, "showcamonetturret", 0.5, "showcamonetcannon", 0.5, "showslathull", 0.5]] call BIS_fnc_initVehicle; Force show all camo net options: result = [vehicle player, FALSE, ["showcamonethull", 1, "showcamonetturret", 1, "showcamonetcannon", 1, "showslathull", 1]] call BIS_fnc_initVehicle; Use animationNames to get all available animation sources. Vehicles that don't support certain animations are simply ignored.