Conditions contain a list of statements which will be checked. The logic of the Condition only applies to the list of statements.
In an OR-Condition, only one contained statement needs to be true for the OR-Condition to return true.
In an AND-Condition every contained statement needs to be true for the AND-Condition to return true.
example:
AND{
-Statement 1
-Statement 2
-Statement 3
}
-> Statement 1,2 and 3 need to be true. The statements will be checked in the order as they appear in the list. If one returns false, the whole AND returns false.
OR{
-Statement 1
-Statement 2
-Statement 3
}
-> Statement 1,2 or 3 needs to be true. The statements will be checked in the order as they appear in the list. If all return false, the OR returns false.
Every action that can contain conditions represents an AND-condition. For example while, if-then-else, ... So their list of conditions uses is connected with an AND already. So you don't need to add an AND to connect multiple statements.
I think that your problem is the "Tier", even tho I don't know what exactly it is, because I always work with the german editor and I can't find the tier condition just in the second, or the picked integer. The complete trigger would be very helpful.
Additionally you don't need extra "Or"s after each seperate condition. It just use more memory space.
And you can shorten the whole thing if you take "Math - Modulo (integer)": Tier of Player mod 10 == 1.
The issue is slightly more complex and it's caused by lazy implementation of GUI's IF and similar functions
You see in programming you can't do something like IF (A B C). You can only do IF (A and/or B and/or C).
Yet GUI allows multiple conditions without anything between them.
Question is: "What is between conditions by default". It's AND
Now Furthermore your single OR it's not actually OR in code. It is only with 2+ conditions.
OR and AND with single condition is equal to condition itself without anything. Something like OR(true) can't exist itself. As you saw before OR and AND are between conditions.
Could someone post a screenshot where 'and' conditions and 'or' conditions are used correctly? I can't get them working.
Conditions contain a list of statements which will be checked. The logic of the Condition only applies to the list of statements.
In an OR-Condition, only one contained statement needs to be true for the OR-Condition to return true.
In an AND-Condition every contained statement needs to be true for the AND-Condition to return true.
example:
AND{
-Statement 1
-Statement 2
-Statement 3
}
-> Statement 1,2 and 3 need to be true. The statements will be checked in the order as they appear in the list. If one returns false, the whole AND returns false.
OR{
-Statement 1
-Statement 2
-Statement 3
}
-> Statement 1,2 or 3 needs to be true. The statements will be checked in the order as they appear in the list. If all return false, the OR returns false.
Every action that can contain conditions represents an AND-condition. For example while, if-then-else, ... So their list of conditions uses is connected with an AND already. So you don't need to add an AND to connect multiple statements.
Usually you need to add only "OR"s. "AND" is rarely needed because if you have multiple conditions AND isnt needed to check.
On attached picture my trigger checks that unit type of triggering unit is Infested Colonist Hut AND Owner of that unit is player 4.
For complicated condition sets (victory conditions, for example) I will sometimes split up AND groups with an OR statement. Here's a logical example:
In this basic example, the game will end if Player 1 is both dead and can't revive OR if Player 2 is both dead and can't revive.
I think he literally meant "How to use them".
New people often don't understand that you add conditions under the new arrow coming from AND,OR
Or and And are just like any condition, only that you put normal conditions inside them.
I know how to use conditions, I'm not that new. Is just can't get it to work. For example, if I set up a condition like this, it won't work.
Is there anything wrong with this setup?
EDIT: I ofcourse have a pick each integer action before the if then else action.
EDIT2: AND conditions aren't of any more use than Bashar's example, are they?
I think that your problem is the "Tier", even tho I don't know what exactly it is, because I always work with the german editor and I can't find the tier condition just in the second, or the picked integer. The complete trigger would be very helpful.
Additionally you don't need extra "Or"s after each seperate condition. It just use more memory space.
And you can shorten the whole thing if you take "Math - Modulo (integer)": Tier of Player mod 10 == 1.
@Zanryu1337: Go
"Tier of player" is an integer variable. Thanks for the tip about mod, didn't think to use it here.
Then you have to show us the section where you set the variable. Maybe there are some interferences or something.
@Zanryu1337: Go
After I implemented the modulo things started working
modulo thing here is a more of a tip because you use 1, 11 and 21.
for conditions, even tho it was explained many times i will give it last shot:
Based on this your want to check if any of those is TRUE? So this will be correct:
in pseudo-code it looks like
Now to answer why your example didn't work.
The issue is slightly more complex and it's caused by lazy implementation of GUI's IF and similar functions
You see in programming you can't do something like IF (A B C). You can only do IF (A and/or B and/or C).
Yet GUI allows multiple conditions without anything between them.
Question is: "What is between conditions by default". It's AND
Now Furthermore your single OR it's not actually OR in code. It is only with 2+ conditions.
OR and AND with single condition is equal to condition itself without anything. Something like OR(true) can't exist itself. As you saw before OR and AND are between conditions.
So in the end what you did was:
That's also why your modulo single condition did work because it didn't cause AND between anything.
And for sake of complete explanation how GUI creates Conditions and other multiple variable code