OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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
-
My solution to the problem is following.
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 ;)
-
(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 ;))
-
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"?
-
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
-
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?
-
Np ill definatly do that then.