getDammage: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Take[ _]On[ _]Helicopters(\|.*)?\]\]" to "{{GameCategory|tkoh|Scripting Commands}}")
m (Text replacement - "_{10,} " to "")
Line 1: Line 1:
{{Command|Comments=
{{Command|Comments=
____________________________________________________________________________________________


| ofp |Game name=
| ofp |Game name=
Line 7: Line 6:


|gr1= Object Manipulation |GROUP1=
|gr1= Object Manipulation |GROUP1=
____________________________________________________________________________________________


| Returns the object damage in the range from 0 to 1. Alias of [[damage]]. |DESCRIPTION=
| Returns the object damage in the range from 0 to 1. Alias of [[damage]]. |DESCRIPTION=
____________________________________________________________________________________________


| [[getDammage]] object |SYNTAX=
| [[getDammage]] object |SYNTAX=
Line 17: Line 14:


| [[Number]] |RETURNVALUE=
| [[Number]] |RETURNVALUE=
____________________________________________________________________________________________


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

Revision as of 01:11, 17 January 2021

Hover & click on the images for description

Description

Description:
Returns the object damage in the range from 0 to 1. Alias of 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:
damagesetDamagesetDammagesetHitgetHitgetHitIndexsetHitIndexgetHitPointDamagesetHitPointDamage

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

Posted on May 9, 2011 - 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 January 31, 2007‎ - 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.

Bottom Section