Home   Help Search Login Register  

Author Topic: Group count  (Read 477 times)

0 Members and 1 Guest are viewing this topic.

Offline GomerPyle

  • Members
  • *
  • OFPEC rocks.....
Group count
« on: 14 Mar 2003, 17:24:17 »
How do i put the foreach thingy when i want to count that a group is present in a trigger.?

"_x count" forEach units groupname or something like this... (this did not work) thanks.....

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Group count
« Reply #1 on: 14 Mar 2003, 17:37:06 »
DonÂ't know if this works but have you tried the distance command?

Offline GomerPyle

  • Members
  • *
  • OFPEC rocks.....
Re:Group count
« Reply #2 on: 14 Mar 2003, 17:41:17 »
No - but i know there is one condition like that above.... i know one guy that used one.... But i hes not around......  :(

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re:Group count
« Reply #3 on: 14 Mar 2003, 17:41:51 »
If you are trying to count how many units are within the trigger, then you want the count command, not the forEach command.  The syntax would be as follows:

"_x in (list trigger1)" count (units group1) == west countSide (units group1)

This will count how many units in group1 are in the list of units within trigger1's area.  If that number equals the number of units alive in group1, then the trigger's condition is met.  You can change the == to >, <, <=, or >= if you want.  You can also change the west countSide (units group1) portion to some static number if you prefer.
Ranger

Offline GomerPyle

  • Members
  • *
  • OFPEC rocks.....
Re:Group count
« Reply #4 on: 14 Mar 2003, 17:57:56 »
Ok - Thanks

But it did not work.

I have this:

Trigger: triggername is trigger1 (correct?)
Group: convoy = group this (leaders init)(east)

Trigger condition:

"_x in (list trigger1)" count (units convoy) == east countSide (units convoy)

I had a wanted a text coming up when this condition is true. But it did not work...


Thanks again.....

Offline GomerPyle

  • Members
  • *
  • OFPEC rocks.....
Re:Group count
« Reply #5 on: 14 Mar 2003, 18:09:58 »
If i want the condition to count if the group got 0 units left (mission complete - convoy destroyed). What do i do then?