Simple Operator Question

Get help using Construct 2

Post » Tue Jun 18, 2013 10:40 pm

I've been using Construct 2 for quite a while and I can't believe I don't know how to do this, but does anyone know how to create an event statement that functions as

If "Global variable" = 1 OR 2 OR 3 OR 4

im trying to figure out how to accomplish an event statement that included multiple values for a certain global variable
B
4
Posts: 16
Reputation: 232

Post » Tue Jun 18, 2013 11:49 pm

Logical Or is the pipeline symbol " | " (Y)
B
55
S
17
G
9
Posts: 634
Reputation: 9,273

Post » Wed Jun 19, 2013 12:03 am

I've tried the statement
Day=0

If Day = 1 | 2 | 3 | 4
          Then Go to Layout "gameday"

But it only works when day=1 and never 2 3 4
Am i doing it wrong?
B
4
Posts: 16
Reputation: 232

Post » Wed Jun 19, 2013 1:09 am

Those operators are meant to be used inside expessions and not really that useful in this case.

You can make an event block into an OR block by adding two conditions (in your case 4), then selecting the event block and pressing Y on the keyboard. (or right click)

You could also check if the variable is less than 5 by adding a "System -> Compare variable" condition and selecting "Less than" in the dropbox.

There are many ways to do it, but those should do the trick for you.Nimtrix2013-06-19 01:11:23
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Wed Jun 19, 2013 2:37 am

I Never knew about the or block function!!
Thank you!
B
4
Posts: 16
Reputation: 232


Return to How do I....?

Who is online

Users browsing this forum: alajajm, imhotep22 and 11 guests