getAllUnitTraits: Difference between revisions
| Lou Montana (talk | contribs) m (Some wiki formatting) | Lou Montana (talk | contribs)   (Add 2.16 syntax) | ||
| Line 17: | Line 17: | ||
| * name: [[String]] - trait's name | * name: [[String]] - trait's name | ||
| * value [[String]] or [[Boolean]] - trait's value | * value [[String]] or [[Boolean]] - trait's value | ||
| |s2= [[getAllUnitTraits]] configClass | |||
| |s2since= arma3 2.16 | |||
| |p21= configClass: [[String]] | |||
| |r2= same as {{Link|#Syntax 1}} | |||
| |x1= <sqf> | |x1= <sqf> | ||
| Line 38: | Line 46: | ||
| private _indexes = [_unitTraits, "Medic"] call BIS_fnc_findNestedElement; | private _indexes = [_unitTraits, "Medic"] call BIS_fnc_findNestedElement; | ||
| private _unitCanHeal = _unitTraits select (_indexes select 0) select 1; | private _unitCanHeal = _unitTraits select (_indexes select 0) select 1; | ||
| </sqf> | |||
| |x3= Since {{GVI|arma3|2.16|size= 0.75}} | |||
| <sqf> | |||
| /* | |||
| [ | |||
| 	["Medic", false], | |||
| 	["Engineer", true], | |||
| 	["ExplosiveSpecialist", true], | |||
| 	["UavHacker", false], | |||
| 	["CamouflageCoef", 1], | |||
| 	["AudibleCoef", 1], | |||
| 	["LoadCoef", 1] | |||
| ] | |||
| */ | |||
| hint str getAllUnitTraits "O_Engineer_F"; | |||
| </sqf> | </sqf> | ||
| |seealso= [[setUnitTrait]] | |seealso= [[setUnitTrait]] | ||
| }} | }} | ||
Revision as of 18:39, 24 October 2023
Description
- Description:
- Returns unit traits, native or set by setUnitTrait.
- Groups:
- Object Manipulation
Syntax
- Syntax:
- getAllUnitTraits unit
- Parameters:
- unit: Object
- Return Value:
- Array of Arrays in format [name, value] where:
Alternative Syntax
- Syntax:
- getAllUnitTraits configClass
- Parameters:
- configClass: String
- Return Value:
- same as Syntax 1
Examples
- Example 1:
- Example 2:
- Example 3:
- Since  2.16 2.16
Additional Information
- See also:
- setUnitTrait
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
 
	