BIS fnc initVehicle: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
||
Line 1: | Line 1: | ||
{{Function|Comments= | {{Function|Comments= | ||
| arma3 |Game name= | | arma3 |Game name= | ||
Line 11: | Line 10: | ||
|gr1 = Vehicles |GROUP1= | |gr1 = Vehicles |GROUP1= | ||
| This function changes the textures, animation sources and/or mass of a given vehicle.<br> | | This function changes the textures, animation sources and/or mass of a given vehicle.<br> | ||
Line 63: | Line 61: | ||
--> | --> | ||
|Description= | |Description= | ||
| [vehicle, variant, animations, mass] call [[BIS_fnc_initVehicle]] |Syntax= | | [vehicle, variant, animations, mass] call [[BIS_fnc_initVehicle]] |Syntax= | ||
Line 87: | Line 84: | ||
| [[Boolean]] - function success or not |Return value= | | [[Boolean]] - function success or not |Return value= | ||
|x1= <code>result = [<nowiki/>[[this]], "", []] [[call]] [[BIS_fnc_initVehicle]];</code> |Example 1= | |x1= <code>result = [<nowiki/>[[this]], "", []] [[call]] [[BIS_fnc_initVehicle]];</code> |Example 1= | ||
Line 96: | Line 92: | ||
|x4= <code>[[this]] [[setVariable]] ["'''BIS_fnc_initVehicle_customization'''", [[false]], [[false]]]; {{codecomment|// set in an init field}}</code> |Example 4= | |x4= <code>[[this]] [[setVariable]] ["'''BIS_fnc_initVehicle_customization'''", [[false]], [[false]]]; {{codecomment|// set in an init field}}</code> |Example 4= | ||
| [[Vehicle Customization (VhC)]], [[Description.ext#CfgVehicleTemplates|CfgVehicleTemplates]], [[Description.ext#disableRandomization|disableRandomization]] |See also= | | [[Vehicle Customization (VhC)]], [[Description.ext#CfgVehicleTemplates|CfgVehicleTemplates]], [[Description.ext#disableRandomization|disableRandomization]] |See also= |
Revision as of 23:29, 16 January 2021
Description
- Description:
- This function changes the textures, animation sources and/or mass of a given vehicle.
The use of BIS_fnc_initVehicle_customization variable in a vehicle's init field is possible (see Example 4)Additional information:
- Execution:
- call
- Groups:
- Vehicles
Syntax
- Syntax:
- [vehicle, variant, animations, mass] call BIS_fnc_initVehicle
- Parameters:
- vehicle: Object - vehicle to customize
- variant: (Optional, default false)
- Boolean - true to restore default texture source, false to skip texture source change
- Array - Array of texture sources with their probability, to format
["textureSource1", 0.5, "textureSource2", 0.5]
- String - Variant class name - from the configFile >> CfgVehicles or from the missionConfigFile >> CfgVehicleTemplates
- Number - index of the texture source (same as the old system)
- 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]
NOTE: if the first element is wrong, it will skip the rest of the animation sources - String - variant class name - from the configFile >> CfgVehicles or from the missionConfigFile >> CfgVehicleTemplates
- mass: (Optional, default false)
- Return Value:
- 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:
this setVariable ["BIS_fnc_initVehicle_customization", false, false]; // set in an init field
Additional Information
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
Notes
Bottom Section
- 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.