How do I use 'AND' and 'OR' conditions together?

Just started using Construct 2? Post your questions here

Post » Sat Mar 05, 2016 1:46 am

Basically I want to test something along the lines of

'If Cond1 AND Cond2 are both true, OR if Cond3 by itself is true, do something.'

Or in other words, '(true && true) || true'

As far as I can tell, I'm only able to turn an entire block into a bunch of single OR conditions.
B
20
S
5
Posts: 23
Reputation: 1,283

Post » Sat Mar 05, 2016 3:14 am

A simple way would be to put the 'do something' part in a function, and have two separate events. Or just copy the actions again in both events.

Cond1 is true | call DoSomething()
Cond2 is true |


Cond3 is true| call DoSomething()
Mistakes were made.
B
52
S
26
G
109
Posts: 1,607
Reputation: 61,635

Post » Sat Mar 05, 2016 3:37 am

You can go old-school with Compare two values:
First value: (Cond1 & Cond2) | Cond3
Comparison: equal to
Second value: 1

Example: (value1 = 2 & value2 = 3) | (value3 = 99) "equal to" 1
ImageImageImage
B
71
S
22
G
240
Posts: 3,734
Reputation: 133,994

Post » Sun Mar 06, 2016 3:12 am

Oh well. I was hoping there'd be a way to set it up without just having another entire block of actions.

Thanks anyways.
B
20
S
5
Posts: 23
Reputation: 1,283


Return to Beginner's Questions

Who is online

Users browsing this forum: gyurto and 1 guest