Home   Help Search Login Register  

Author Topic: This is driving me nuts!  (Read 520 times)

0 Members and 1 Guest are viewing this topic.

Schoeler

  • Guest
This is driving me nuts!
« on: 16 Oct 2003, 08:27:14 »
I'm trying to come up with the code to check and see if six enemy units have been killed in order to determine if an objective has been completed.  I've searched the forums on this subject and NONE of the solutions presented works at all.

This is what I put in the init line of my trigger:

"not (alive _x)" count [aa1,aa2,aa3,aa4,aa5, aa6] > 6;

in the activation line of course:

"2" objStatus "Done";

Any suggestions on how to use alive or count in conunction with a group or array without getting the TYpe Bool Expected Nothing error.  >:(

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:This is driving me nuts!
« Reply #1 on: 16 Oct 2003, 09:59:08 »
Hmmm .... well there's only 6 elements in your array so the count command can never return a number greater than 6, which may be confusing it since you have >.    Try putting it the other way around

"alive _x" count [array] == 0

The fact that some of the array are dead might be confusing it.    Something as simple as

count [array] == 0

might do.

Are the enemy units all in the same group?   Or are they all in the same area?
Plenty of reviewed ArmA missions for you to play

Unnamed

  • Guest
Re:This is driving me nuts!
« Reply #2 on: 16 Oct 2003, 10:52:16 »
I think a dead units reference are only deleted over a period of time, when its detected by a trigger or nearestobject e.t.c If you assign a variable to them, they will allways be available even if they die.

So something like this in your trigger condition would work:

Code: [Select]
Call {_mycount=0 ; {If (Alive _x) Then {_mycount=_mycount+1}} ForEach [a1,a2,a3] ; _mycount}==0

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:This is driving me nuts!
« Reply #3 on: 16 Oct 2003, 13:24:05 »
Using Alive OR Count (not Alive AND Count) and assuming that it's six specific units (not any six of a cast of thousands), at the risk of sounding simple, how about:

!Alive aa1 && !Alive aa2 && . . .

& so on.

deaddog

  • Guest
Re:This is driving me nuts!
« Reply #4 on: 16 Oct 2003, 14:39:56 »
Quote
"not (alive _x)" count [aa1,aa2,aa3,aa4,aa5, aa6] > 6;

This will never work because there are only six members of this array.  You are checking to see if MORE than six are not alive (7 or more).  The statement can never be true. Use > 5 or == 6 instead.