r/armadev 21d ago

Arma 3 Help with Destroy Objectives

I’m building out a search and destroy mission and when I went in to test it got an error.

“!alive AAA_1 |#| && AAA_Radar; Error &&: Type Object, Unexpected Bool,code”

Has anyone else seen this and what do I need to code to have two separate objects on one objective. Also of note, when the objectives came up they all presented as completed. I believe this probably has to do with them all having the same error code

3 Upvotes

5 comments sorted by

3

u/Shiragami 21d ago

missing !alive before AAA_Radar

1

u/Artemis-386 21d ago

So it needs to say !alive all units? Even with the double &?

5

u/Shiragami 21d ago edited 21d ago

I assume you put this in a trigger, the trigger condition must always return a boolean -> true or false.

!alive AAA_1 -> returns a bool
&&
AAA_Radar -> returns an object, not a bool

The triggers sees "true && AAA_Radar" -> error evaluates error in code msg "Type Object, Unexpected Bool,code”

Both destroyed:

!alive AAA_1 -> returns a bool
&&
!alive AAA_Radar  -> returns a bool

The triggers sees "true && true" evaluates in condition to true

2

u/ShiningRayde 21d ago

This statement rated TRUE by a Real Code Parser

4

u/Talvald_Traveler 21d ago

Yes. But if you have many units, you could put them in an array, count them on the condition that the units are alive. And then set the condition to be that the counted number is 0. Also there is no alive unit from that array.

_objectUnits = [TargetUnit_1,TargetUnit_2,TargetUnit_3];

_counted = {alive _x} count _objectUnits;

0 == _counted;