getUnitTrait: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(fixed, engine traits)
mNo edit summary
Line 11: Line 11:
audibleCoef (scalar)<br />
audibleCoef (scalar)<br />
loadCoef (scalar)<br />|= Description
loadCoef (scalar)<br />|= Description
|unit '''setUnitTrait''' skill_name |= Syntax
|unit '''getUnitTrait''' skill_name |= Syntax
|p1= Unit: [[Object]] |= Parameter 1
|p1= Unit: [[Object]] |= Parameter 1
|p2= skill_name: [[String]] - Name of the skill |= Parameter 1
|p2= skill_name: [[String]] - Name of the skill |= Parameter 1
| [[Bool]] or [[Scalar]] - Value of the trait |= RETURNVALUE  
| [[Bool]] or [[Scalar]] - Value of the trait |= RETURNVALUE  
|x1= <code>player getUnitTrait "Medic";</code>|= EXAMPLE1  
|x1= <code>[[player]] [[getUnitTrait]] "Medic";</code>|= EXAMPLE1  
| [[setUnitTrait]]|= SEEALSO  
| [[setUnitTrait]]|= SEEALSO  
|  |= MPBEHAVIOUR  
|  |= MPBEHAVIOUR  

Revision as of 01:05, 27 April 2016

Hover & click on the images for description

Description

Description:
Gets the current value of a trait of the given unit.

Default traits are:

medic (bool)
engineer (bool)
explosiveSpecialist (bool)
camouflageCoef (scalar)
audibleCoef (scalar)
loadCoef (scalar)
Groups:
Uncategorised

Syntax

Syntax:
unit getUnitTrait skill_name
Parameters:
Unit: Object
skill_name: String - Name of the skill
Return Value:
Bool or Scalar - Value of the trait

Examples

Example 1:
player getUnitTrait "Medic";

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

Bottom Section

Notes

Bottom Section