BIS fnc initVehicle: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "this" to "this")
m (Text replacement - "{{Inline code|" to "{{ic|")
Line 20: Line 20:
|p2= variant: (Optional, default [[false]])
|p2= variant: (Optional, default [[false]])
* [[Boolean]] - [[true]] to restore default texture source, [[false]] to skip texture source change
* [[Boolean]] - [[true]] to restore default texture source, [[false]] to skip texture source change
* [[Array]] - Array of texture sources with their probability, to format {{Inline code|["textureSource1", 0.5, "textureSource2", 0.5]}}
* [[Array]] - Array of texture sources with their probability, to format {{ic|["textureSource1", 0.5, "textureSource2", 0.5]}}
* [[String]] - Variant class name - from the <tt>[[configFile]] >> [[CfgVehicles]]</tt> or from the <tt>[[missionConfigFile]] >> [[Description.ext#CfgVehicleTemplates|CfgVehicleTemplates]]</tt>
* [[String]] - Variant class name - from the <tt>[[configFile]] >> [[CfgVehicles]]</tt> or from the <tt>[[missionConfigFile]] >> [[Description.ext#CfgVehicleTemplates|CfgVehicleTemplates]]</tt>
* [[Number]] - index of the texture source (same as the old system)
* [[Number]] - index of the texture source (same as the old system)
Line 26: Line 26:
|p3= animations: (Optional, default [[false]])
|p3= animations: (Optional, default [[false]])
* [[Boolean]] - [[true]] to restore init phase of every animation sources
* [[Boolean]] - [[true]] to restore init phase of every animation sources
* [[Array]] - Array of animation sources with their probability, to format {{Inline code|["animationSource1", 0.5, "animationSource2", 0.5]}}
* [[Array]] - Array of animation sources with their probability, to format {{ic|["animationSource1", 0.5, "animationSource2", 0.5]}}
{{Feature|important|If the first element is wrong, it will skip the rest of the animation sources!}}
{{Feature|important|If the first element is wrong, it will skip the rest of the animation sources!}}
* [[String]] - variant class name - from the <tt>[[configFile]] >> [[CfgVehicles]]</tt> or from the <tt>[[missionConfigFile]] >> [[Description.ext#CfgVehicleTemplates|CfgVehicleTemplates]]</tt>
* [[String]] - variant class name - from the <tt>[[configFile]] >> [[CfgVehicles]]</tt> or from the <tt>[[missionConfigFile]] >> [[Description.ext#CfgVehicleTemplates|CfgVehicleTemplates]]</tt>

Revision as of 18:11, 27 February 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)
  • Boolean - true to restore init phase of every animation sources
  • Array - Array of animation sources with their probability, to format ["animationSource1", 0.5, "animationSource2", 0.5]
If the first element is wrong, it will skip the rest of the animation sources!
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:
// 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 6:
// 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;

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