Main Menu
  • Welcome to The RPG Maker Resource Kit.

AG- Day and Night system

Started by Alerith, December 11, 2006, 10:11:52 PM

0 Members and 1 Guest are viewing this topic.

Alerith

This is incredibly easy. I dont see why everyone keeps asking for a script.

Step 1: Create a Common Event for your time triggers.
Step 2: Create a switch that will activate the common event. (Ex: Switch 001: Daynight)
-----------------------------------------------------------------------

First create an event in the map where the game starts. Set it to Auto Start then put the following events in:

Switch Operation: 001: Daynight is ON
Erase Event

Now that that is done, go into the common event and enter the following:

[Loop]
Tint screen: -87, -87, -87, transition frames: 40
Wait: 999 frames.
Tint Screen: 0, 0, 0, transition frames: 40
[End Loop]


Your first command will be to loop the event over and over so that it continues through your game.

Your second command is going to be to tint the screen. Take all the colors down to -87ish. That will be sufficient for night.

Your third command will be to wait 999 frames. This is plenty of time for day and for night.

Your fourth command will be to tint the screen again. Take all colors back to 0 each. This will return the tint to the normal screen brightness.

----------------------------------------------------------------------------------

If you want certain events to happen during day or night, then you do this:


[Loop]
Trigger Operation: 002: Daylight is OFF
Tint screen: -87, -87, -87, transition frames: 40
Trigger Operation: 002: Nighttime is ON
Wait: 999 frames.
Trigger Operation: 002: Daylight is ON
Tint Screen: 0, 0, 0, transition frames: 40
Trigger Operation: 002: Nighttime is OFF
[End Loop]


This way, you can set certain events to only be active when the nighttime or daytime switches are active, therefore allowing you to make events corresponding to day and night.

This also works if you want to create a werewolf system for your character. (*hint hint*)

Crystal Collection - On hold.

FF:Dark Symphony - 12%
Demo: May 10th, 2007

Cheal

Looks awesome! I'm definetly going to try this out.  ;D


Got no good story ideas? Try using Seventh Sanctum. It's got millions of generators for things you might need.

Alerith

Sorry, one thing I forgot to mention:

If you want day or night to last longer, just add more wait commands. 999 is the limit per command, but you can add as many 999 (or whatever value you need) as you want until you get it to the length you want.
Crystal Collection - On hold.

FF:Dark Symphony - 12%
Demo: May 10th, 2007

Cheal

I kind of figured that was the case...

Anyways, this seems a whole lot easier than the scripts I've seen. Again, good job!  ;D


Got no good story ideas? Try using Seventh Sanctum. It's got millions of generators for things you might need.

J-Crew

There's no doubt that this is a good tutorial, but I think you should describe how to do certain events at set times. I'm eager to hear some of your ideas. And don't you think the events add too much lag to your game?

Blizzard

#5
It's a nice idea, but the event code for your DNS is ruggish.

[Loop]
Trigger Operation: 002: Daylight is OFF
Common Event: Wolf
Tint screen: -87, -87, -87, transition frames: 40
Trigger Operation: 002: Nighttime is ON
Wait: 999 frames.
Trigger Operation: 002: Daylight is ON
Common Event: Human
Tint Screen: 0, 0, 0, transition frames: 40
Trigger Operation: 002: Nighttime is OFF
[End Loop]


If I wait 990 frames and change the map the counter will go from the beginning again. Sorry, but I don't think this is a good tutorial, because it's not sophisticated.

@J-Crew: My DDNS was once common-event-based. It had like 10 times more commands and that in 3 different common events (so 30 times more event code) and it didn't lag. Right now I have quite a few common events and quite some scripts working during the map scene and I don't have lag. Of course I am also using an Event-Anti-Lag System.
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.



Get DropBox, the best free file syncing service there is!

Alerith

Quote from: Blizzard on December 12, 2006, 01:38:59 PM
If I wait 990 frames and change the map the counter will go from the beginning again. Sorry, but I don't think this is a good tutorial, because it's not sophisticated.

Your absolutely right. I never really counted like that. When your playing the game, you won't really notice, but I guess since we are all game designers, it sticks out pretty bad.

Thanks for pointing that out.
Crystal Collection - On hold.

FF:Dark Symphony - 12%
Demo: May 10th, 2007

Blizzard

No problem. We're all here to help each other. :)
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.



Get DropBox, the best free file syncing service there is!