Range values for Variable?

Hello everyone,
Is there a way to create an event which works with a value-range of a variable?
I'll be more specific. What I need is the last step to create a day/night system. I created a variable for hours. I then set that at 8 it will turn day, at 18 sunset, at 20 night and finally at 6 dawn. It only works in outdoor maps of course. My problem is that if I'm indoor and then go outside at 23 for example, it will be day, as i missed the moment of shift where hour was equal to 20. What I want to do is set a common event which says 8<hour<18 it will be day, 18<hour<20 sunset and so on.
I really hope everything is comprehensible because I'm really stuck here...
Thank you!!
8<hour<18
This can be modeled as nested Conditional Branches.

Conditional Branch: Hour > 8
. Conditional Branch: Hour < 18
. . Do something...
. End
End
no need for an extra common event.

in the event that counts your time, each time the variable is counted up you test with conditional branch if it passed one of the limits and if yes, you set another variable or a group of switches or whatever you need to the values for that span.
thank you all for the quick answer!
8<hour<18
This can be modeled as nested Conditional Branches.

Conditional Branch: Hour > 8
. Conditional Branch: Hour < 18
. . Do something...
. End
End

This solution is so easy I feel dumb ;D
no need for an extra common event.

in the event that counts your time, each time the variable is counted up you test with conditional branch if it passed one of the limits and if yes, you set another variable or a group of switches or whatever you need to the values for that span.

That's what I tried at first, but the day/night overlapped. In fact, if hour is for example H=15, it will both run H>5 (dawn) and H>7 (day).
You should not. feel dumb @Alessandro Alberti. Everything has a learning curve, you are doing fine and you were right to have such a question.
😛
Another thing now, try not to double post, just edit a post of yours if you wanna add something instead. 🙂
You are not in trouble but I have to pop up this blue text for this, so I will be fair with everyone. It has also a convenient link to the forum rules. 😉
Double-post notice: @Alessandro Alberti


Finally, is your case solved? Did you managed to make it work?
You should not. feel dumb @Alessandro Alberti. Everything has a learning curve, you are doing fine and you were right to have such a question.
😛
Another thing now, try not to double post, just edit a post of yours if you wanna add something instead. 🙂
You are not in trouble but I have to pop up this blue text for this, so I will be fair with everyone. It has also a convenient link to the forum rules. 😉
Double-post notice: @Alessandro Alberti


Finally, is your case solved? Did you managed to make it work?

Thank you for the support, the cycle is now working perfectly!
Also, I'm sorry for breaking the rules. Will not happen again!!
As I told you already, it's all right. 🙂
You are a new user, welcome aboard, blue text is automatically generated, we use it so you can also get the link on the rules.

Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/range-values-for-variable.109341/