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
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

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
96
S
25
G
20
Posts: 3,055
Reputation: 22,644

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
22
S
6
G
1
Posts: 398
Reputation: 3,384

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,550

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
359
S
214
G
72
Posts: 22,952
Reputation: 178,600


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests