Jump to content
Sign in to follow this  
_qor

How many conditions can I set?

Recommended Posts

Hey there,

I have asked myself about how many various conditions I can set for example in a trigger's condition.

It seemed to me that if I have a condition like unit_x in thislist I couldnt add another condition like west countSide <= 5.

>>unit_x in thislist AND west countSide <=5

The usual reason would be that I still dont get the scripting right but I often had problems with that.

This is only an example, I can update it when I found out at which point it wasnt possible to me...

So is there an answer to the question? Is it possible to have multiple various conditions and if, are there certain rules?

Or in general, can I add about 50 conditions to a trigger hypothetically?

Edited by _qoR

Share this post


Link to post
Share on other sites

There is no limit I know of, the only rule that applies here is that your condition has to be logically evaluated, so if the commands you use in the condition field neither return a bool, nor a value you can compare against to, the whole condition field will fail to evaluate.

I saw several postings of trigger conditions where people has something like this:

alive h1 && alive h2 && alive h3 ............................ && alive h50

And it worked without problems (I mean this is not the correct way of doing it, but it worked!).

In your particular case, you're using the countSide command wrong :D It's that simple ;)

http://community.bistudio.com/wiki/countSide

Share this post


Link to post
Share on other sites

Okay I was afraid of those answers :P

First of all, what is wrong with the code above? Especially because it works as you said.

 west CountSide thislist <5 AND abc = true

I guess thats kinda code which didnt work...

so if the commands you use in the condition field neither return a bool, nor a value you can compare against to, the whole condition field will fail to evaluate.

Can you explain the sentence more detailed? "A value you can compare against to"? Bool means, that it is a variable which is either true or false, right?

I am trying to get deeper into the scripting language and have to really comprehend those circumstances!^^

Edited by _qoR

Share this post


Link to post
Share on other sites

Well you could compare a number to another number: 5 > 1, 1 == 2 .... the result will be a boolean.

You could also compare objects: player == vehicle player ... also results in boolean.

But trying to compare an object with a number will fail, because these are two different things and can't be compared.

Nothing new to you I guess, it all boils down to either using boolean operators or commands which return booleans.

What is, however, possible, is using commands like sleep in conditions as they either won't count towards the boolean comparison or return implicitly true.

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  

×