jezebelthenun

Veteran
Veteran
Joined
Sep 24, 2014
Messages
99
Reaction score
113
First Language
English
Primarily Uses
RMMV
Hi all,  Today I have a question about using if else statements in conditional branches.  I'm using a basic day/time system, and I'd like to have 3 different screen tints for different times of day.  Normal for day, sunset for the hours between 6 and 8 pm, and then dark for night.  How would I implement that in the conditional branch?

This is what I tried, but it flashes from sunset to dark and back again over and over after 8pm.

If : Hours >= 18


     Tint Screen : (68,-34,-34,0), 60 frames (Wait)


     If : Hours >= 20


     Tint Screen : (-68,-68,0,68), 60 frames (Wait)


     :End


:Else 


     Tint Screen : (0,0,0,0), 60 frames (Wait)

How do I use an if else in a conditional branch or check for a variable that's within a range?  I'm not a scripter to any degree so it doesn't make sense to me.

Thanks
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,196
Reaction score
15,546
First Language
English
Primarily Uses
RMMV
Code:
If Hours >= 20
  Tint Screen (-68,-68,0,60)
Else
  If Hours >= 18
    Tint Screen (68, -34, -34, 0)
  Else
    Tint Screen (0, 0, 0, 0)
  End
End



This should be in a parallel processing event, and at the end of the event you should do Erase Event.  You don't want it constantly running while you're on the map, tinting it to the tint that's already applied.  This is one of the big mistakes people make that causes significant lag.
 

Ryzler

Princess in Distress
Veteran
Joined
Dec 15, 2016
Messages
84
Reaction score
130
First Language
English
Primarily Uses
RMMV
What about when they're inside? Do you have the screen tint return to normal?
 

jezebelthenun

Veteran
Veteran
Joined
Sep 24, 2014
Messages
99
Reaction score
113
First Language
English
Primarily Uses
RMMV
@Shaz I knew it was something simple that I was being dumb about!  Thanks.  I swear, I've done this type of eventing with no issues before, and my brain just stopped working.

@Ryzler I'm only putting the event with the tint change on outdoor maps, so everything indoors will always look normal.
 

Ryzler

Princess in Distress
Veteran
Joined
Dec 15, 2016
Messages
84
Reaction score
130
First Language
English
Primarily Uses
RMMV
@jezebelthenun But when you enter an indoor map, the screen tiny will remain from the outdoor map. So you need an event on the indoor map that changes the tint back to normal
 

jezebelthenun

Veteran
Veteran
Joined
Sep 24, 2014
Messages
99
Reaction score
113
First Language
English
Primarily Uses
RMMV
Well then, I guess I'll put an event changing the tint to normal on all indoor maps.  Thanks!
 

Latest Threads

Latest Posts

Latest Profile Posts

aww man, color hex code #C4C4C4 doesn't work for the tint value in this scene I need something darker, which stinks just because I liked that one it was my favorite plastic explosive three times...#696969 (nice) should work better (WHY IS MY BRAIN LIKE THIS)
Tell it to me straight, doc. If I've been trying to piece together a "shorter" game to learn stuff outside of game jams... am I just running away from my WIP? :v
Well, I've got a party tomorrow, and my friends are coming over. I wanted to work a bit on the Fandom Scouts assets so I can be ready when that update arrives... in other news, Pizza Time Horror is getting a second teaser, and it shows Cabaret Helen's last performance before the location closed.
Also who used to be scared of Chuck E as a kid? I was! Now I love him!
The new cards and what they do:

(I am clearly not a youtuber... Haha)

Forum statistics

Threads
117,273
Messages
1,106,043
Members
153,449
Latest member
Cxsr
Top