Jump to content
Sign in to follow this  
Koni

Counting Triggers activated as condition

Recommended Posts

If you have a lot of triggers that need to be activated for one final trigger that's counting them off before completing a task, is there a shorter way of doing the condition instead of

TriggerActivated triggername AND TriggerActivated triggername AND TriggerActivated triggername AND so on... ?

Like Triggersactivated [trig1, trig2, trig3, trig4]

I know that won't work, but can anything remotly similar be used ?

Share this post


Link to post
Share on other sites

There really isn't anything wrong with just using the "long" version. If you reeaallyyy want to make it shorter, use && instead of AND. :P Hah.

Share this post


Link to post
Share on other sites

heh, is that as much as I can cut it down then :)

Thanks for the reply :thumbsup:

Share this post


Link to post
Share on other sites

Well its either that or you can put..

[] spawn {
waitUntil {triggerActivated triggername};
trg1 = true;
};

in init.sqf or some other .sqf for each trigger you have, obviously changing triggername and trg1. If your triggers are in a linear order, it doesn't need to have [] spawn, just waituntil. And then make your condition...

(trg1 = true) && (trg2 = true) && (trg3 = true)

Or you may even get away with..

(trg1) && (trg2) && (trg3)

Plenty of ways to go about doing anything in ArmA, which is why its so fun. But the way you started really is the simplest way.

Share this post


Link to post
Share on other sites

Interesting, but for what still has to be done to reduce it, I'll stick with the way I've always done it.

Cheers :)

Share this post


Link to post
Share on other sites

What about this:

_t = [trgA, trgB, trgC, trgD]; {triggerActivated _x} count _t == count _t

EDIT:

Forgot you can't have local variables in a trigger so either use a global one or perhaps this:

[trgA, trgB, trgC, trgD] call {{triggerActivated _x} count _this == count _this}

Edited by Muzzleflash

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  

×