BIS fnc initVehicle: Difference between revisions
Jump to navigation
Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki) |
(Created page with " {{Function|= Comments ____________________________________________________________________________________________ | arma3 |= Game name |1.42|= Game version _______________...") |
||
Line 5: | Line 5: | ||
| arma3 |= Game name | | arma3 |= Game name | ||
|1. | |1.42|= Game version | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
Line 17: | Line 17: | ||
Additional information: | Additional information: | ||
OPREP - | OPREP - http://dev.arma3.com/post/oprep-vehicle-customization | ||
Community Wiki - https://community.bistudio.com/wiki/Vehicle_Customization_%28VhC%29 | Community Wiki - https://community.bistudio.com/wiki/Vehicle_Customization_%28VhC%29 | ||
Line 78: | Line 78: | ||
result = [this, true, true, true] call bis_fnc_initVehicle; | result = [this, true, true, true] call bis_fnc_initVehicle; | ||
*/ | */ | ||
</pre> |= Description | |||
____________________________________________________________________________________________ | |||
< | | <!-- [unitName, [], []] call BIS_fnc_unitHeadgear; --> |= Syntax | ||
|p1= |= Parameter 1 | |||
|p1= |= Parameter 1 | |||
| |= Return value | | |= Return value | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1= <code></code> |= | |x1= <code>result = [this, "", []] call bis_fnc_initVehicle;</code> |= | ||
|x2= <code>result = [this, ["MyTextureSource1", 0.5, "MyTextureSource2", 0.6], []] call bis_fnc_initVehicle;</code> |= | |||
|x3= <code>result = [this, nil, ["MyAnimationSource1", 0.5, "MyAnimationSource2", 0.7]] call bis_fnc_initVehicle;</code> |= | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| |= See also | | [[Vehicle Customization (VhC)]], [[Description.ext#CfgVehicleTemplates|CfgVehicleTemplates]], [[Description.ext#disableRandomization|disableRandomization]] |= See also | ||
}} | }} | ||
Line 107: | Line 108: | ||
<h3 style="display:none">Bottom Section</h3> | <h3 style="display:none">Bottom Section</h3> | ||
[[Category:Functions|{{uc:initVehicle}}]] | [[Category:Functions|{{uc:initVehicle}}]] | ||
[[Category:{{Name|arma3}}: Functions|{{uc:initVehicle}}]] | [[Category:{{Name|arma3}}: Functions|{{uc:initVehicle}}]] |
Revision as of 07:49, 2 October 2015
Description
- Description:
/* Author: Julien `Tom_48_97` VIDA Description: This function aims to simplify the way to customize vehicles. It can change the textures and/or the animation sources of a given object. Usage of this function is explained in the below examples. Important note: Unless it explicitly mentionned (example case 10), the function will restore the initial state of every animation sources of the given object. Additional information: OPREP - http://dev.arma3.com/post/oprep-vehicle-customization Community Wiki - https://community.bistudio.com/wiki/Vehicle_Customization_%28VhC%29 Parameter(s): 0: vehicle to customize 1: Variant (textures) BOOL - true to restore default texture source ; false to skip texture source change VOID - Nil to skip the texture source change ARRAY - Array of texture sources with their given probability: ["textureSource1", 0.5, "textureSource2", 0.5] STRING - Variant class name(from the configFile >> cfgVehicles or from the missionConfigfile >> cfgVehicleTemplate) SCALAR - index of the texture source (same as the old system) 2: Animations BOOL - true to restore init phase of every animation sources VOID - Nil to skip change of the animation sources ARRAY - Array of animation sources and probability: ["AnimationSource1", 0.5, "animationSource2", 0.5]. Note, if the first element is false, it will skip the reset of the animation sources STRING - Variant class name(from the configFile >> cfgVehicles or from the missionConfigfile >> cfgVehicleTemplate) 3: Mass BOOL - true to set the default mass, false to disable the mass change SCALAR - Mass to add or remove the vehicle Returns: BOOL - True if success, otherwise, false Examples: 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; //<-- Prefered 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) result = [this, true, true, true] call bis_fnc_initVehicle; */
- Execution:
- call
- Groups:
- Uncategorised
Syntax
- Syntax:
- Syntax needed
- 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;
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