OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Captain Winters on 19 Jun 2003, 21:56:05

Title: Unit Count In Group?
Post by: Captain Winters on 19 Jun 2003, 21:56:05
Does anyone know a script that can tell how many units are left in a group?
For say... There are 10 total units are in a group, when at least six of them are killed, my objective is updated.
Any ideas?

Tanks! 8)
Title: Re:Unit Count In Group?
Post by: deaddog on 19 Jun 2003, 22:07:35
Allright!!! An easy one for a change.  ;D

?("alive _x" count units groupname ) < 5:"1" objstatus "done"

or

?count units groupname < 5:....

I like the "alive _x" version because it works faster.  

Title: Re:Unit Count In Group?
Post by: Captain Winters on 19 Jun 2003, 22:13:25
Thanks Deaddog!
*Adds to list of credits*

Tanks! :D
Title: Re:Unit Count In Group?
Post by: Captain Winters on 19 Jun 2003, 22:18:07
Oh, sorry another quick one.
The syntax for naming a group is:

groupname = group this

Right? It's needed for the above script! Is that syntax right?

Tanks! 8)
Title: Re:Unit Count In Group?
Post by: deaddog on 19 Jun 2003, 23:41:00
That is correct sir.

Just put that in the init line of one of the units in the group.

 ;)
Title: Re:Unit Count In Group?
Post by: Captain Winters on 19 Jun 2003, 23:44:22
Thanks, bud.

Tanks! 8)