OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: PRiME on 20 Jun 2003, 09:11:39

Title: Help with counting group in list, (count units playag1 in thislist) < 0?
Post by: PRiME on 20 Jun 2003, 09:11:39
so im trying to do something like this

(count units PlayaG1 in thislist) == 0?

of cause that won't work so does ne1 know how I can count the units of a group then check to see if there in a trigger list (thislist)

?

Thanks
Title: Re:Help with counting group in list, (count units playag1 in thislist) < 0?
Post by: PRiME on 20 Jun 2003, 09:46:14
My solution to the problem is following.


Quote
DeathTrig = 0; "if ((not isNull _x) and (_x in list playeralive)) then {DeathTrig = DeathTrig + 1}" foreach units PlayaG1; "if ((not isNull _x) and (_x in list playeralive)) then {DeathTrig = DeathTrig + 1}" foreach units PlayaG2; hint format ["%1", DeathTrig];


I put this in a looping trigger. it will count the units of that group that are in "playeralive" trigger, be aware that playeralive trigger must be set to West/Present and repeat etc so the trigger is always updating who is in that list.

Now from this I can just do a count check on DeathTrig and if its 0 then the mission ends.

Simple   ;)
Title: Re:Help with counting group in list, (count units playag1 in thislist) < 0?
Post by: Sui on 20 Jun 2003, 10:53:39
(count units PlayaG1 in thislist) < 0?

Err... Prime...

how Can you have a list of units being less than zero??

What is it you are trying to do here exactly? (That's a pretty nasty looking workaround ;))
Title: Re:Help with counting group in list, (count units playag1 in thislist) < 0?
Post by: Sefe on 20 Jun 2003, 11:02:20
how I can count the units of a group then check to see if there in a trigger list (thislist)

::)

Why don't you just add the trigger to the group and set the condition to "Any group member not present"?
Title: Re:Help with counting group in list, (count units playag1 in thislist) < 0?
Post by: PRiME on 21 Jun 2003, 05:47:49
nope that was just a cheap example ok, I use == 0 and no I can't do any group member not pressent.

This way seems to work well cept it can't count units in a vehicle which is ok. I did a workaround for that too...


Ill try that sync thing out later
Title: Re:Help with counting group in list, (count units playag1 in thislist) < 0?
Post by: Sefe on 21 Jun 2003, 10:05:46
and no I can't do any group member not pressent.

What do you mean? I've done this dozens of times and it worked. It's by far the easiest way and doesn't require a single line of coding.

Maybe a more detailed description of your problem could help?
Title: Re:Help with counting group in list, (count units playag1 in thislist) < 0?
Post by: PRiME on 21 Jun 2003, 12:25:08
Np ill definatly do that then.