# How do I compare variables like =1 through 50 only..?

Get help using Construct 2

### » Thu Mar 27, 2014 3:28 am

Gosh I make so many weird posts haha.

How do I compare a variable based on a set of numbers? instead of saying = to or < 50 I would like to put something like = to 50 through 100.. so any number between 50 and 100 is acceptable.

The reason I ask is because I want to have a scale of 1 through 100 and I run in to problems when I have three or four <numbers on that scale.

Thank you!
B
15
S
5
G
2
Posts: 150
Reputation: 1,965

### » Thu Mar 27, 2014 3:32 am

Just use two conditions:
Make the first one:
System:variable >= 50
System:variable <=100
B
71
S
22
G
287
Posts: 3,857
Reputation: 157,915

### » Thu Mar 27, 2014 5:56 am

blackhornet wrote:Just use two conditions:
Make the first one:
System:variable >= 50
System:variable <=100

That would work for two plots on the number line, but what If I need to use three or four?
I might end up using only two but I really wanted a little more depth. Is there any other "simple" way?
B
15
S
5
G
2
Posts: 150
Reputation: 1,965

### » Thu Mar 27, 2014 6:07 am

So you're saying have different events for like, 50, 60, 70, 80, 90, for instance? You could maybe use a for loop... I dunno if it's worth it if you don't have a lot of points though
B
19
S
10
Posts: 51
Reputation: 1,675

### » Thu Mar 27, 2014 12:51 pm

System:Compare two values
First value: Variable >= 50 & Variable <= 60 | Variable >= 70 & Variable <= 80
Comparison: Equal to
Second value: 1
B
71
S
22
G
287
Posts: 3,857
Reputation: 157,915