getAllUnitTraits: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...) |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(16 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{RV|type=command | ||
|game1= arma3 | |game1= arma3 | ||
|version1= 2.00 | |||
| | <!-- | ||
|arg= local | |||
|arg= | --> | ||
|gr1= Object Manipulation | |gr1= Object Manipulation | ||
|descr= Returns unit traits | |descr= Returns unit traits (native or set by [[setUnitTrait]]). | ||
|s1= [[getAllUnitTraits]] unit | |s1= [[getAllUnitTraits]] unit | ||
|p1= unit: [[Object]] | |p1= unit: [[Object]] or {{GVI|arma3|2.18|size= 0.75}} [[String]] - a unit or a class name | ||
|r1= [[Array]] of [[Array]]s | |r1= [[Array]] of [[Array]]s in format [name, value] where: | ||
* name: [[String]] - trait's name | |||
* value [[String]] or [[Boolean]] - trait's value | |||
|x1= < | |x1= <sqf> | ||
private _playerTraits = getAllUnitTraits player; | |||
/* | |||
Could return something like this: | |||
[ | [ | ||
["Medic", false], | ["Medic", false], | ||
Line 36: | Line 32: | ||
["test", "custom"] | ["test", "custom"] | ||
] | ] | ||
< | */ | ||
</sqf> | |||
|x2= <sqf> | |||
private _unitTraits = getAllUnitTraits _unit; | |||
private _indexes = [_unitTraits, "Medic"] call BIS_fnc_findNestedElement; | |||
private _unitCanHeal = _unitTraits select (_indexes select 0) select 1; | |||
</sqf> | |||
| | |x3= Since {{GVI|arma3|2.18|size= 0.75}}: | ||
[[ | <sqf> | ||
[ | hint str getAllUnitTraits "O_Engineer_F"; | ||
/* | |||
[ | |||
["Medic", false], | |||
["Engineer", true], | |||
["ExplosiveSpecialist", true], | |||
["UavHacker", false], | |||
["CamouflageCoef", 1], | |||
["AudibleCoef", 1], | |||
["LoadCoef", 1] | |||
] | |||
*/ | |||
</sqf> | |||
|seealso= [[setUnitTrait]] | |seealso= [[getUnitTrait]] [[setUnitTrait]] | ||
}} | }} | ||
{{Note | |||
|user= BrettMayson | |||
|timestamp= 20231127025400 | |||
|text= Local argument assumed, needs confirmation | |||
}} | |||
Latest revision as of 00:27, 30 April 2024
Description
- Description:
- Returns unit traits (native or set by setUnitTrait).
- Groups:
- Object Manipulation
Syntax
- Syntax:
- getAllUnitTraits unit
- Parameters:
- unit: Object or 2.18 String - a unit or a class name
- Return Value:
- Array of Arrays in format [name, value] where:
Examples
- Example 1:
- Example 2:
- Example 3:
- Since 2.18:
Additional Information
- See also:
- getUnitTrait 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
- Posted on Nov 27, 2023 - 02:54 (UTC)
- Local argument assumed, needs confirmation