setUnitTrait: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " \| *(([^=\| ]+)('''|\[\[)([^=\| ]+)) * +\|p1=" to " |s1= $1 |p1=")
m (Text replacement - " | Nothing " to " |r1= Nothing ")
Line 23: Line 23:
|p3= value: [[Boolean]] or [[Number]] - Value (see above)
|p3= value: [[Boolean]] or [[Number]] - Value (see above)
|p4= isCustom (optional): [[Boolean]] - Must be set to [[true]] in case of custom|= Param 4
|p4= isCustom (optional): [[Boolean]] - Must be set to [[true]] in case of custom|= Param 4
| Nothing
|r1= [[Nothing]]
|x1= <code>[[player]] [[setUnitTrait]] ["Medic",[[true]]];</code>
|x1= <code>[[player]] [[setUnitTrait]] ["Medic",[[true]]];</code>
| [[getUnitTrait]] [[getAllUnitTraits]]
| [[getUnitTrait]] [[getAllUnitTraits]]

Revision as of 03:09, 13 June 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
Object Manipulation

Syntax

Syntax:
unit setUnitTrait [skillName, value, isCustom]
Parameters:
unit: Object - The unit whose trait should be set
skillName: String - Name of the skill
value: Boolean or Number - Value (see above)
isCustom (optional): Boolean - Must be set to true in case of custom
Return Value:
Nothing

Examples

Example 1:
player setUnitTrait ["Medic",true];

Additional Information

See also:
See also needed

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 April 27, 2016 - 18:12 (UTC)
R3vo
The higher the value for the loadCoef the less stamina a unit has. Negative values will dramatically increase the stamina actually to a point where it extends the stamina bar.
Posted on October 20, 2017 - 05:49 (UTC)
Midnight
explosiveSpecialist trait can defuse mines (i.e. satchel charges), whilst the engineer trait alone cannot.