OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Captain Crunch on 31 Jan 2004, 00:29:17
-
Not Alive (PoliceGroup01) And Not Alive (PoliceGroup02) And Not Alive (PoliceGrooup03) And Not Alive (PoliceGroup04)
I have this typed in a trigger, in the condition field. Now, it doesn't work I know. The syntax is totaly wrong! I t would have to be some like this:
Not Alive (_X ForEach Units PoliceGroup01) And Not... and so on.
But this is wrong as well. Anyone knows the right way?
thanks much
-
In the group leaders init:
PoliceGroup01=units group this
In a trigger (or what u prefer):
Condition: "alive _x" count PoliceGroup01 == 0
On Act.: whatYouNeed
Or if you have in the leaders init PoliceGroup01=group this, change the trigger to "alive _x" count (units policeGroup01) == 0
No warranty on syntaxes :P
-
Or if you have nothing in the leader's init field, but the leader's
name:
"alive _x" count (units leadername) == 0
and form multiple groups or units:
"alive _x" count (units leaderA + units leaderB + units leaderC) == 0
would in your case case look like:
"alive _x" count (units policegroup01 + units policegroup02 + units policegroup03 + units policegroup04) == 0
~S~ CD
-
Thanks a lot guys!!!
-
hmm - looks like this thread is then (*hint*) solved 8)
~S~ CD
-
Before you do, you can also use IsNull on a group to see if any of them are still alive. Same result perhaps not as demanding as counts on units?
"IsNull _x" count [policegroup01,policegroup02,policegroup03,policegroup04]==4
-
I'm not sure you really need the alive. Maybe something like this would do.
count (units grp1 + units grp2) == 0
However I like the isNull method, that looks more elegant.
-
"Alive _x" count units groupname
is better than
count units groupname
because there may be a delay before the count is accurately reflected using the second method.
-
However I like the isNull method, that looks more elegant.
Really macca?
I mean the method works, and everythings ok with it, and i
also agree on that it is a tricky one, but elegant it isn't.
The method is based upon something that doesn't exist,
so it's similar to a competition, where you would count:
the faults and bads of a side, just to compare, which side
got more "minus-points", to locate the side who lost -
instead of checking who made more goods and points to be
the winner.
Anyway, no prob with the isNull method here (i do honor it too),
just thought to say that it's not elegant ;D
~S~ CD
-
lol I just like the idea of counting things that don't exist.