Home   Help Search Login Register  

Author Topic: units health  (Read 1438 times)

0 Members and 1 Guest are viewing this topic.

BRAVO-TWO

  • Guest
units health
« on: 16 Dec 2005, 16:22:31 »
Just one more thing...(In my best columbo voice)

here s  what im trying to do ....

Execute a script  should an enemys health level fall below maximum ( injured)
without reaching minimum (dead)... what could i put  in condition field of trigger to achieve this..?

                                                  shark attack

                                                         ???

 
« Last Edit: 16 Dec 2005, 16:26:02 by [B.C.2] SHARK ATTACK »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:units health
« Reply #1 on: 16 Dec 2005, 16:35:39 »
Condition:   (getDammage loon1 > 0.2) and (getDammage loon1 < 0.8)

Syntax not guaranteed.

In OFP don't think about health:  think about damage.  (In some commands it is misspelled 'dammage'.)  If you think of it as health you'll get yourself the wrong way round.
Plenty of reviewed ArmA missions for you to play

BRAVO-TWO

  • Guest
Re:units health
« Reply #2 on: 16 Dec 2005, 16:46:58 »
thanks mac  ...  will try asap  ...
                     
                      ;)

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:units health
« Reply #3 on: 16 Dec 2005, 16:53:18 »
to monitor every unit, use a hit eventhandler which then runs a check script

far more cpu efficient

something like

INIT.SQS
Quote
_UnitArray = [W1,W2,W3,W4 etc etc etc]
{_x addEventHandler ["Hit", {_this exec "Unit_Hit.sqs"}]}foreach _unitArray


UNIT_HIT.SQS
Quote
_unit = _this select 0
_unit removeallevcenthandlers "Hit"
_MinHealth = 0.3
#START

if (getdammage _unit > _MinHealth)then{hint "Do whatever"}
_delay = 1 + (random 1)
~ _delay
if !(alive _unit)then{exit}else{goto"START"}


this way you can monitor as many units as you want, and monitoring will only occur once the unit has been hit


_minhealth is the minimum danmage that you will allow the unit to sustain before your system does whatever you require to the unit
« Last Edit: 16 Dec 2005, 17:18:58 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:units health
« Reply #4 on: 16 Dec 2005, 17:46:22 »
I don't think hit event handlers activate when a unit is damaged by an explosion, say with a handgrenade or a LAW for example.

You might want to look at a dammaged Event Handler

Offline RujiK

  • Members
  • *
  • KoKo Puh-Fizzles!
Re:units health
« Reply #5 on: 16 Dec 2005, 18:35:12 »
Easiest way would be simply put a trigger and for in the trigger:

Condition:(alive dude)&&(getdammage dude != 0)
Activation:Hint"OH! I DONT FEEL SO GOOD!"

Similar to what max said although this will hint if ANY dammage is given and the unit is still alive.
I like your approach, lets see your departure.
Download the New Flashlight Script!

BRAVO-TWO

  • Guest
Re:units health
« Reply #6 on: 17 Dec 2005, 18:46:53 »
thanks guys ..
everything i needed to know
                   ;)

           shark attack