Home   Help Search Login Register  

Author Topic: Help with counting group in list, (count units playag1 in thislist) < 0?  (Read 1316 times)

0 Members and 3 Guests are viewing this topic.

PRiME

  • Guest
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
« Last Edit: 21 Jun 2003, 05:48:45 by PRiME »

PRiME

  • Guest
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   ;)

Offline Sui

  • Former Staff
  • ****
    • OFPEC
(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 ;))

Offline Sefe

  • OFPEC Patron
  • Former Staff
  • ****
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"?

PRiME

  • Guest
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

Offline Sefe

  • OFPEC Patron
  • Former Staff
  • ****
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?

PRiME

  • Guest
Np ill definatly do that then.