getDammage: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_{10,} " to "")
m (Text replacement - ">Posted on January ([0-9]{2})[ a-zA-Z]*, ([0-9]{4})" to ">Posted on $2-01-$1")
 
(29 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command


| ofp |Game name=
|game1= ofp
|version1= 1.00


|1.00|Game version=
|game2= ofpe
|version2= 1.00


|gr1= Object Manipulation |GROUP1=
|game3= arma1
|version3= 1.00


| Returns the object damage in the range from 0 to 1. Alias of [[damage]]. |DESCRIPTION=
|game4= arma2
|version4= 1.00


| [[getDammage]] object |SYNTAX=
|game5= arma2oa
|version5= 1.50


|p1 = object: [[Object]]
|game6= tkoh
|version6= 1.00


| [[Number]] |RETURNVALUE=
|game7= arma3
|version7= 0.50


|x1 = <code>[[private]] _damage = [[getDammage]] [[player]];</code>
|gr1= Object Manipulation


| [[damage]], [[setDamage]], [[setDammage]], [[setHit]], [[getHit]], [[getHitIndex]], [[setHitIndex]], [[getHitPointDamage]], [[setHitPointDamage]] |SEEALSO=
|descr= Returns the object damage in the range from 0 to 1.
 
|alias= [[damage]]
 
|s1= [[getDammage]] object
 
|p1= object: [[Object]]
 
|r1= [[Number]]
 
|x1= <sqf>private _damage = getDammage player;</sqf>
 
|seealso= [[damage]] [[setDamage]] [[setDammage]] [[setHit]] [[getHit]] [[getHitIndex]] [[setHitIndex]] [[getHitPointDamage]] [[setHitPointDamage]]
}}
}}


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


<dd class="notedate">Posted on May 9, 2011 - 13:10 (CEST)
<dt><dt>
<dt class="note">[[User:Demonized|Demonized]]
<dd class="notedate">Posted on 2011-05-09 - 13:10 (CEST)</dd>
<dt class="note">[[User:Demonized|Demonized]]</dt>
<dd class="note">
<dd class="note">
[[getDammage]] and [[damage]] work fine when used on damaged vehicles after a repair from a repair truck when used in {{arma2oa}} patch 1.59.
[[getDammage]] and [[damage]] work fine when used on damaged vehicles after a repair from a repair truck when used in {{arma2oa}} patch 1.59.
 
<dt><dt>
<dd class="notedate">Posted on January 31, 2007‎ - 04:25 (CEST)
<dd class="notedate">Posted on 2007-01-31 - 04:25 (CEST)</dd>
<dt class="note">[[User:Ceeeb|Ceeeb]]
<dt class="note">[[User:Ceeeb|Ceeeb]]</dt>
<dd class="note">
<dd class="note">
In '''{{ofp}} 1.96''', it is possible for a unit to be dead and still return a getDammage value well below 1. Use ![[alive]] to check if a unit is dead.
In '''{{ofp}} 1.96''', it is possible for a unit to be dead and still return a getDammage value well below 1. Use ![[alive]] to check if a unit is dead.
 
<dt><dt>
<dd class="notedate">Posted on 13 August 13, 2006‎ - 12:29 (CEST)
<dd class="notedate">Posted on 13 August 13, 2006 - 12:29 (CEST)</dd>
<dt class="note">[[User:UNN|UNN]]
<dt class="note">[[User:UNN|UNN]]</dt>
<dd class="note">
<dd class="note">
'''In {{ofp}}''' vehicles repaired in game with the Repair trucks e.t.c never get completely repaired. After being repaired, rather than returning 0 when the [[damage]] command is called. They return a value equal to or less than 0.09.  
'''In {{ofp}}''' vehicles repaired in game with the Repair trucks e.t.c never get completely repaired. After being repaired, rather than returning 0 when the [[damage]] command is called. They return a value equal to or less than 0.09.  
Line 41: Line 59:
Consequently any vehicle flagged as immobile (as indicated by the [[canMove]] command), remains so. At least as far as the AI are concerned. The AI will refuse to board an immobile vehicle or eject straight after boarding. Players remain unaffected and can drive the vehicle as normal. To circumvent this, use [[setDamage]] 0 on the vehicle in question, to allow the AI to board.
Consequently any vehicle flagged as immobile (as indicated by the [[canMove]] command), remains so. At least as far as the AI are concerned. The AI will refuse to board an immobile vehicle or eject straight after boarding. Players remain unaffected and can drive the vehicle as normal. To circumvent this, use [[setDamage]] 0 on the vehicle in question, to allow the AI to board.


<!-- Note Section END -->
</dl>
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.46|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.96|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
{{GameCategory|arma1|Scripting Commands}}
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}

Latest revision as of 23:02, 13 May 2023

Hover & click on the images for description

Description

Description:
Returns the object damage in the range from 0 to 1.
Alias:
damage
Groups:
Object Manipulation

Syntax

Syntax:
getDammage object
Parameters:
object: Object
Return Value:
Number

Examples

Example 1:
private _damage = getDammage player;

Additional Information

See also:
damage setDamage setDammage setHit getHit getHitIndex setHitIndex getHitPointDamage setHitPointDamage

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
Posted on 2011-05-09 - 13:10 (CEST)
Demonized
getDammage and damage work fine when used on damaged vehicles after a repair from a repair truck when used in Arma 2: Operation Arrowhead patch 1.59.
Posted on 2007-01-31 - 04:25 (CEST)
Ceeeb
In Operation Flashpoint 1.96, it is possible for a unit to be dead and still return a getDammage value well below 1. Use !alive to check if a unit is dead.
Posted on 13 August 13, 2006 - 12:29 (CEST)
UNN
In Operation Flashpoint vehicles repaired in game with the Repair trucks e.t.c never get completely repaired. After being repaired, rather than returning 0 when the damage command is called. They return a value equal to or less than 0.09. Consequently any vehicle flagged as immobile (as indicated by the canMove command), remains so. At least as far as the AI are concerned. The AI will refuse to board an immobile vehicle or eject straight after boarding. Players remain unaffected and can drive the vehicle as normal. To circumvent this, use setDamage 0 on the vehicle in question, to allow the AI to board.