How do I Create OR block

Get help using Construct 2

Post » 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
11
S
3
G
1
Posts: 411
Reputation: 1,766

Post » 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
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Sun Feb 15, 2015 12:21 am

Image

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.
Image
B
14
S
3
G
1
Posts: 61
Reputation: 993

Post » Sun Feb 15, 2015 12:30 am

I would need something like this
Image
B
11
S
3
G
1
Posts: 411
Reputation: 1,766

Post » 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
109
S
41
G
20
Posts: 1,586
Reputation: 18,996

Post » Sun Feb 15, 2015 12:52 am

Thank you linkman2004 , this look like good alternative.
B
11
S
3
G
1
Posts: 411
Reputation: 1,766

Post » 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
51
S
24
G
6
Posts: 391
Reputation: 7,820

Post » 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

Post » 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
35
S
8
G
3
Posts: 135
Reputation: 2,840

Post » Sun Feb 15, 2015 1:04 pm

thank you guys, got it working :-)
B
11
S
3
G
1
Posts: 411
Reputation: 1,766

Next

Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Google [Bot] and 9 guests