OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Wildebeest 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 :)
-
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"
-
Thanks a bunch....
however I get an error at the line:
_dammage = getdammage _units select _cnt
Hmmm..
-
Well, what's the error message? Where in the error code is the #?
-
maybe try _dammage = getdammage (_units select _cnt)
Sometimes it`s helps
-
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. ;)