Arma 3 Scripting

getDammage

  • Arma 3 v0.50
  • First in Operation Flashpoint v1.00
  • Alias of damage

Command · Markdown · JSON · original wiki page

Description

Returns the object damage.

Syntax

getDammage object

Parameters:

Returns: Number in range 0..1

Examples

Example 1

private _damage = getDammage player;

See also

damage · setDamage · setDammage · setHit · getHit · getHitIndex · setHitIndex · getHitPointDamage · setHitPointDamage

Community notes

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.

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.

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.