Difference between revisions of "setDamage"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= Comments" to "|Comments=")
m (Text replacement - " it's" to " it is")
 
(10 intermediate revisions by one other user not shown)
Line 2: Line 2:
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| ofp |= Game name
+
| ofp |Game name=
  
|1.5|= Game version
+
|1.5|Game version=
  
 +
|eff= global|Multiplayer Effects=
  
|eff= global|Multiplayer Effects=
 
 
|arg= global|Multiplayer Arguments=
 
|arg= global|Multiplayer Arguments=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| 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>
+
| Sets an object's damage value in the range 0..1, 0 meaning fully functional and 1 completely destroyed / dead.<br>
Since Arma 3 v1.67 there is an alternative syntax to this command allowing to switch off destruction effects. |DESCRIPTION=
+
The alternative syntax allows to switch off destruction effects.
 +
 
 +
{{Informative | Identical to [[setDammage]], typo aside.}} |DESCRIPTION=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| object '''setDamage''' damage |SYNTAX=
+
| object [[setDamage]] damage |SYNTAX=
  
 
|p1= object: [[Object]] |PARAMETER1=
 
|p1= object: [[Object]] |PARAMETER1=
 +
 
|p2= damage: [[Number]] |PARAMETER2=
 
|p2= damage: [[Number]] |PARAMETER2=
  
 
| [[Nothing]] |RETURNVALUE=
 
| [[Nothing]] |RETURNVALUE=
 +
____________________________________________________________________________________________
 +
 +
|s2= object [[setDamage]] [damage, useEffects] {{since|arma3|1.67|y}} |SYNTAX2=
  
|s2= object '''setDamage''' [damage, useEffects] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;''Since Arma 3 v1.67''|SYNTAX=
+
|p21= object: [[Object]] |PARAMETER21=
  
|p21= object: [[Object]] |PARAMETER2=1
+
|p22= [damage, useEffects]: [[Array]] |PARAMETER22=
|p22= [damage, useEffects]: [[Array]] |PARAMETER2=2
 
|p23= damage: [[Number]] |PARAMETER2=3
 
|p24= useEffects: [[Boolean]] - [[false]] to skip destruction effects. Default: [[true]] |PARAMETER2=4
 
  
|r2= [[Nothing]] |RETURNVALUE=
+
|p23= damage: [[Number]] |PARAMETER23=
 +
 
 +
|p24= useEffects: [[Boolean]] - [[false]] to skip destruction effects. Default: [[true]] |PARAMETER24=
 +
 
 +
|r2= [[Nothing]] |RETURNVALUE2=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
 
   
 
   
Line 37: Line 44:
 
___________________________________________________________________________________________
 
___________________________________________________________________________________________
  
| [[setDammage]], [[setVehicleArmor]], [[damage]], [[getDammage]], [[setHit]], [[getHit]], [[getHitIndex]], [[setHitIndex]], [[getHitPointDamage]], [[setHitPointDamage]] |SEEALSO=
+
| [[setVehicleArmor]], [[damage]], [[getDammage]], [[setHit]], [[getHit]], [[getHitIndex]], [[setHitIndex]], [[getHitPointDamage]], [[setHitPointDamage]] |SEEALSO=
 
 
 
}}
 
}}
  
Line 45: Line 51:
 
<!-- Note Section BEGIN -->
 
<!-- Note Section BEGIN -->
  
+
<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>
  
<dd class="notedate">
+
<dd class="notedate">Posted on April 17, 2006‎ - 07:36 (CEST)</dd>
<dt class="note">'''[[User:Ceeeb|Ceeeb]]'''
+
<dt class="note">[[User:Fragorl|Fragorl]]
<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.
+
<dd class="note">In '''OFP''', setting a unit's damage to a negative value will set it is health to full, but impair their aim.
  
 
<!-- Note Section END -->
 
<!-- Note Section END -->
Line 55: Line 65:
  
 
<h3 style="display:none">Bottom Section</h3>
 
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands|SETDAMAGE]]
+
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting Commands OFP 1.96|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.96|SETDAMAGE]]
+
[[Category:Scripting Commands Armed Assault|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA|SETDAMAGE]]
+
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
 
 
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
+
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
 
[[Category:Command_Group:_Object_Manipulation|{{uc:{{PAGENAME}}}}]]
 
[[Category:Command_Group:_Object_Manipulation|{{uc:{{PAGENAME}}}}]]
[[Category:Notes: Improper Formatting|{{uc:{{PAGENAME}}}}]]
 
 
<!-- CONTINUE Notes -->
 
<dl class="command_description">
 
<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 -->
 

Latest revision as of 10:00, 8 September 2020

Introduced with Operation Flashpoint version ?1.5 ?Arguments of this scripting command don't have to be local to the client the command is executed onEffects of this scripting command are broadcasted over the network and happen on every computer in the network
Hover & click on the images for descriptions

Description

Description:
Sets an object's damage value in the range 0..1, 0 meaning fully functional and 1 completely destroyed / dead.
The alternative syntax allows to switch off destruction effects.
Identical to setDammage, typo aside.

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:
setVehicleArmordamagegetDammagesetHitgetHitgetHitIndexsetHitIndexgetHitPointDamagesetHitPointDamage

Notes

i
Only post proven facts here. Report bugs on the Feedback Tracker and discuss on the Arma Discord or on the Forums.

Notes

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.
Posted on April 17, 2006‎ - 07:36 (CEST)
Fragorl
In OFP, setting a unit's damage to a negative value will set it is health to full, but impair their aim.

Bottom Section