Home   Help Search Login Register  

Author Topic: Damage of each guy in a group?  (Read 653 times)

0 Members and 1 Guest are viewing this topic.

Offline Wildebeest

  • Contributing Member
  • **
  • The time the wildebeest ruled the Earth.
Damage of each guy in a group?
« on: 11 Feb 2004, 14:40:55 »
Hi, how can I check the damage of the guys in a whole group?

One way is to give them names and check their damage that way but I don't want to do that.

I've tried stuff like:   "getdammage _x < 1" foreach units groupName
and stuff but can't get it to work :/

Plz help, yet da best :)
Weeee...

Offline Marvin

  • Members
  • *
  • One day they will come
Re:Damage of each guy in a group?
« Reply #1 on: 11 Feb 2004, 14:48:26 »
You can do this by:
[groupname] exec "check.sqs"

In the check.sqs type

_group = _this select 0
_cnt = 0
_units  = units _group
_count = count _units

#lop

_dammage = getdammage _units select _cnt

_cnt = _cnt + 1
?(_cnt == _count) : goto "out"
goto " lop"


#out
exit





then each time you can do with your _dammage all what you need


example :
after _dammage = getdammage _units select _cnt
type
?(_dammage > 0.8) :  _units select _cnt sidechat "I`m hit"
Is there any games than Flashpoint?

Offline Wildebeest

  • Contributing Member
  • **
  • The time the wildebeest ruled the Earth.
Re:Damage of each guy in a group?
« Reply #2 on: 11 Feb 2004, 15:25:05 »
Thanks a bunch....
however I get an error at the line:

_dammage = getdammage _units select _cnt

Hmmm..
Weeee...

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Damage of each guy in a group?
« Reply #3 on: 11 Feb 2004, 15:30:32 »
Well, what's the error message?    Where in the error code is the #?
Plenty of reviewed ArmA missions for you to play

Offline Marvin

  • Members
  • *
  • One day they will come
Re:Damage of each guy in a group?
« Reply #4 on: 11 Feb 2004, 15:33:16 »
maybe try  _dammage = getdammage (_units select _cnt)
Sometimes it`s helps
« Last Edit: 11 Feb 2004, 15:46:39 by Marvin »
Is there any games than Flashpoint?

Offline Welshmanizer

  • Members
  • *
Re:Damage of each guy in a group?
« Reply #5 on: 11 Feb 2004, 19:29:22 »
You will need to use:

?(_cnt == _count - 1) : goto "out"

not

?(_cnt == _count) : goto "out"


If you have 10 units they will be referred to as 0 to 9 in the array.  ;)