Home   Help Search Login Register  

Author Topic: getting current damage  (Read 1121 times)

0 Members and 1 Guest are viewing this topic.

Offline Surdus Priest

  • Members
  • *
  • Only I can Forgive You!
getting current damage
« 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.
« Last Edit: 22 Oct 2007, 15:20:12 by Surdus Priest »
Campaigns are hard, I'll stick with scripting for now!

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: getting current damage
« Reply #1 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 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.
"When 900 years YOU reach, look as good you will not!"