Home   Help Search Login Register  

Author Topic: How to stop creating units when 12 are in a group  (Read 500 times)

0 Members and 1 Guest are viewing this topic.

evil

  • Guest
How to stop creating units when 12 are in a group
« on: 06 Sep 2004, 03:29:15 »
I can't seem to figure it out!  I have a script replace/add med to a group, but I want it to stop at twelve for obvious reasons.

Code: [Select]
?units group westg == 12:goto "wait" doesn't seem to work. (Error type group, expected object)

Nor does just
Code: [Select]
?units westg == 12:goto "wait"
(Type array, expect object, group, string, side, etc)

Any ideas?


Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:How to stop creating units when 12 are in a group
« Reply #1 on: 06 Sep 2004, 07:13:09 »
Try brackets. Like:

? (Units westg == 12) : Whatever

:beat: *Gets Shot* :beat:

djukel

  • Guest
Re:How to stop creating units when 12 are in a group
« Reply #2 on: 06 Sep 2004, 08:11:06 »
YOu forgot the "count" command:

?count Units westg == 12:goto "wait"

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:How to stop creating units when 12 are in a group
« Reply #3 on: 06 Sep 2004, 08:22:18 »
There can be a delay between a group taking casualties and this being reflected in the result of the count command.  I have not tried using count when adding units though so it may work for that.

You might want to count the numbers alive in the group rather than just count the members of the group.  I am afraid I cannot remember the syntax.  If others do not answer I will have a look when I get home.
« Last Edit: 06 Sep 2004, 11:37:30 by THobson »

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:How to stop creating units when 12 are in a group
« Reply #4 on: 06 Sep 2004, 09:04:12 »
The countside command will not count dead units. So you could use:

? west countside units westg == 12: goto "wait"

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:How to stop creating units when 12 are in a group
« Reply #5 on: 06 Sep 2004, 20:23:27 »
The code I had in mind was:

"alive _x" count units Groupname == 12

Syntax not guaranteed.

evil

  • Guest
Re:How to stop creating units when 12 are in a group
« Reply #6 on: 09 Sep 2004, 01:57:16 »
?count Units westg == 12:goto "wait"

seems to be working.  I will try adding "alive _x" as that should be more reliable.

Thanks guys.