# Using "And" Conditions

Status
Not open for further replies.

#### Miles111

Level 8
This is probably the most noobish-question I've ever asked, but if you put a bunch of conditions on the conditions part of a trigger, without putting them in an "And - Multiple Functions" function, do all conditions still need to be true in order for the trigger to continue?

#### Dr Super Good

Spell Reviewer
Level 64
Convert an example trigger to JASS and perform a manual follow through of the script it produces. All will be revealed then.

If I recall placing multiple conditions in a condition block defaults to the same behaviour as logical and. The reason for the and block is for nested logic such as and components making up an or block.

Ultimatly it is far easier to use JASS for such logic as there you can just declare a comparator between 2 booleans.

#### Maker

Level 37
These two work the same way, all conditions need to be true. Don't use the first method, it add an unneeded AND.

• Untitled Trigger 018
• Events
• Conditions
• And - All (Conditions) are true
• Conditions
• 1 Equal to 2
• ((Triggering unit) is A structure) Equal to True
• (Unit-type of (Triggering unit)) Equal to Footman
• Actions
• Untitled Trigger 018
• Events
• Conditions
• 1 Equal to 2
• ((Triggering unit) is A structure) Equal to True
• (Unit-type of (Triggering unit)) Equal to Footman
• Actions

#### -Kobas-

Level 39
and is same like * in math, while or act like +

Let's think like this:
TRUE = 1 (or any other number that isn't 0)
FALSE = 0

example 1:
true and true and true and false = false
1*1*1*0 = 0

example 2:
false or true or false = true
0 + 1 + 0 = 1

Any result that will give you 0 will be false (everything else from 0 = true).

http://en.wikipedia.org/wiki/Boolean_algebra_(logic)
Don't use wiki for study just for exploring.

#### WaterKnight

Level 26
And is only used when you are restricted to give a single condition like in group matching condition picks or when you have an Or structure and want to unite two or more conditions to be an operand of the Or.

• Or - Any (Conditions) are true
• Conditions
• 1 Equal to 0
• And - All (Conditions) are true
• Conditions
• 0 Equal to 0
• 2 Equal to 0
This will return false because the And-block evaluates false (0 is equal to 0 but 2 is not) and 1 is not equal to 0, either. If it was, true would result.

Status
Not open for further replies.

Replies
4
Views
657
Replies
2
Views
337
Replies
3
Views
377
Replies
4
Views
633
Replies
8
Views
1K