Gw Temp

Menu

Tutorial - 'Long Calender and Weather System' by TheMightyTim

An item about RPGMaker 2000 posted on

Blurb

A very long tutorial detailing the basics of creating a date/time system and weather.

Body

Long calender and weather system

Author:TheMightyTim(www.Tmty_VdL@hotmail.com)

---------------------------------------------
1)Index:
------
1)Index
2)Introduction
3)Long calender
4)Coding long calender
5)Weather
6)Coding weather
7)Credits and thanks
8)Copyrights

--------------------
2)Introduction
--------------
Hello all, and thanks for reading this tutorial.
It is my first tutorial, and, while I hope you appreciate it, I would like to ask to not hold back on criticism.
You have my e-mailadress in case of questions about the tutorial, so state it in the subject of your e-mail.
Now, lets get this show on the road.

---------------------------------------------------------
3)Long calender
---------------
This section deals with the calender, required is:
-RM2K(3)
-Knoledge of switches
-Knoledge of variables
-Knoledge of the rm2k(3) database

I'll start with a little explanation, the calender we are going to program deals with long time-spans that can reach to thousands of years, because we would not like to annoy the player, the time may go.
First open up rm2k(3) and either create a new game, or load an old one. Then open up the database and open the tab "Common Events". Create a new event called time, make it a parallell proccess, and make it start at switch time.
Start a new timer(your own choice in rm2k3) and make it 1 second. Then add 1(or 10 to make the time go just as much faster) to variable seconds. Then create a fork condition that states that if variable seconds is 60 (or 6 if you want the time go at least 100x faster) adds 1 to variable minutes. A new fork condition makes it so that when 60 (or 6, for at least 1000x faster time) minutes have passed, 1 hour is added(the hours are going to be important later). A new fork condition should make the chaniging from 24 hours in 1 day, true. A number of 7 days makes 1 week. 4 weeks makes 1 month. 12 months, as you all know is 1 year. 10 years(or 1, for 10 000x faster time), is 1 decade. That one is often forgotten. 10(again 1 for faster time, this would make 100 000x) decades is 1 century. 10(if you want the time to go 1 000 000x faster then make 1 instead of 10) centuries is 1 millenium.
And that was all for the time.

------------------------------------------------------------
4)Coding long calender
----------------------
<>Timer Operation:Create 0m.01s.
<>VariableCh:[####:Seconds]+,1
<>FORK Optn:Varbl[####:Seconds]-60
<>VariableCh:[####:Minutes]+,1
<>VariableCh:[####:Seconds]Set,0
<>FORK Optn:Varbl[####:Minutes]-60
<>VariableCh:[####:Hours]+,1
<>VariableCh:[####:Minutes]Set,0
<>FORK Optn:Varbl[####:Hours]-60
<>VariableCh:[####:Days]+,1
<>VariableCh:[####:Hours]Set,0
<>FORK Optn:Varbl[####:Days]-7
<>VariableCh:[####:Weeks]+,1
<>VariableCh:[####:Days]Set,0
<>FORK Optn:Varbl[####:Weeks]-4
<>VariableCh:[####:Months]+,1
<>VariableCh:[####:Weeks]Set,0
<>FORK Optn:Varbl[####:Months]-,12
<>VariableCh:[####:Years]+,1
<>VariableCh:[####:Months]Set,0
<>FORK Optn:Varbl[####:Years]-,10
<>VariableCh:[####:Decades]+,1
<>VariableCh:[####:Years]Set,0
<>FORK Optn:Varbl[####:Decades]-,10
<>VariableCh:[####:Centuries]+,1
<>VariableCh:[####:Decades]Set,0
<>FORK Optn:Varbl[####:Centuries]-,10
<>VariableCh:[####:Millenia]+,1
<>VariableCh:[####Centuries]Set,0
:END Case
<>
:End Case
<>
:END Case
<>
:END Case
<>
:END Case
<>
:END Case
<>
:END Case
<>
:END Case
<>
:END Case
<>

------------------------------------------------------------
5)Weather
---------
I like this type of coding, I started to like it in my litd period. This is not commercial or something likewise. The weather is a factor with not too much people thinking about it, but it is always good for the game, I mostly like it since I have no sound. It gives me a good feeling. On the tutorial I will not get advanced, just intermediate.
Lets start. Open up the database and in Common events place a parallell process called Weather. Make it activate when a switch with the same name is active.Then make a random variable called Weatherstyle. Make it from 1(Fine) to 5(continueing).Make a Fork condition stating that at variable Weatherstyle 1, None is activated. At 2, a random variable called Force is set from 1(light) to 5(Medium).
A fork should make that if Force is lower, or equal to 3, a switch called Light Rain is activated.Otherwise 5 or lower activates switch Medium Rain, and else,switch Heavy Rain turns on.Next comes Weatherstyle 3, This activatse variable storm, wich is random fom 1 to 2. If Storm is 1, Switch storm is on.Weatherstyle 4 makes a fork condition that is, if you have used my long calender, that when variable months is 11 or bigger, it randomly changes variable snow from 1 to 4, if snow is 4, weather changes to snow hard, 3 changes weather to medium snowing, else, snow is light.
Weatherstyle 4 is fog, either from a picture(rm2k) or weather condition (rm2k3). I haven't found a solution for sandstorm yet, you have to do that yourself, it is not used in the tutorial, partially because it's so hard in rm2k.
After that make a fork that states that if switch screentone is off, that opens fork condition wich states that if variable Hours is 6 or more, that makes the screen tone R175,G075,B025,S125. With no wait. If Hours is 9 or more, screentone becomes R125,G125,B100,S100. At 18 hours or more,screentone goes to R025,G050,B075,S050.And otherwise, if the hour is diffrent from any of the herebove stated, the screen goes to R015,G035,B045,S025. And switch screentone is on. Change screen tone in buildings, And when going outside again, just turn screentone off.The just wait 15 minutes. Or less, when you made the time go more fast on the calender.Now create 4 new common events, guess, you're right! It IS for those Rain and Storm switches from a while back. The first one is Light Rain, to the same switch, that first changes to light rain, and then loops a loop of 5 seconds following the sound of light rain at a 65% of the volume, as a parallell process. Medium rain starts with changing the weather to light rain, having a number of times doing the light rain sound and the 5 second wait. Then after that, just change the weather to medium rain and loop 5 seconds after the light rain sound at 100% volume. Heavy rain starts out the same as medium rain, then after the medium rain weather is activated, it loops the sound and the waittime for a bit less times the light rain sound, and then changes to hard rain and plays the heavy rain sound followed by the 5 secounds, in a loop. The storm is almost the same as heavy rain, but in the loop, there also are flashes of light and thunder sounds.

------------------------------------------------------------
6)Credits and thanks
--------------------
Not much to write here, just ebland2 for the litd game, Don miguel and ASCII for rm2k, enterbrain for rm2k3, you for reading this, critics for their critic, so I can optimize future tutorials, God for allowing all of this, and the weather for being an inspiration.

------------------------------------------------------------
7)Copyright
-----------
All of the information contained in this tutorial is the legal information of Tim Van den Langenbergh and Gaming World. If you want to post this tutorial on another site, ask me for permission. If you want to use this in a game, be my guest, but put me in the credits. Also any violation of this agreement may and will be responded to in a court of law. Thanks for reading this.