# How do I Create OR block

Get help using Construct 2

### » Sat Feb 14, 2015 11:53 pm

Hi i know how to create Or block, but it doesnt work as i would need, it separates every condition. What i need is 3 conditions OR another 3 conditions. is it possible?
B
15
S
4
G
1
Posts: 439
Reputation: 2,024

### » Sun Feb 15, 2015 12:18 am

That is how Or works. You could use 2 subevents depending on what you trying to do it should work
B
43
S
17
G
2
Posts: 850
Reputation: 6,234

### » Sun Feb 15, 2015 12:21 am

I have not experimented with any logic more than simple if x = y kind of commands as yet. Someone else might have a more elegant solution.
B
14
S
3
G
1
Posts: 61
Reputation: 1,023

### » Sun Feb 15, 2015 12:30 am

I would need something like this
B
15
S
4
G
1
Posts: 439
Reputation: 2,024

### » Sun Feb 15, 2015 12:37 am

There's no way in C2 to create an or-block like that. It seems like an arbitrary limit, and I'm unaware of why the limit exists.

One way around it is to split your groups of conditions into separate events with duplicated actions, using an else at the beginning of each event after the first to prevent the same actions from running more than once. Another is to simplify your logic. For example, in your picture you have:

(Platform is falling AND is doubleJump) OR (Platform is jumping AND is doubleJump)

which is logically equivalent to:

Is doubleJump AND (Platform is falling OR Platform is jumping)
Moderator
B
115
S
41
G
20
Posts: 1,586
Reputation: 19,196

### » Sun Feb 15, 2015 12:52 am

Thank you linkman2004 , this look like good alternative.
B
15
S
4
G
1
Posts: 439
Reputation: 2,024

### » Sun Feb 15, 2015 3:48 am

While were on topic on the 'Or' I question this logic let say if you need A+B=C or A+D=C instead of creating two event for the same outcome we really need A+B or D = C. Have you brought it up to the creator because i once was able to do this but i cannot figure out how i was able to do it.

Because in many puzzle like game being able to be flexible in how you decide makes the content a bit fresh and user friendly controlled instead of Master game only.
B
52
S
24
G
6
Posts: 391
Reputation: 7,855

### » Sun Feb 15, 2015 10:04 am

Gearworkdragon wrote:While were on topic on the 'Or' I question this logic let say if you need A+B=C or A+D=C instead of creating two event for the same outcome we really need A+B or D = C. Have you brought it up to the creator because i once was able to do this but i cannot figure out how i was able to do it.

Because in many puzzle like game being able to be flexible in how you decide makes the content a bit fresh and user friendly controlled instead of Master game only.

You could do
or_expression.png
You do not have the required permissions to view the files attached to this post.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

### » Sun Feb 15, 2015 10:42 am

If i'm not mistaken then this is what you're looking for.
At least i think it would work in your case.

or-block.png

I know that it's not possible to have 3 seperate conditions within an OR block with another 3.
But i'm sure you can work it out using a different way using sub events.

Because actually you should never require multiple checks within one Or block.
Because that can always be added at the top as a first check before going to the actual OR block. (as you can see in the example above)

So if you require any more AND checks, just at them add the first sub event.
You do not have the required permissions to view the files attached to this post.
B
42
S
8
G
3
Posts: 159
Reputation: 3,074

### » Sun Feb 15, 2015 1:04 pm

thank you guys, got it working
B
15
S
4
G
1
Posts: 439
Reputation: 2,024

Next