Gw Temp

Tutorial - 'Time/Night/Day and Random Weather System' by Statix

An item about RPGMaker 2000 posted on

Blurb

The name tells it all. Statix explains you how to make one.

Body

Hello... this is my first tutorial here so give me some pointers. I'm going to do it step by step so you will understand better, because that is the key to this tutorial.

Knowlege required:
Forks
Variables
Switches
Random Variable Rolls

Overview:
This is a night and day system that includes random weather and lightning effects. Each hour the weather in a certain area will be re-rolled. Each roll is out of 10 so you can set your chances of weather by multiples of 10%. This weather system allows for seperate weather types in different areas, for example in the desert you can have a chance of a sandstorm and no chance of snow. While in the mountains it can be the complete opposite. The time is in 24 hour time and you can have locked doors at certain hours of the day and NPCs that only talk to you at a certain time of the day because all the time is done in a seperate variable for days/hours/minutes. Now let's get started...

Chapter 1: The Time

1) Go into the database/common events and create a new common event. Call it "Time" parallel process
2) Wait event "1.0" Sec
3) Variable change (New variable: minutes) +1 (In your game minutes will be rl secconds)
4) Fork: If (var) "minutes" is 60 or more (No Else)
-- 1) Inside the fork create a new switch, call it "Hour Change" and turn it on
-- 2) Variable change (New variable: Hours) +1
-- 3) Variable change (minutes) = 0
-- 4) End fork
5) Fork: If (var) "hours" is 24 or more
-- 1) Variable change (New variable: Days) +1
-- 2) Variable change (hours) = 0
6) Fork: If (var) "days" is 0
-- 1) Variable change (days) = 1

Your time event is now finnished! Lets create a event now to tell the time
1) Create a new normal map event call it anything
2) Fork: If (var) "minutes" is 9 or less (With Else) (This is for if the time is example: 2:09 we want it 2:09 not 2:9)
You must understand this next step here. To show a variable in an message you must use the prefix \V[] in the []s you must put the variable number of the variable you wish to show, so in the following step you must put the number that you asigned for what the name I say is in the brackets
-- 1) Show message: The time is \V[Hours]:0\V[Minutes] On day \V[Days]
-ELSE
-- 2) Show message: The time is \V[Hours]:\V[Minutes] On day \V[Days]
Your time system is now complete, going on to the weather

Chapter 2: The Weather Roll

What I mean by "The Weather Roll" is the event that does the chance of certain weather in a certain area

1) Create a new normal map event "Parallel Process" requires the switches "Hour change" and New switch: "Effect" (Effect is the switch used for the weather and lightning so if you dont want the weather on, in a cutscene etc. you can just turn effect off) Give it an invisible chara
2) Create a new variable and call it "Weather Roll" Variable change (weather roll) set random number between 0 and 9
3) This part is a little confusing, follow along closely:
Fork: If (var) "Weather Roll" = 0
-- Set weather: Rain, Medium
-Else
--Fork: If (var) "Weather Roll" = 1
---- Set Weather: Rain, Medium
--Else
----Fork: If (var) "Weather Roll" = 2
------Set Weather: Rain Medium
----Else
------Fork: If (var) "Weather Roll" =3
--------Set Weather: Rain Medium
------Else
--------Fork: If (var) "Weather Roll" =4
----------Set Weather: Rain Medium
--------Else
----------Fork: If (var) "Weather Roll" =5
------------Set Weather: Snow Medium
----------Else
------------Fork: If (var) "Weather Roll" =6
--------------Set Weather: Snow Medium
------------Else
--------------Fork: If (var) "Weather Roll" =7
----------------Set Weather: Snow Medium
--------------Else
----------------Fork: If (var) "Weather Roll" =8
------------------Set Weather: Snow Medium
----------------Else
------------------Fork: If (var) "Weather Roll" =9
--------------------Set Weather: Snow Medium
End all
Switch change (Hour Change) off

Now I will explain what all that does... You must understand this part if you are to use the weather system
Like I said above you will have weather chances in multiples of 10%. Each of those forks above is a multiple of 10%. At this point your event has 50% chance of medium rain and 50% chance of medium snow. This is because there is 5 forks filled with the snow and 5 forks filled with the rain. What would you do to make it have 20% snow and 80% rain? Right you got it 8 forks filled with rain and 2 forks filled with snow. IF YOU DO NOT UNDERSTAND THIS RE-READ ABOVE AND LOOK AT THE FORKS MORE CAREFULLY

Chapter 3: Lightning

1) Now I will show you how to add random lightning effects to your weather system. Create a new common event call it "Lightning" parallel process and make it require the switch "Lightning"
2) Fork: If (switch) "Effect" on
-- 1) Variable change (New variable: Lightning Roll) set random number between 0-3
-- 2) Yep more forks
----Fork: If (var) "lightning roll" =0
------Play Sound: "(Any lightning sound of your choice)"
------Wait 10.0 sec
------Flash screen "Yellow" "Flash Once" "0.5 secs"
------Shake Screen "Shake Once" "1.0 secs" "Strength: strong" "Speed: med"
----Fork: If (var) "lightning roll" =1
------Play Sound: "(Any lightning sound of your choice)"
------Wait 15.0 sec
------Flash screen "Yellow" "Flash Once" "0.5 secs"
------Shake Screen "Shake Once" "1.0 secs" "Strength: strong" "Speed: med"
----Fork: If (var) "lightning roll" =2
------Play Sound: "(Any lightning sound of your choice)"
------Wait 20.0 sec
------Flash screen "Yellow" "Flash Once" "0.5 secs"
------Shake Screen "Shake Once" "1.0 secs" "Strength: strong" "Speed: med"
----Fork: If (var) "lightning roll" =3
------Play Sound: "(Any lightning sound of your choice)"
------Wait 5.0 sec
------Flash screen "Yellow" "Flash Once" "0.5 secs"
------Shake Screen "Shake Once" "1.0 secs" "Strength: strong" "Speed: med"
End All
Wait 5.0 sec

How to use them in the weather event
1) Go back to your weather roll event from chapter 2
2) Go into any of the forks you want to have a chance of lightning in
3) Add the following to the bottom of that fork (It doesn't matter if that fork already has rain or another weather effect in it)
Varaible change (Weather Roll) random number between 0 and 1 (50% chance of lightning)
Fork: If (var) "Weather Roll" = 0
--Switch change (lightning) on

If you are using lightning in your weather roll event then add the following to the VERY top
Switch change (lightning) off

Chapter 4: The Night and Day

1) New common event "Night/Day" parallel process
2) Fork: If (switch) "effect" is on
3) Fork: If (var) "hours" = 4
--Tint screen (appropriate tint for 4 in the morning)
Else
----Fork: If (var) "hours" = 8
----Tint screen (appropriate tint for 8 in the morning)
Continue this process for each hour interval where you want to change the tint
Else (From "effect" fork)
Tint screen (to all normal, for cutscenes)

Copy your weather roll event to all your maps and change to forks to what you need, if you have any questions e-mail me at p_andrew_@hotmail.com (or msn) or you may simply reply here of course

Hopefully this helped! Tell me if you have any problems because I could have typed something incorrectly, not noticing it when I proofread. If you cannot get this to work and would rather just have a game sent to you with it already in it email me as well.

You should start out your game with an event that turns the switches "Effect" and "Hour Change" on so you will have weather.

-Statix