damage: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Some wiki formatting) |
Lou Montana (talk | contribs) m (Text replacement - "\]\] +\[\[" to "]] [[") |
||
(One intermediate revision by the same user not shown) | |||
Line 32: | Line 32: | ||
|p1= object: [[Object]] | |p1= object: [[Object]] | ||
|r1= [[Number]] - | |r1= [[Number]] - the returned number in range (healthy) 0..1 (dead). | ||
|x1= <sqs>? damage player > 0.1 : player groupChat "I'm hurt! Medic!"</sqs> | |x1= <sqs>? damage player > 0.1 : player groupChat "I'm hurt! Medic!"</sqs> | ||
Line 45: | Line 45: | ||
|x3= <sqf>private _health = (1 - damage player) * 100; // health in % from 0 to 100</sqf> | |x3= <sqf>private _health = (1 - damage player) * 100; // health in % from 0 to 100</sqf> | ||
|seealso= [[setDamage]] [[setHit]] [[getHit]] [[getHitIndex]] [[setHitIndex]] [[getHitPointDamage]] [[setHitPointDamage]] | |seealso= [[setDamage]] [[setHit]] [[getHit]] [[getHitIndex]] [[setHitIndex]] [[getHitPointDamage]] [[setHitPointDamage]] [[waterDamaged]] [[Arma 3: Event Handlers#HandleDamage|"HandleDamage" Event Handler]] | ||
}} | }} | ||
Latest revision as of 11:44, 5 May 2024
Description
- Description:
- Return the damage value of an object.
- Alias:
- getDammagesic
- Groups:
- Object Manipulation
Syntax
- Syntax:
- damage object
- Parameters:
- object: Object
- Return Value:
- Number - the returned number in range (healthy) 0..1 (dead).
Examples
- Example 1:
- Example 2:
- Example 3:
Additional Information
- See also:
- setDamage setHit getHit getHitIndex setHitIndex getHitPointDamage setHitPointDamage waterDamaged "HandleDamage" Event Handler
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 Feb 13, 2015 - 20:20 (UTC)
- The returned value depends on the couple target/ammo fired. This value has no correlation with the sum of all hitpoints damage status and the effective status of the object. Firing bullets on cars often lead to weird results. For example: damage returns zero while a Hunter is fired at will with an .50 HMG! Hunter can be almost destroyed with zero damage for this function. If you script, use instead the getHitPointDamage command.
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Object Manipulation