# Why "Yes"..Why "No" ?

Get help using Construct 2

### » Tue Nov 18, 2014 8:46 pm

....& also doubles as logical AND, and | is a logical OR operator

.These are useful combined with the comparison operators,
score < 0 | health < 0, which also return 1 if true and 0 if false...

https://www.scirra.com/tutorials/77/nat ... onstruct-2

see the capx..

is not supposed to be the opposite?
what's wrong with my logic?
You do not have the required permissions to view the files attached to this post.
B
67
S
24
G
7
Posts: 1,519
Reputation: 11,084

### » Tue Nov 18, 2014 8:57 pm

The manual is just saying that 1 means true, so when considering the comparison:

A) if score<0 then this part would be true (1)
B) if health<0 then this part would be true (1)
C) by adding the OR (|) then if EITHER A=1 and/or B=1 then the overall outcome would be true(1)
B
9
S
3
G
1
Posts: 346
Reputation: 1,560

### » Tue Nov 18, 2014 9:06 pm

Thanks,hundredfold !
so.. there is no way to make something like ..

Var1 | Var2 | Var3 =100 then.... something
B
67
S
24
G
7
Posts: 1,519
Reputation: 11,084

### » Tue Nov 18, 2014 9:08 pm

If you mean that any one of Var1, Var2 OR Var3 needs to be 100 then just use this as your condition:

Var1=100 | Var2=100 | Var3=100
B
9
S
3
G
1
Posts: 346
Reputation: 1,560

### » Tue Nov 18, 2014 9:33 pm

....I refuse to understand....
why this not work
You do not have the required permissions to view the files attached to this post.
B
67
S
24
G
7
Posts: 1,519
Reputation: 11,084

### » Tue Nov 18, 2014 10:08 pm

Because the following : "Variable1|Variable2|Variable3" will resolve as "0|50|100", which in turn resolve as "1". 1 is not equal to 100, so your event never fire.

The correct way to do it is as hundredfold said : (Variable1 = 100 | Variable2 = 100 | Variable3 = 100) = (1)
B
80
S
33
G
27
Posts: 1,027
Reputation: 21,114

### » Wed Nov 19, 2014 9:29 am

Ok..Ok..
I know how to make "Or" blocks in C2...
I just think it would be much better if the character " | =Or " ... could use a similar like " &=And"

Thanks... hundredfold... Magistross!
. .. resolved
You do not have the required permissions to view the files attached to this post.
B
67
S
24
G
7
Posts: 1,519
Reputation: 11,084