Is there an 'or' expression?

Get help using Construct 2

Post » Fri Oct 19, 2012 12:23 pm

I'm making a small matching game on the side and I am wondering if there is a way that I could write an expression like this:

System > Compare two values > 'Global Variable' = Equal to '1' or '2' or '5'

(then the actions follow)

because right now I'm coding it to where I have to make a system > compare for each outcome which is getting pretty tedious and it's really making my code hard to read through.

I hope this was understandable. If not, I apologize.

Thanks in advance!
Image
B
66
S
18
G
9
Posts: 547
Reputation: 13,531

Post » Fri Oct 19, 2012 1:05 pm

If you right click on the area of an event containing the conditions (but not the conditions themselves) you have the option to make it an "OR" block.
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Fri Oct 19, 2012 1:25 pm

Thanks Keepee!
Image
B
66
S
18
G
9
Posts: 547
Reputation: 13,531

Post » Fri Oct 19, 2012 3:22 pm

Apparently the "|" is set up already to act as an in line or for expressions.

Deleted incorrect example newt2012-10-19 20:41:20
Image ImageImage
B
166
S
49
G
155
Posts: 8,111
Reputation: 100,743

Post » Fri Oct 19, 2012 6:17 pm

@Newt no. Way. Wow! That makes my life that much easier!
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,669

Post » Fri Oct 19, 2012 8:40 pm

Ehh never mind. I checked again, and its just taking the first part.
Anyway thats how it worked in CC.
Perhaps @Ashley will implement it here at some point.
Image ImageImage
B
166
S
49
G
155
Posts: 8,111
Reputation: 100,743


Return to How do I....?

Who is online

Users browsing this forum: alajajm, ismael123, MuchaDev, SneakyHands and 5 guests