Gw Temp

Menu

Tutorial - 'Day and Night system' by GaZZwa

An item about RPGMaker 2000 posted on

Blurb

GaZZwa is here to teach you all the tricks of creating day and night in your game.

Body

Here we are, the simplest way I know to make a day and night system in Rm2k.

---The first few seconds---
Ok first of we need a starter event, something to get time rolling! I'd say in the first room that you have control of your character, create a new event. Make it have no graphics and auto-started. Create a new action - 'Timer Operations' Now select set from the operation box. Next where it says Set: _____ mins _____ secs put in the amount of time you want a 'day' to last. (not counting the night!) Click ok afterwards. Now create another action - 'Timer Operations' - again. This time do start from operations box. In the bottom box put a check next to anything that fits your ideas. Finally create one more action that turns a switch entitled - 'Day' - On!
[SAMPLE CODE]
<>Timer Operation:Cost Creat0m30s.
<>Timer Operation:StartTmr
<>Change Switch: [0014:Day]-ON Set
End Case"
[END OF SAMPLE]

---From Dawn to Dusk---
Ok this next step calls for the use of common events! Goto the database and select - "Common Events"! Select 0001 and give it the name Day Ending or the like. Set the event start cond. to Parallel Process. Put a check in the next box and select the day switch. Now create a new action - 'Fork Conditions...' (it's in the 3rd tab) Select the bubble next to timer. Fill in the blanks like so: '__0 mins __0 secs' Click OK. Between where it says 'FORK' and 'EXCEPTING' put a new action - 'Setscreen Tone' Adjust the sliders until the darkness meets your requirments. Now create a new action that sets the timer to how long you want the night to be. Next change a new switch "Night" to ON. Then make an action that starts the new timer. Finally Make a action that turns off the switch "Day". Remember all of this should go between 'FORK' and 'EXCEPTING'!
[SAMPLE CODE]

<>Fork Optn:Timer - 0m.00s.Less
<>Set Screen Tone:(R000.G070.B070.S090).4.0sec(W)
<>Time Operation:Cost Creat0m.30s.
<>Change Switch: [0015:NIGHT]-ON Set
<>Timer Operation:StartTmr
<>Change Switch: [0014:DAY]-OFF Set
<>
:Excepting Case
<>
:End Case
<>

[END OF SAMPLE]

---The Sun rises once again!---
Now right click somewhere in the action box and click select all. Now right click and hit copy. Now create a new Common Event:
Name - Night Ending
Paralell Process
Switch - Night is on
Now that it is set-up, paste in the actions from the previous event into this new event. Now edit the Set Screen tone and put the values back to normal. Have the time set to the length of day. Now change the first switch modifier to change - Day on! (NOT NIGHT OFF ~ Personal experience warning, turning of the night or day switch is ALWAYS last.) Finally change the 2nd switch changer to turn off the night switch.
[SAMPLE CODE]

<>Fork Optn:Timer - 0m.00s.Less
<>Set Screen Tone:(R100.G100.B100.S100).4.0sec(W)
<>Time Operation:Cost Creat0m.45s.
<>Change Switch: [0014:DAY]-ON Set
<>Timer Operation:StartTmr
<>Change Switch: [0015:NIGHT]-OFF Set
<>
:Excepting Case
<>
:End Case
<>

[END OF SAMPLE]

---Optional Enhancements
--Clock--
Ok to create a clock you need to start out by creating a new event that will occur on push key. The first action should be a fork that checks to see if switch 'day' is on. Now between where it says fork and excepting create another fork action! This time have it check the timer. My advice is to pick to check if it's above half way through the day (i.e. if your day lasts 50sec then set this to 25sec) Now you could stop the clock here (the day half of it at least) by putting a message above the new excepting line that says something like 'It's mid-morning!' and below it saying 'It's mid-afternoon!' Or you could take it a step further with 2 more forks one below and one above the timer forks exception line. To do the night half of the clock, do the same thing you did for the day half except put this below the day checking fork's exception.
[SAMPLE CODE]

<>Fork Optn:Switch [0014:DAY]- ON
<>Fork Optn:Timer - 0m.25.Over
<>Messg:It's morning!
<>
:Excepting Case
<>Messg:It's mid afternoon!
<>
:End Case
<>
:Excepting Case
<>Fork Optn:Timer - 0m.20s.Over
<>Messg:It's early in the night...
:Excepting Case
<>Messg:It's very early morning!
<>
:End Case
<>
:End Case
<>

[END OF SAMPLE]

--Random Weather Effects--
Ok first goto your common events editor and goto your event called 'day'. Insert a new switch modifier right after the first 'Fork Optn.' Have it turn 'OFF' a new switch called 'rain!' (we'll get to how this switch turns on in just a second!) Right under that switch do a new action: 'Call Weather Effect.' Set it to none and then click ok. Next, insert a new switch action right between where it says 'change switch: [night]-on' and 'Timer Operation:StartTmr' Have it turn on a switch called 'Is it raining?' to on. Our new day event will look something like this:
[SAMPLE CODE]
<>Fork Optn:Timer - 0m.00s.Less
<>Set Screen Tone:(R000.G070.B070.S090).4.0sec(W)
<>Time Operation:Cost Creat0m.30s.
<>Change Switch: [0015:NIGHT]-ON Set
<>Timer Operation:StartTmr
<>Change Switch: [0014:DAY]-OFF Set
<>
:Excepting Case
<>
:End Case
<>


[END OF SAMPLE]
Do these steps again to the common event: 'night'.
Now for the complicated part! Create a new common event called 'Rain?'. Set it to Parallel Event and to have a conditions switch of 'Is it raining?' Now create an action: 'Change Variable'. Under Create Variable pick 'one' and make a new variable called random rain. Set operation to set. For operand pick 'Rand.' and put __1__ * __100__. Click ok. Now create a 'fork conditions' that opperates off of a variable. Choose the rain variable and type in a number 1-100 in the blank. ( bigger number = less rain ) choose above in the other box. Now create an action that calls the weather effect (of your own choosing) in between where it says fork and Excepting. Then make a switch changer that turns on 'raining' right under it. Finally right under that create a trigger that turns off the switch 'raining?' You're done!
[SAMPLE CODE]


<>Variable Op:[0003:random rain] Set, Randm[1*100]
<>Fork Optn:Varbl[0003:random rain]-75Over
<>Set Weather Effect: Ra, Mi
<>Change Switch: [0040:rain!]-On Set
<>Change Switch: [0039:raining?]-OFF Set
<>
:Excepting Case
<>
:End Case
<>


[END OF SAMPLE]

If you have any problems at all, email me at GaZZwa@aol.com or GWmail me...I am GaZZwa. If you find that after doing this your character can't move, then just use a switch at the end of the event. Thanks, and I wish you success with your game.