And/Or conditions

Get help using Construct 2

Post » Mon Dec 24, 2012 1:36 am

How do you have multiple and/or conditions for an event? As is, I can either set all the conditions to be AND, or I can set them all to be OR. I want (X AND Y) to be TRUE OR (B AND C) to be TRUE. That's 4 conditions, 2 AND's and 1 OR.

Is this possible?
B
3
Posts: 11
Reputation: 347

Post » Mon Dec 24, 2012 1:44 am

I have found no way to do it in a single event check. You can try to work it with a sub event check.
B
88
S
18
G
9
Posts: 2,455
Reputation: 14,928

Post » Mon Dec 24, 2012 2:08 am

Well that's annoying. That's a very basic programming function... :(
B
3
Posts: 11
Reputation: 347

Post » Mon Dec 24, 2012 3:34 am

Better you create separated events
B
111
S
30
G
28
Posts: 3,107
Reputation: 27,645

Post » Mon Dec 24, 2012 8:56 am

Yeh, you can work around it with more events but it's a bit clunky. Hope they plan to add this in the future.
B
29
S
12
G
2
Posts: 482
Reputation: 4,843

Post » Mon Dec 24, 2012 9:12 am

I think Im doing what you mean.

if
Time = 2
And
Tool = 1

else

if
Time = 0
And
Tool = 0


Bit more complicated than a combination out of AND and OR but better than nothing.   
B
15
S
6
G
6
Posts: 512
Reputation: 5,555

Post » Mon Dec 24, 2012 1:03 pm

Yeah that might work. But it means having several actions instead of just the one. :(
B
3
Posts: 11
Reputation: 347

Post » Mon Dec 24, 2012 1:16 pm

It's actually pretty difficult to even design a feature where you can make an event like (A AND B) OR (C AND D). It requires some way of putting brackets in to a list of conditions, and I can't imagine that being intuitive or easy to use. That's why we went with a simple OR-block style condition.

The best solution is just to use two separate events, and call a function in both events. That saves you having to repeat the actions twice.
Scirra Founder
B
373
S
218
G
84
Posts: 23,465
Reputation: 186,192


Return to How do I....?

Who is online

Users browsing this forum: DanielSP, Draconiz717, Kenthria, lamar, nanogod, ridhoemgl, Robinours17 and 9 guests