Home   Help Search Login Register  

Author Topic: how to check it x amount of soldiers from a group are dead?  (Read 547 times)

0 Members and 1 Guest are viewing this topic.

Offline ONoSixIsDown

  • Members
  • *
in order to prevent the classic "Run around like a moron while looking for that last enemy" problem, i'm trying to put together a script that will complete an objective when a certain number of units from a certain group are dead.

can someone show me a good script to use?
CRIMSON REIGN COMMING..... eventually :/

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re:how to check it x amount of soldiers from a group are dead?
« Reply #1 on: 17 Nov 2005, 13:19:51 »
Code: [Select]
#loop
? (count units group1 <= 2) : "1" ObjStatus "DONE"; exit
goto "loop"

something like that ::) Been a while since I scripted anything, and my memory is kinda bad. But that should check if the numbers of units left in group1 is less or equal to 2, and then set objective 1 to done, and exit the script...if it works :P

Offline ONoSixIsDown

  • Members
  • *
Re:how to check it x amount of soldiers from a group are dead?
« Reply #2 on: 17 Nov 2005, 13:25:42 »
thanks man.. big help... thats exactly the kind of thing i was looking for...
CRIMSON REIGN COMMING..... eventually :/

Offline ONoSixIsDown

  • Members
  • *
Re:how to check it x amount of soldiers from a group are dead?
« Reply #3 on: 17 Nov 2005, 13:48:49 »
what would i need to change in that script if i wanted to have it check how many units are left in multiple groups?
CRIMSON REIGN COMMING..... eventually :/

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:how to check it x amount of soldiers from a group are dead?
« Reply #4 on: 17 Nov 2005, 14:25:33 »
OhNoSixIsDown, you obviously meant to unsolve this so I'll save you the trouble.   :)   Solving locks the thread so nobody can reply.

When using count to check the number of live loons in a group, always combine it with an alive command.    Count alone can result in a severe delay (several minutes) while the group leader doesn't know that "6 is down".

"alive _x" count units group1 <= 2

Syntax not guaranteed.

There are several ways of doing what you want.     You can just add the lines together:-

("alive _x" count units group1 <= 2) and ("alive _x" count units group2 <= 2) and ...

Or you could make a trigger:-

Area:  whole map
Activation box:  West present
Condition:   count thislist < 3
On Activation:  as you like

The trigger will fire when the number of West loons on the map drops below 3.   A vehicle counts as 1 even if it has several crew:  the count will rise if they disembark.

Oh, and please try to avoid making consecutive posts in the same thread.   (It's ok if a long time has passed.)    Use the button in the top right hand corner of the post.  ;)
« Last Edit: 17 Nov 2005, 14:26:59 by macguba »
Plenty of reviewed ArmA missions for you to play