BIS fnc initVehicle: Difference between revisions
Jump to navigation
Jump to search
(Second half of the code actually also never worked. So removed completly) |
Lou Montana (talk | contribs) (Page filling) |
||
Line 1: | Line 1: | ||
{{Function|= Comments | {{Function|= Comments | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| arma3 | | | arma3 |Game name= | ||
|1.42| | |1.42|Game version= | ||
| | |arg= local |Argument= | ||
|eff= global |Effect= | |||
____________________________________________________________________________________________ | |||
| This function changes the textures, animation sources and/or mass of a given vehicle.<br /> | |||
The use of '''BIS_fnc_initVehicle_customization''' variable in a vehicle's init field is possible (see '''Example 4''') | |||
{{Informative|Unless explicitly mentioned (see '''Example 3'''), the function will restore the initial state of every animation sources of the given object.}} | |||
'''Additional information:''' | |||
* [http://dev.arma3.com/post/oprep-vehicle-customization OPREP] | |||
* [[Vehicle_Customization_(VhC)]] | |||
<!-- | |||
========================= | |||
The following are examples from function's header | |||
========================= | |||
1) Do nothing because default VAR texture and VAR animation are "false" | 1) Do nothing because default VAR texture and VAR animation are "false" | ||
result = [this] call bis_fnc_initVehicle; | result = [this] call bis_fnc_initVehicle; | ||
Line 77: | Line 59: | ||
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) | 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; | result = [this, true, true, true] call bis_fnc_initVehicle; | ||
--> | |||
|Description= | |||
____________________________________________________________________________________________ | |||
*/ | | [vehicle, variant, animations, mass] call [[BIS_fnc_unitHeadgear]] |Syntax= | ||
</ | |||
|p1= vehicle: [[Object]] - vehicle to customize |Parameter 1= | |||
|p2= 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 {{Inline code|["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> | |||
* [[Number]] - index of the texture source (same as the old system) |Parameter 2= | |||
| | |p3= animations: (Optional, default [[false]]) | ||
* [[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]}}<br />'''NOTE:''' 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> | |||
|Parameter 3= | |||
| | |p4= 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 | |||
|Parameter 4= | |||
| | | | [[Boolean]] - function success or not |Return value= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1= <code>result = [this, "", []] [[call]] [[BIS_fnc_initVehicle]];</code> |= | |x1= <code>result = <nowiki>[</nowiki>[[this]], "", []] [[call]] [[BIS_fnc_initVehicle]];</code> |Example 1= | ||
|x2= <code>result = [this, ["MyTextureSource1", 0.5, "MyTextureSource2", 0.6], []] [[call]] [[BIS_fnc_initVehicle]];</code> |= | |x2= <code>result = <nowiki>[</nowiki>[[this]], ["MyTextureSource1", 0.5, "MyTextureSource2", 0.6], []] [[call]] [[BIS_fnc_initVehicle]];</code> |Example 2= | ||
|x3= <code>result = [this, [[nil]], ["MyAnimationSource1", 0.5, "MyAnimationSource2", 0.7]] [[call]] [[BIS_fnc_initVehicle]];</code> |= | |x3= <code>result = <nowiki>[</nowiki>[[this]], [[nil]], ["MyAnimationSource1", 0.5, "MyAnimationSource2", 0.7]] [[call]] [[BIS_fnc_initVehicle]];</code> |Example 3= | ||
|x4= <code>[[this]] [[setVariable]] ["'''BIS_fnc_initVehicle_customization'''", [[false]], [[false]], [[false]]]; {{codecomment|// set in an init field}}</code> |Example 4= | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [[Vehicle Customization (VhC)]], [[Description.ext#CfgVehicleTemplates|CfgVehicleTemplates]], [[Description.ext#disableRandomization|disableRandomization]] | | | [[Vehicle Customization (VhC)]], [[Description.ext#CfgVehicleTemplates|CfgVehicleTemplates]], [[Description.ext#disableRandomization|disableRandomization]] |See also= | ||
}} | }} | ||
Revision as of 00:05, 27 May 2018
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:
- Uncategorised
Syntax
- Syntax:
- [vehicle, variant, animations, mass] call BIS_fnc_unitHeadgear
- 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, 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