Difference between revisions of "setDamage"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|= Comments
+
{{Command|Comments=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| ofp |= Game name
+
| ofp |Game name=
  
|1.5|= Game version
+
|1.5|Game version=
  
 +
|eff= global|Multiplayer Effects=
  
|eff= global|= Effects in MP
+
|arg= global|Multiplayer Arguments=
|arg= global|= Arguments in MP
 
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| 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.<br><br>
 +
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] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(''Since Arma 3 v1.67'')|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 38: Line 44:
  
 
| [[setDammage]], [[setVehicleArmor]], [[damage]], [[getDammage]], [[setHit]], [[getHit]], [[getHitIndex]], [[setHitIndex]], [[getHitPointDamage]], [[setHitPointDamage]] |SEEALSO=
 
| [[setDammage]], [[setVehicleArmor]], [[damage]], [[getDammage]], [[setHit]], [[getHit]], [[getHitIndex]], [[setHitIndex]], [[getHitPointDamage]], [[setHitPointDamage]] |SEEALSO=
 
 
}}
 
}}
  
Line 44: Line 49:
 
<dl class="command_description">
 
<dl class="command_description">
 
<!-- Note Section BEGIN -->
 
<!-- Note Section BEGIN -->
 
 
  
 
<dd class="notedate">
 
<dd class="notedate">
<dt class="note">'''[[User:Ceeeb|Ceeeb]]'''
+
<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.
 
<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.
  
Line 55: Line 58:
  
 
<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 ArmA|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA|SETDAMAGE]]
 
 
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
Line 70: Line 73:
 
<dt class="note">[[User:KamikazeXeX|KamikazeXeX]]</dt>
 
<dt class="note">[[User:KamikazeXeX|KamikazeXeX]]</dt>
 
<dd class="note">
 
<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
+
Using this possible overrides individual hit damages such as [[setHitPointDamage]] ["HitHead", _value]; if you're having issues try setting hitdamage ''after'' setdamage.
 
</dd>
 
</dd>
 
</dl>
 
</dl>
 
<!-- DISCONTINUE Notes -->
 
<!-- DISCONTINUE Notes -->

Latest revision as of 00:08, 5 September 2019

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

Click on the images for descriptions

Introduced in

Game:
Operation Flashpoint
Version:
1.5

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

Multiplayer:
-
See also:
setDammagesetVehicleArmordamagegetDammagesetHitgetHitgetHitIndexsetHitIndexgetHitPointDamagesetHitPointDamage

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

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.