BIS fnc unitHeadgear: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision imported: BIS Functions update 2/7)
(Page filling)
Line 1: Line 1:
{{Function|Comments=
____________________________________________________________________________________________


{{Function|= Comments
| arma3 |Game name=
____________________________________________________________________________________________


| arma3 |= Game name
|1.48|Game version=


|1.48|= Game version
|args= local |MP arguments=
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>/*
| Randomise headgear and facewear of a character.
Author: Julien VIDA <@tom_48_97>
{{Important|If the randomization is disabled, only strings parameters will be processed, array will be ignored and considered as false.}}|Description=
____________________________________________________________________________________________


Description:
| [unit, headgear, facewear] call BIS_fnc_unitHeadgear |Syntax=
This function is used for randomizing headgear and facewear of a character.
https://community.bistudio.com/wiki/BIS_fnc_unitHeadgear


If the randomization is disabled, only strings parameters, will be processed, array will be ignored and considered as false.
|p1= unit: [[Object]] |Parameter 1=


Parameter(s):
|p2= headgear: [[Boolean]], [[String]] or [[Array]] - (Optional, default [[false]]) can be one of:
_this select 0: Object - Unit
* [[Boolean]] - if [[false]], change nothing to the headgear
_this select 1: Headgear
* [[String]] - valid Headgear class or a valid class from [[Description.ext#CfgUnitTemplates|Description.ext CfgUnitTemplates]]
Array - Headgear list with individual probability
* [[Array]] - headgear list with individual probability |Parameter 2=
Bool - false, change nothing to the headgear
String - valid Headgear class or a valid class from CfgUnitTemplates (mission config file)
_this select 2: Facewear
Array - facewear list with individual probability
Bool - false, change nothing to the facewear
String - valid facewear class


Returns:
|p3= facewear: [[Boolean]], [[String]] or [[Array]] - (Optional, default [[false]]) can be one of:
Bool - True when done
* [[Boolean]] - if [[false]], change nothing to the facewear
* [[String]] - valid facewear class or a valid class from [[Description.ext#CfgUnitTemplates|Description.ext CfgUnitTemplates]]
* [[Array]] - facewear list with individual probability |Parameter 3=


Examples:
| [[Boolean]] - [[true]] when done |Return value=
1) Do nothing because the Headgear and the face wear will be considered as False
result = [this] call BIS_fnc_unitHeadgear;
 
2) Use the default randomization (as defined in the config)
result = [this, [], []] call BIS_fnc_unitHeadgear; // Headgear and face wear
result = [this, []] call BIS_fnc_unitHeadgear // Headgear only
result = [this, nil, []] call BIS_fnc_unitHeadgear // Face wear only. Note that nil can be replaced by false
 
3) Usage of classes defined in the CfgUnitTemplates (mission config file). It will use the headgearList[] and facewearList[]
result = [this, "MyClassName"] call BIS_fnc_unitHeadgear
 
*/
</pre> |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| <!-- [unitName, [], []] call BIS_fnc_unitHeadgear; --> |= Syntax
|x1= <code><nowiki>[</nowiki>[[this]]] [[call]] [[BIS_fnc_unitHeadgear]]; {{codecomment| // headgear and face wear, same as [this, [], []]}}</code> |Example 1=
 
|p1=  |= Parameter 1


| |= Return value
|x2= <code><nowiki>[</nowiki>[[this]], [], []] [[call]] [[BIS_fnc_unitHeadgear]]; {{codecomment| // headgear only}}</code> |Example 2=
____________________________________________________________________________________________


|x1= <code>[this] [[call]] [[BIS_fnc_unitHeadgear]];</code> |=  
|x3= <code><nowiki>[</nowiki>[[this]], [[nil]], []]  [[call]] [[BIS_fnc_unitHeadgear]]; {{codecomment| // facewear only}}</code> |Example 3=


|x2= <code>[this, [[nil]], []]  [[call]] [[BIS_fnc_unitHeadgear]]</code> |=  
|x4= <code><nowiki>[</nowiki>[[this]], "myTemplate"]  [[call]] [[BIS_fnc_unitHeadgear]]; {{codecomment| // class defined in [[Description.ext#CfgUnitTemplates|Description.ext CfgUnitTemplates]]}}</code> |Example 4=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[Description.ext#CfgUnitTemplates|Description.ext, CfgUnitTemplates]] |= See also
| [[Description.ext#CfgUnitTemplates|Description.ext/CfgUnitTemplates]], [[addGoggles]], [[addHeadgear]] |See also=
 
}}
}}



Revision as of 09:37, 8 June 2018

Hover & click on the images for description

Description

Description:
Randomise headgear and facewear of a character.
If the randomization is disabled, only strings parameters will be processed, array will be ignored and considered as false.
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[unit, headgear, facewear] call BIS_fnc_unitHeadgear
Parameters:
unit: Object
headgear: Boolean, String or Array - (Optional, default false) can be one of:
facewear: Boolean, String or Array - (Optional, default false) can be one of:
Return Value:
Boolean - true when done

Examples

Example 1:
[this] call BIS_fnc_unitHeadgear; // headgear and face wear, same as [this, [], []]
Example 2:
[this, [], []] call BIS_fnc_unitHeadgear; // headgear only
Example 3:
[this, nil, []] call BIS_fnc_unitHeadgear; // facewear only
Example 4:
[this, "myTemplate"] call BIS_fnc_unitHeadgear; // class defined in Description.ext CfgUnitTemplates

Additional Information

See also:
Description.ext/CfgUnitTemplatesaddGogglesaddHeadgear

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