OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Surdus Priest on 22 Oct 2007, 15:02:36

Title: getting current damage
Post by: Surdus Priest on 22 Oct 2007, 15:02:36
would this work to get the current damage of a unit into a variable?

_blah = damage player

surdus

EDIT: oh, and i also need to know how to modify the health of a unit inside a vehicle, rather than modify the vehicles health.
Title: Re: getting current damage
Post by: Wolfrug on 22 Oct 2007, 15:48:01
Yes, writing _variableName = damage Player will mean that _Variablename (which is a local variable) will consist of a number between 0 and 1 (the possible return values of the command damage).

As to modifying the health of passengers as opposed to the vehicle: try something like.

driver Vehicle setdamage X
gunner vehicle setdamage X
(crew vehicle select 3) setdamage X

Otherwise, you might try assignedVehicleRole (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=a#assignedVehicleRole) to figure out the role the unit you want to modify has at that time, and then work with it. Sadly, it returns an array with a string in it, so it's not actually useful without some prior modification. But yes. Work with those!

Wolfrug out.