Author Topic: Day/Night Cycle  (Read 2206 times)

Offline Seltzer Cole

  • Awakened Visionist
  • **
  • Posts: 92
  • LV: 8
  • Gender: Male
    • View Profile
    • Facebook
Day/Night Cycle
« on: May 29, 2012, 10:37:08 AM »
First and foremost this is a parallel process. It does not keep track of days, it just gives the game a dawn, day, dusk, and night.

This system will give you a 14 minute day/night within your game. Changing the time to more or less than 14 minutes is easy to do and I will explain that as well. Dawn is 3 minutes, Day is 5, Dusk 3, Night 5. Which = 14 Minutes.

The Common Event needed,
(click to show/hide)

Understanding the Common Event,
(click to show/hide)

Uses for this Common Event,
(click to show/hide)

The pictures needed,

(click to show/hide)

If you feel that I failed to mention anything than ask. I didn't really give a detailed description on understanding or how to add this into your game, so if you are new to the program, ask me and i'll answer. The reason you need a switch for this by the way is in case you enter a building and hate that the lights are still out at night time. This isn't apart of the idea in my game though so I didn't add that. But yeah... Thanks and bye.
« Last Edit: May 29, 2012, 10:47:43 AM by Seltzer Cole »
You know you play video games to much when you put sunglasses on and whisper "Plus 10 Appearance"

If at first you don’t succeed, call it version 1.0

Offline GrimTrigger

  • Transcended Spirit
  • ***
  • Posts: 115
  • LV: 3
  • Cutscenes.....bane of my existance.
    • View Profile
Re: Day/Night Cycle
« Reply #1 on: May 30, 2012, 02:25:23 AM »
I have a script that handles this, but this is interesting none the less. I'm starting to learn to use conditional branches and variables to perform more complicated functions, so this was useful to look at.
Until The Final Blade Falls:
Quick Side Quest Guide

Latest Tileset Project

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3255
  • LV: 298
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: Day/Night Cycle
« Reply #2 on: May 30, 2012, 02:45:24 AM »
The "Wait 20" equals 1 second.

This is only when the game is not run in Smooth Mode, which everybody does, so 40 frames equals 1 second unless you are one of them few. If you want to change it, press F1 while playing the game and change the option.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20016
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Day/Night Cycle
« Reply #3 on: May 30, 2012, 07:44:56 AM »
No, that works in events regardless. Frame rate within the game is different than frame rate that is being displayed. Smooth Mode just makes the game skip a frame during rendering, but it still takes that frame into account during calculation. So basically in events it's always 20 (because in events it's actually every other frame, it's made like that in the scripts) and in the scripts it's 40 regardless of Smooth Mode.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam

Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.