setDamage: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|PARAMETER2=1 " to "|PARAMETER21= ")
m (Text replacement - "|r2= Nothing |RETURNVALUE= " to "|r2= Nothing |RETURNVALUE2= ")
Line 29: Line 29:
|p24= useEffects: [[Boolean]] - [[false]] to skip destruction effects. Default: [[true]] |PARAMETER2=4
|p24= useEffects: [[Boolean]] - [[false]] to skip destruction effects. Default: [[true]] |PARAMETER2=4


|r2= [[Nothing]] |RETURNVALUE=
|r2= [[Nothing]] |RETURNVALUE2=
____________________________________________________________________________________________
____________________________________________________________________________________________
   
   

Revision as of 21:37, 3 September 2019

Hover & click on the images for description

Description

Description:
Damage / repair object. Damage 0 means fully functional, damage 1 means completely destroyed / dead. (This function is an alias of setDammage and was introduced to fix the obvious spelling error in the original function name)

Since Arma 3 v1.67 there is an alternative syntax to this command allowing to switch off destruction effects.
Groups:
Uncategorised

Syntax

Syntax:
object setDamage damage
Parameters:
object: Object
damage: Number
Return Value:
Nothing

Alternative Syntax

Syntax:
object setDamage [damage, useEffects]        Since Arma 3 v1.67
Parameters:
object: Object
[damage, useEffects]: Array
damage: Number
useEffects: Boolean - false to skip destruction effects. Default: true
Return Value:
Nothing

Examples

Example 1:
_soldier1 setDamage 1;
Example 2:
_house1 setDamage [1, false];

Additional Information

See also:
setDammagesetVehicleArmordamagegetDammagesetHitgetHitgetHitIndexsetHitIndexgetHitPointDamagesetHitPointDamage

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

Notes

Ceeeb
In OFP, setting a unit's damage to a negative value will set it's health to full, but impair their aim.

Bottom Section

Posted on May 29, 2015 - 11:23 (UTC)
KamikazeXeX
Using this possible overrides individual hit damages such as setHitPointDamage ["HitHead", _value]; if you're having issues try setting hitdamage after setdamage