Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

Click here to join us on IRC (#charas on irc.freenode.net)!



  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Rahl's Day/Night Tutorial
« previous next »
  • Print
Pages: [1]

Author Topic: Rahl's Day/Night Tutorial  (Read 2615 times)

Offline Rahl

  • Lord Of Gamedwellers
  • Leader
  • *
  • Posts: 2,356
Rahl's Day/Night Tutorial
« on: April 22, 2009, 04:26:34 PM »
After some demand for a good Day/ Night tutorial, I have decided to make one:

Have you ever been in a game where the sun is shining 24/7? Why not add some reality to your game, and give it a day and night system. In the following tutorial I will show you how to make this work for your own game.

The first thing you must do is make 3 different Common Events in your game database. First you must decide how long you want your days and nights to be. For the purposes of this tutorial I have decided to make each last 3 minutes each. Now you must creat 2 switches, one called "Day" and one called "Night". And next at the beginning of your game you should decide wether you want it to start in the day or at night. After deciding place a switch operations command in the scipt at the beginning of the game to the corresponding switch of your choice to ON.

In the following 2 images you will see that it is a parallel process and will first tint your screen to the appropriate level of light. Then there are 3 wait 60 sec commands (3 minutes) and then the screen begins to tint to either darken or blacken depending on the time of day. As an effect after it tints so much I added a sound effect, at dawn a rooster crows and at night a gong sounds. From there is continues to darken to the way it will stay for the rest of the night/day. Aftter the final tintning is complete the script will turn off the current event and on the other and from there the event will loop around from day to night.




Now in most games creaters have a place where the player can rest and heal. But how would look if you went to sleep during the day and woke at the same time of that day? Well thats why I have included this common event that can bee called when you wish your player to be able to sleep, or you just wish the day or night to pass in general.

The first bits can be changed to suit your needs, but well fits a sleeping event. First it askes yes or no, then if yes a sound effect plays the screen tints to black and branches from day to night switching on and off the appropriate operations and tinting the screen once more to its appropriate color.

Logged



Offline Rson_DeLarge

  • is apparantly
  • Associate
  • *
  • Posts: 111
  • is not an
Re: Rahl's Day/Night Tutorial
« Reply #1 on: April 28, 2009, 02:26:38 AM »
yay, a good day and night tut returns!
I don't want to sound critical but I have a few pointers

1.
I suggest using one of the timers to keep track of the time for you.
that way you can pause it and turn off the switches when there is a cutscene or a part of the game where you don't want the night/day transition to take place. like say near a castle of the undead where it's always night *cough zelda cof*
and when you unpause it  it will resume from whatever point of day.

2.
 you might want to think about putting dusk/twilight in there too. it feels weird going from bright day to black and blue night without a more subtle state. this would be easy to do, essentially you make a third switch and event the same as day/night
Logged
Quote from: luvjay0918 on April 30, 2009, 07:48:15 AM
The games were from that themes was good and they can make a enjoyment to the player..

Offline A Forgotten Legend

  • Your neighborhood box of colors
  • Royal
  • *
  • Posts: 4,428
    • Website
Re: Rahl's Day/Night Tutorial
« Reply #2 on: April 28, 2009, 02:51:37 AM »
This is very basic.  So, good for the starting programmer in rm2000/2003.

There are some more advanced one, that have dusk and twilight, but I think this will do.
Logged

Offline Rson_DeLarge

  • is apparantly
  • Associate
  • *
  • Posts: 111
  • is not an
Re: Rahl's Day/Night Tutorial
« Reply #3 on: April 28, 2009, 03:17:09 AM »
true, But systems that go on through out the game can really discourage you when you screw them up and realize it after building most of the game around said systems...

well, it's there. so you can take into consideration the timer and dusk elements or not.
to each their own.
Logged
Quote from: luvjay0918 on April 30, 2009, 07:48:15 AM
The games were from that themes was good and they can make a enjoyment to the player..

Offline Rahl

  • Lord Of Gamedwellers
  • Leader
  • *
  • Posts: 2,356
Re: Rahl's Day/Night Tutorial
« Reply #4 on: April 28, 2009, 02:15:19 PM »
Nothing I make is meant to be something your game is built on, but rather building blocks for people to learn and begin depend on themselves and rely on thier own coding.
Logged



  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Rahl's Day/Night Tutorial
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum