Quote: —› quit: (JonathanOfDrain) (Quit: SHOWAH CHECKZ ...
blade2k » articles & tutorials

jump to:
Tutorials » Game Creation » RPG Maker 2000

Complete date system


Reading Article
Author: Lindiu
Posted on 07/09/2010
Date system counting hours, days, weeks, months and years, plus huge possibilities of adding weather system.

F

First of all, I know someone else has done a tutorial about a dating system, which looks almost the same. I'm just using a different technique and only variables, without any switches.

So here's my tutorial. If you use this method, I'm asking you to give the credit to the good person. Anyway, hope that helps you!

First of all, we need to determine the number of seconds it'll take to make one hour. In the case of my game in progress, I'm using 30 seconds.

Then, let's not forget to set all our variables. Here's my list:
[0001]: Hour Count - Used to calculate the number of hours past.
[0002]: Day Count - Used to calculate the number of days past.
[0003]: Week Count - Used to calculate the number of weeks past.
[0004]: Month Count - Used to calculate the number of months past.
[0005]: Years Count - Used to calculate the number of years past.

Then, you'll need two slots in the Hero tab. These slots will be used to put the name of your months, weeks, everything you like. The number of slots corresponds to the number of things you want to be named. In my case, the weeks and months.

Here's my list:
[0001]: Week Name
[0002]: Month Name

Alright, everyone's ready? Let's do it. I'll explain every single part of my work so if you want to change any parameter, the choice will be yours.


-------------- Part 1 --------------
THE HOURS TURNING INTO DAYS

<>Wait: 30.0s
<>Variable Change: [0001 Hour Count] + 1
<>FORK Variable [0001 Hour Count] = 24
<>Variable change: [0001 Hour Count] set, 0
<>Variable change: [0002 Day Count] + 1

So, I'll explain every line now.
- The wait 30 seconds represents an hour. You can change the number so your hour last 60 seconds, 15 seconds, depending on how fast you want days to past.

- The Hour Count + 1 means that every time the Wait is complete, it adds an hour. So, if it's 6 o'clock, and the Wait is complete, it'll now be 7 o'clock

- The fork condition represents the number of hours needed to make a day. Change the = 24 to any number you want so yours days can last, like 40 hours or anything.

- The Hour Count set to 0 means the day restart.

- The Day Count + 1 means a day has past.


-------------- Part 2 --------------
TURNING DAYS INTO WEEKS

<>FORK Variable [0002 Day Count] = 8
<> Variable [0003 Week Count] + 1
<> Variable [0002 Day Count] set, 1

- The fork condition represents the number of days needed to complete a week. Why is it equal to 8? because we reset the day count to 1, not to 0. Which means that the 8th day is the first day of the new week. This means that a week represents 7 days in this case ( a normal week). You want to change how many days there are in a week? Pick the number you want and add + 1. It'll work, trust me.

- Week Count + 1 means a new week starts.

- Day Count = 1 means you restart that new week at day one.

The logic behind this: The 7th and last day of a real week is Saturday. When the 8th day starts, we now know it's Sunday right? But isn't Sunday also the first day of a week?.... Got it?


-------------- Part 3 --------------
TURNING WEEKS INTO MONTHS

Same things goes on:

<>FORK Variable [0003 Week Count ] = 5
<> Variable [0003 Week Count] set, 1
<> Variable [0004 Month Count] + 1

Just refer to the last explanations to understand how this works. You want to know if you got it last time? Well these codes representrs that there's 4 weeks in a month.

If that last sentence got you wrong, try to find your mistake in Part 2.


-------------- Part 4 --------------
TURNING MONTHS INTO YEARS

THe last part of these great codes:

<>FORK Variable [0004 Month Count] = 14
<> Variable [0004 Month Count] set, 1
<> Variable [0005 Year Count] + 1

Exact same thing as before. Last time, to see if you understood well. How many months in one years in this part? Yep, 13!

After this, it's over for counts. There's no years turning into anything in my game. But.. If you want your world to have MEGA YEARS, that last 25 years, well just follow this method to add it.

-------------- Part 5 --------------
THE NAMES OF WEEKS AND MONTHS

You want to add names of months, weeks, days in your game? Names that would be dynamic? You have a NPC that always tells the exact date, but you don't want him to say continuously "Its January"? Well, here's how to do it.

First of all, choose all the names you need and write them on a piece of paper nearby.

Then, here it goes:

<> FORK Variable [0003 Week Count] = 1
<> Change Hero name: Week Name -> Onose
<>
ELSE CASE
<> FORK Variable [0003 Week Count] = 2
<> Change Hero name: Week Name -> Mayl
<>
ELSE CASE
<> FORK Variable [0003 Week Count] = 3
<> Change Hero name: Week Name -> Cajja
<>
ELSE CASE
<> FORK Variable [0003 Week Count] = 4
<> Change Hero name: Week Name -> Tsin
<>


So here's how to create this:
You create 3 fork conditions with Else Cases, and one without. You place each of them into the Else Case of the last one, leaving the Elseless one at the end. For the rest, I think you can manage it on your own. If you want, you can do the exact same thing for every months, or anything else you want. Hope that helped you.

Now, if you want, you can give a NPC the following message:

<>Messg: Right now, it's \V[0001] o'clock,
:day \V[0002] of \N[0001].
:It's \N[0002] of the year \V[0005]

Which will give in game something like:

Right now, it's 13 o'clock,
day 6 of Cajja.
It's Rose-Mere of the year 10986.

Got it?

Don't forget to give back credit to the one who owns them, and watch for my next tutorials if you liked this one!