OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Captain Crunch on 31 Jan 2004, 00:29:17

Title: Not Alive Group
Post 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
Title: Re:Not Alive Group
Post by: h- on 31 Jan 2004, 02:13:58
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
Title: Re:Not Alive Group
Post by: Chris Death on 31 Jan 2004, 02:23:05
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
Title: Re:Not Alive Group
Post by: Captain Crunch on 31 Jan 2004, 05:25:31
Thanks a lot guys!!!
Title: Re:Not Alive Group
Post by: Chris Death on 31 Jan 2004, 05:29:28
hmm - looks like this thread is then (*hint*) solved  8)

~S~ CD
Title: Re:Not Alive Group
Post by: Unnamed on 31 Jan 2004, 07:32:14
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?

Code: [Select]
"IsNull _x" count [policegroup01,policegroup02,policegroup03,policegroup04]==4
Title: Re:Not Alive Group
Post by: macguba on 31 Jan 2004, 10:38:49
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.
Title: Re:Not Alive Group
Post by: deaddog on 31 Jan 2004, 16:54:58
"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.
Title: Re:Not Alive Group
Post by: Chris Death on 31 Jan 2004, 23:27:18
Quote
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
Title: Re:Not Alive Group
Post by: macguba on 01 Feb 2004, 04:02:14
lol I just like the idea of counting things that don't exist.