Jump to content
Sign in to follow this  
_qor

canFire Array?

Recommended Posts

I'd like to check if a huge amount of vehicle is disabled. So I used "!canFire" in a trigger.

But I dont want to text

!canFire tank1 AND !canFire tank2 AND !canFire tank3... 

because it is really a huge amount of vehicles.

So how do I set up an array for that? Or maybe there is another way to check this...

Share this post


Link to post
Share on other sites

FireCheckArray = [tank1,tank2, ... ,tankN];

and in your trigger condition:

{!(canfire _x)} count FireCheckArray == count FireCheckArray

or more elegant just one trigger condition :

{(!(canfire _x)) and (_x isKindOf "TANK")} count thisList == {_x isKindOf "TANK"} count thisList

where thisList is the array that the trigger handles the detected objects internally.

Edited by Charon Productions

Share this post


Link to post
Share on other sites

Or even better:

{canFire _x} count FireCheckArray == 0

{(_x isKindOf "TANK") && (canFire _x)} count thisList == 0

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×