Jump to content
Sign in to follow this  
1para{god-father}

Check Any Unit is !alive not all

Recommended Posts

If I wanted to activate a trigger if 1 of say 3 vehicles are destroyed how can I do that , I know I can do

!alive aaaa AND !alive bbbb AND !alive cccc

but I want to activate if any of the 3 vehicles have been destroyed not all. i.e can you use a "OR" i.e !alive aaaa OR !alive bbbb etc.. ?

Thanks

Share this post


Link to post
Share on other sites

Big Dawg's method is the way to go here. And if for some reason you don't like it, you could group the 3 vehicles and count when the group has less than 3 in it.

Share this post


Link to post
Share on other sites

Big Dawgs code would fail if they are all dead. ( the count would not be less than ( < ) 3, it would be 3.

edit, nvm that, another way same result:

this will activate if one or more is dead.

({!alive _x} count [aaaa,bbbb,cccc]) != 0

Edited by Demonized

Share this post


Link to post
Share on other sites

Ah. Wouldn't work because of the missing '!'. The < 3 would work if it was using just {alive} though right?

Share this post


Link to post
Share on other sites

ah yes, i saw that now, BD code works just fine... sorry about that BD, corrected previous post.

Share this post


Link to post
Share on other sites

((!(alive aaaa)) || (!(alive bbbb)) || (!(alive cccc))

IMHO is a lot more readable that the count condition approach.

Share this post


Link to post
Share on other sites

That's the cool part of BIS games and scripting in general ;)

Share this post


Link to post
Share on other sites
((!(alive aaaa)) || (!(alive bbbb)) || (!(alive cccc))

IMHO is a lot more readable that the count condition approach.

I don't see how that (which actually contains more symbols and lower-level logic) is more readable than "is the number of {aaaa,bbbb,cccc} that are alive less than 3"... Besidse, you won't be saying that if he needed to scale it up to 20 or so objects (in which case my code example would be much more readable).

Share this post


Link to post
Share on other sites

I think by more readable he means as you said lower-level logic, easier for people who aren't so in-tune with scripting to read.

Share this post


Link to post
Share on other sites
;1985107']I think by more readable he means as you said lower-level logic' date=' easier for people who aren't so in-tune with scripting to read.[/quote']

IMO the count example is closer to a natural language (well, specifically English) than the chain of boolean operators.

Share this post


Link to post
Share on other sites
IMO the count example is closer to a natural language (well, specifically English) than the chain of boolean operators.

I agree, because everybody knows what less than (<) means, versus ||, which could mean "insert coin".

Share this post


Link to post
Share on other sites
not alive a OR not alive b OR not alive c

Better? :)

AFAIK no natural languages have would accept that as gramatical norm (even if correct). The closest translation of the count example (as I have given) is closer.

Either way (as interesting it is to debate this) we are unfortunately derailing the thread.

Edited by Big Dawg KS

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  

×