Gw Temp

Menu

Tutorial - 'Seamless Day/Night System' by Guest

An item about RPGMaker 2000 posted on

Blurb

It's another day/night tutorial with weather effects, but this tutorial shows you how to temporarily stop the effects when you're indoor (so you won't have indoor rain).

Body

Everyone would love to have a Day/Night system in their RPG, but no one seems to be able to figure out how to get it to shut off the process when you go inside. I have the solution.

I've always been looking for a decent day/night system. I found Baron_Osiris', and it looked good enough to try out, so I entered the code just as he said, and I came out with a pretty good looking system. However, I couldn't for the life of me figure out how to get it to shut off while you're inside, but still make the day pass while your inside. I sat and wondered for a good 2 whole weeks, and earlier today, I came up with the solution.

I'm using mostly Baron_Osiris' coding, so I give all props to him.

We need 5 switches:
Day
Dusk
Night
Dawn
Outside

First go to your Common Events tab in the Database menu, and call the first event "DAY/NIGHT SWITCHES", or something of the sort. Make it a parallel process, but no Trigger Switch (This makes it so it runs even while inside). It's easier if I just show you the coding, I'm not good at explaining:

<>Switch Operation: [####:Day] ON
<>Wait: 90.0 Sec
<>Switch Operation: [####:Day] OFF
<>Switch Operation: [####:Dusk] ON
<>Wait: 90.0 Sec
<>Switch Operation: [####:Dusk] OFF
<>Switch Operation: [####:Night] ON
<>Wait: 90.0 Sec
<>Switch Operation: [####:Night] OFF
<>Switch Operation: [####:Dawn] ON
<>Wait: 90.0 Sec
<>Switch Operation: [####:Dawn] OFF
<>Switch Operation: [####:Day] ON

Next, make another event and call it "DAY/NIGHT CHANGE" (or again, something of the sort), make it a parallell process with a trigger switch [####:Outside], and put in this code:

<>Branch if Switch [####:Dusk} is ON
<>Tint Screen (R100,G070,B040,S120),30.0 Sec (Wait)
<>
:End
<>Branch if Switch [####:Night} is ON
<>Tint Screen (R020,G040,B080,S120),30.0 Sec (Wait)
<>
:End<>Branch if Switch [####:Dawn} is ON
<>Tint Screen (R080,G080,B100,S100),30.0 Sec (Wait)
<>
:End<>Branch if Switch [####:Day} is ON
<>Tint Screen (R100,G100,B100,S100),30.0 Sec (Wait)
<>
:End

That takes care of the common events. The next part is tedious. On your world map, make an event that is a parallel process, and have it turn on switch [####:Outside]. Now, for every event that teleports you inside, have it turn of switch [####:Outside] and set screen tone to 100 for everything. You might want to use the "Create Teleport Event" command when you do this (if using RM2k3), I'm not sure if the "Hide Screen" makes any difference, but you can try. Do this for every event that teleports you inside a building (or any area that the outside light does not effect).

Next, for every event that takes you back outside, have it turn switch [####:Outside] back on, and copy the exact code from the "DAY/NIGHT CHANGE" Commen Event, except have all the screen transistions take 0.0 Sec and no Wait. It should look like this:

<>Hide Screen: Use Default
<>Branch if Switch [####:Dusk} is ON
<>Tint Screen (R100,G070,B040,S120),30.0 Sec (Wait)
<>
:End
<>Branch if Switch [####:Night} is ON
<>Tint Screen (R020,G040,B080,S120),30.0 Sec (Wait)
<>
:End<>Branch if Switch [####:Dawn} is ON
<>Tint Screen (R080,G080,B100,S100),30.0 Sec (Wait)
<>
:End<>Branch if Switch [####:Day} is ON
<>Tint Screen (R100,G100,B100,S100),30.0 Sec (Wait)
<>
:End
<>Teleport: ???, Retain Facing
<>Show Screen: Default

Hopefully, you're reading this tut at the start of your game, that way you don't have too many events to add coding to.

With all that done, you have now created your own seamless Day/Night system. If you have any questions as to why I did what I did above, let me explain.

Baron_Osiris did a decent job with his Day/Night system, but it wasn't complete. Even if you were to set the screen tone back to normal when you went inside, the process would still continue, meaning all you did was interupt it. And if you had the Commen Event have a trigger switch, time would stand still when you were inside. With this tutorial, I sepreated the screen tinting and the delay between them to 2 seperate events, that way time continues to pass even when you are inside (first Commen Event), but you don't see the effects of it (second Common Event). This also opens up the ability to have events that only appear during a certain time of day while inside. Say you want a group of animals to only take shelter in a cave during the night. That does involve a bit of coding I don't want to get into, but I'm sure you can figure it out, or someone will help you with it.

I want to give most of the credit of this tut to Baron_Osiris. If it had not been for his tut originally, I would not have spent endless amounts of time going gaga over how to make it work. Who knows, maybe I'll try to figure out how to get is Random Rainfall to work like this. Remember, if I, a newb, can do this, anyone can. Perhaps I should be a motivational speaker...