setDamage: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (template:command argument fix)
(27 intermediate revisions by 15 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands|SETDAMAGE]]
{{Command|= Comments
[[Category:Scripting Commands OFP 1.96|SETDAMAGE]]
____________________________________________________________________________________________
[[Category:Scripting Commands ArmA|SETDAMAGE]]


| ofp |= Game name


<h2 style="color:#000066">'''''object'' setDamage ''damage'''''</h2>
|1.5|= Game version




'''Operand types:'''
|eff= global|= Effects in MP
|arg= global|= Arguments in MP
____________________________________________________________________________________________


'''object:''' [[Object]]
| 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)<br><br>
Since Arma 3 v1.67 there is an alternative syntax to this command allowing to switch off destruction effects. |DESCRIPTION=
____________________________________________________________________________________________


'''damage:''' [[Number]]
| object '''setDamage''' damage |SYNTAX=


'''Type of returned value:'''
|p1= object: [[Object]] |PARAMETER1=
|p2= damage: [[Number]] |PARAMETER2=


[[Nothing]]
| [[Nothing]] |RETURNVALUE=


'''Compatibility:'''
|s2= object '''setDamage''' [damage, useEffects] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;''Since Arma 3 v1.67''|SYNTAX=


Added in version '''1.50'''
|p21= object: [[Object]] |PARAMETER2=1
|p22= [damage, useEffects]: [[Array]] |PARAMETER2=2
|p23= damage: [[Number]] |PARAMETER2=3
|p24= useEffects: [[Boolean]] - [[false]] to skip destruction effects. Default: [[true]] |PARAMETER2=4


'''Description:'''
|r2= [[Nothing]] |RETURNVALUE=
____________________________________________________________________________________________
 
|x1= <code>_soldier1 [[setDamage]] 1;</code> |EXAMPLE1=


'''Damage / repair object'''.
|x2= <code>_house1 [[setDamage]] [1, [[false]]];</code> |EXAMPLE2=
___________________________________________________________________________________________


Damage 0 means fully functional, damage 1 means completely destroyed / dead.
| [[setDammage]], [[setVehicleArmor]], [[damage]], [[getDammage]], [[setHit]], [[getHit]], [[getHitIndex]], [[setHitIndex]], [[getHitPointDamage]], [[setHitPointDamage]] |SEEALSO=


See also [[getDammage]]
}}


<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->


'''Note:''' This function is identical to [[setDammage]].


It was introduced to fix a spelling error in original function name.
<dd class="notedate">
<dt class="note">'''[[User:Ceeeb|Ceeeb]]'''
<dd class="note">In '''OFP''', setting a unit's damage to a negative value will set it's health to full, but impair their aim.


'''Note:''' Setting a unit's damage to a negative value will set their health to full, but impair their aim.
<!-- Note Section END -->
</dl>


<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands|SETDAMAGE]]
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.96|SETDAMAGE]]
[[Category:Scripting Commands ArmA|SETDAMAGE]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_Object_Manipulation|{{uc:{{PAGENAME}}}}]]
[[Category:Notes: Improper Formatting|{{uc:{{PAGENAME}}}}]]


'''Example:<br>'''
<!-- CONTINUE Notes -->
 
<dl class="command_description">
soldier1 '''setDamage''' 1
<dd class="notedate">Posted on May 29, 2015 - 11:23 (UTC)</dd>
<dt class="note">[[User:KamikazeXeX|KamikazeXeX]]</dt>
<dd class="note">
Using this possible overrides individual hit damages such as setHitPointDamage ["HitHead", _value]; if you're having issues try setting hitdamage after setdamage
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Revision as of 15:46, 7 April 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