getAllUnitTraits

From Bohemia Interactive Community
Jump to navigation Jump to search
Introduced with Arma 3 version 2.002.00
Hover & click on the images for descriptions

Description

Description:
Returns unit traits, native or set by setUnitTrait.

Syntax

Syntax:
getAllUnitTraits unit
Parameters:
unit: Object
Return Value:
Array of Arrays of [String, String/Boolean] - to format [["traitName1",value1], ["traitName2", value2]]

Examples

Example 1:
/* can return: [ ["Medic", false], ["Engineer", false], ["ExplosiveSpecialist", false], ["UavHacker", false], ["CamouflageCoef", 1], ["AudibleCoef", 1], ["LoadCoef", 1], ["test", "custom"] ] */ private _playerTraits = getAllUnitTraits player;
Example 2:
private _unitTraits = getAllUnitTraits _unit; private _indexes = [_unitTraits, "Medic"] call BIS_fnc_findNestedElement; private _unitCanHeal = _unitTraits select (_indexes select 0) select 1;

Additional Information

See also:
setUnitTrait
Groups:
Object Manipulation

Notes

i
Only post proven facts here. Report bugs on the Feedback Tracker and discuss on the Arma Discord or on the Forums.

Bottom Section