BIS fnc initVehicle: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Some wiki formatting) |
Lou Montana (talk | contribs) m (Text replacement - "[[Arma 3: Vehicle Customization" to "[[Arma 3: Vehicle Customisation") |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 19: | Line 19: | ||
|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]] - texture sources with their probability in format <sqf inline>["textureSource1", 0.5, "textureSource2", 0.5]</sqf> | ||
* [[String]] - | * [[String]] - variant class name - from <sqf inline>configFile >> "CfgVehicles"</sqf> or <sqf inline>missionConfigFile >> "CfgVehicleTemplates"</sqf> (see [[Description.ext#CfgVehicleTemplates|CfgVehicleTemplates]]) | ||
* [[Number]] - index of the texture source (same as the old system) | * [[Number]] - index of the texture source (same as the old system) | ||
|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]] - animation sources with their probability in format <sqf inline>["animationSource1", 0.5, "animationSource2", 0.5]</sqf>{{Feature|important| | ||
{{Feature|important|If the first element is wrong, it will skip the rest of the animation sources!}} | If the first element is wrong, it will skip the rest of the animation sources!}} | ||
* [[String]] - variant class name - from <sqf inline>configFile >> "CfgVehicles"</sqf> or <sqf inline>missionConfigFile >> "CfgVehicleTemplates"</sqf> (see [[Description.ext#CfgVehicleTemplates|CfgVehicleTemplates]]) | * [[String]] - variant class name - from <sqf inline>configFile >> "CfgVehicles"</sqf> or <sqf inline>missionConfigFile >> "CfgVehicleTemplates"</sqf> (see [[Description.ext#CfgVehicleTemplates|CfgVehicleTemplates]]) | ||
Line 42: | Line 42: | ||
|x4= <sqf> | |x4= <sqf> | ||
// | // 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; | [vehicle player, false, ["showcamonethull", 0.5, "showcamonetturret", 0.5, "showcamonetcannon", 0.5, "showslathull", 0.5]] call BIS_fnc_initVehicle; | ||
</sqf> | </sqf> | ||
|x6= <sqf> | |x6= <sqf> | ||
// | // 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; | [vehicle player, false, ["showcamonethull", 1, "showcamonetturret", 1, "showcamonetcannon", 1, "showslathull", 1]] call BIS_fnc_initVehicle; | ||
</sqf> | </sqf> | ||
|seealso= [[BIS_fnc_saveVehicle]] [[BIS_fnc_loadVehicle]] [[Arma 3: Vehicle Customisation]] | |||
}} | }} |
Latest revision as of 22:57, 8 April 2024
Description
- Description:
- This function changes the textures, animation sources and/or mass of a given vehicle.
Unless explicitly mentioned , the function will restore the initial state of every animation sources of the given object (see Example 3). - 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 - texture sources with their probability in format ["textureSource1", 0.5, "textureSource2", 0.5]
- String - variant class name - from configFile >> "CfgVehicles" or missionConfigFile >> "CfgVehicleTemplates" (see 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 - animation sources with their probability in format ["animationSource1", 0.5, "animationSource2", 0.5]
- String - variant class name - from configFile >> "CfgVehicles" or missionConfigFile >> "CfgVehicleTemplates" (see CfgVehicleTemplates)
- mass: (Optional, default false)
- Return Value:
- Boolean - function success or not
Examples
- Example 1:
- Example 2:
- Example 3:
- Example 4:
- 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
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