Gw Temp

Menu

Tutorial - 'Clock System' by robbi

An item about RPGMaker 2000 posted on

Blurb

Learn how to make a clock system that runs constantly in your game, this allows for on-the-time events depending on how fast a player gets somewhere. This ofcourse is just an example.

Body

Hello and welcome to the tutorial, so you are reading this so you can learn how to make a clock system. These systems are very useful, you can put them into your Gameplay so a certain event happens depending on how fast he gets to a certain place. For example- If the player tells to this mage before 1 hour of game play he gets a holy sword. One of the best swords in the game (make it hard to get there that fast) If they take 2 hours they might only get a potion and some things can be in between. That's one use, the other is to let the player know how long he has been playing. This can be useful so that the player can tell the creator or someone else how long it took him to finish the game. Easer to estimate the time it took to complete in a review or just as a thing to let you know how much time you have been wasting. So we can all call them sad when they spend 5 hours levelling up in a game that should take like one! :-) Let's get into it!

1. What you will need!
To make this simple I will tell you all you need now!
-A common event with a parallel process start condition
-3 Variables -
Start
Hours
Minuets
Seconds
-1 Switch - TurnOn
Some knowledge of variables, forks, show pics and events to show the result
A cms to put it into would be nice to but not necessary

2. Let's make it!
Well, what are we waiting for. Let's make it! This is a lot simpler than some people think. I'll write the code and I'll explain how it works as I go in comments-
[code]
START CODE
<>If Var (Start) = 0
<>Wait 1.0 sec
<>End fork
<>Change Var (Start) = 1
NOTE- This is just to stop the clock from starting to quick after the game starts. I have found the game to run more smoothly this way.
<>Change Var (Seconds) + 1
<>If Var (Seconds) = 60
<>Change Var (Seconds) = 0
<>Change Var (Minuets) + 1
<>If Var (Minuets) = 60
<>Change Var (Minuets) = 0
<>Change Var (Hours) + 1
<>End Fork
<>
<>End Fork
[/code]
NOTE- That's just about it for the programming part! See I told you, easy as, now to display this.

3. Display
Well, there are two ways to display the first and the better-looking way is to have a cms. I know that only some people can make them so if you have one good. If not, don't worry. We'll display it as an item. I'll explain both.

- CMS
To do it in the cms I suggest that you leave a spot in the bottom left corner of the page to display the timer in. To display it you simply have to make events there and connect them with variables. There are a few ways. You can have 1 number per event then each event only needs 10 pages but if you want the numbers closer you'll have to use 99 page events and get 99 number charasets. I know that tk's game has them in there but I don't know of others! Just hook them up to the right page and put the variables in there that corresponds with the number that is being displayed. That shouldn't be too hard!

- ITEM
For the most part, people don't have cms but they might still want this function. The way I would do it if I were you would be to make the display and item and when you use that item the numbers are displayed with a little background in the top corner. (Sorry but no, I don't have one of these to give you but you never know. I might make one) So anyway, create an item and give it to your party at the start of the game. Make the type of item a switch, then make a parallel process s common event with the start condition of that switch. Then in there you should show pic of that little timer bar up the top of the screen and the use forks to display the numbers! For example-
[code]
<>IF Var (seconds) = 1
<>Show Pic- 1- Number1- X=xxx Y=xxx
<>End fork
<>IF Var (seconds) = 2
<>Show Pic- 1- Number2- X=xxx Y=xxx
<>End fork
[/code]
And so on, I know it's a lot of work but the end result will be well worth it!

4. Conclusion
I hope that that helps you in you game. If you have any questions on this tutorial then e-mail me at angelstar233@yahoo.com or Aim me at Rpgmaker233. Well, that's it for now. I'm sure you'll see many other tutorials by me in the coming months though! :-)