Day and Night Script

Frysning

Not a Meowstic
Veteran
Joined
Aug 14, 2015
Messages
30
Reaction score
33
First Language
Dutch
Primarily Uses
Hello Rpgmakers,

I made a script for changing the tones on specific times of the days. This works on the internal clock on your device. Switches of your choice gets turned on or off depending on the time. So you can make events that only trigger in the night.

It supports 5 tones depending on time that you can set. These tones can be activated between hours you want. You can also turn of the automatic tone system and set those tones yourself. In totaal the script supports 27 different tones!

If you want to use the based on time then set the param:

useTime to 1 if not set it to 0.

You can choice to use the tones in Battle yes or no.

useBattleTone is one of the params that you can set. 1 for true, 0 for false

A lot of things are configurable so you can easy it.

Custom Times:

If you use the automatic time system you can set the the following variables.

The times are based on 00-23 format. All of these are integers and are getting used in the script like this. Midnight runs from MignightStart to MorningStart. Morning runs from MorningStart till NoonStart and so on.

  • MidnightStart
  • MorningStart
  • NoonStart
  • AfternoonStart
  • NightStart
     
Tones:

You can create up to 27 different tones.

Tones are an array of 4 numbers. [red,green,blue,gray]  Minimum -255 & Maximum 255

  • Null_Tone this tone is used for clearing the tone.
  • Midnight_Tone this is the tone it uses for midnight
  • Morning_Tone this is the tone it uses for the morning
  • Noon_Tone this is the tone it uses for noon
  • Afternoon_Tone this is the tone it uses for the afternoon
  • Night_Tone this is the tone it uses for the night
  • Custom_Tone_0 till Custom_Tone_20 these tones are made for if you want to use a different tone.

Switches:

It is possible to set up to 5 gameSwitches. These switches are meant to use for time depending events. In the variable list you can sign them to a switch.

  • MidnightSwitch
  • MorningSwitch
  • NoonSwitch
  • AfternoonSwitch
  • NightSwitch

PluginCommands:

setTone(Tone):
With this pluging command you can set a tone. It need 1 parameter ypi can send it a string.
Example:

You want to use Custom_Tone_12 in an event. Just do setTone(Custom_Tone_12) as a plugin command.
 

clearTone

With this plugin command you can clear the current tone. Null_Tone gets used for this.

setUseBattleTone

Maybe you want for a certain fight that you need an extra tone in it or not. Well that is possible

you can on the run change if this should happen yes or no.

If call a plugin command wit setUseBattleTone(1) it will turn battletones on. if you use a 0 here it will turn it of.

setUseTime

So your game  started and the player was not bound to a time system. But on a certain part you want that this happens. Well no problem you can turn this on!

just call setUseTime(1) for activate and for deactivate use 0.

The Script

Just drop it in your plugin folder and activate it. Set the variables and have fun.

If you have any problems with it just let me know.

PS: I need to work out the help file.

Greetings.

Edit: Link re-added.
Edit: LateMoring to Morning. useTimedZone to useTime. setUseTimedZone to setUseTime
 
Last edited by a moderator:

Casia

Veteran
Veteran
Joined
May 8, 2013
Messages
313
Reaction score
54
First Language
English
Primarily Uses
Maybe a stupid question, but how can I make indoors places not have a time tint?
 

Frysning

Not a Meowstic
Veteran
Joined
Aug 14, 2015
Messages
30
Reaction score
33
First Language
Dutch
Primarily Uses
Maybe a stupid question, but how can I make indoors places not have a time tint?
There are no stupid questions!

When you enter a room use the plugin command setUseTime(0). This will turn the time of and will remove the tone.

To turn it on use setUseTime(1).
 

Casia

Veteran
Veteran
Joined
May 8, 2013
Messages
313
Reaction score
54
First Language
English
Primarily Uses
Alright, thanks. :)
 

Casia

Veteran
Veteran
Joined
May 8, 2013
Messages
313
Reaction score
54
First Language
English
Primarily Uses
Hey, I've been trying the script and have liked it really much! :) I just got a couple more questions:

Is it possible to only use four time periods instead of five and how would you go about doing it?

Also, if needed, would it be possible to change the flow of time from that of the internal clock of the gaming device to an independently flowing time?
 

Frysning

Not a Meowstic
Veteran
Joined
Aug 14, 2015
Messages
30
Reaction score
33
First Language
Dutch
Primarily Uses
Hey, I've been trying the script and have liked it really much! :) I just got a couple more questions:

Is it possible to only use four time periods instead of five and how would you go about doing it?

Also, if needed, would it be possible to change the flow of time from that of the internal clock of the gaming device to an independently flowing time?
Nice that you like it so much : D

What you can do for 4 time zones is changing the basic values.

Like this:

MidnightStart = 0

MorningStart = 6

NoonStart = 12

AfterNoon = 20

NightStart =  24 or higher. The clock only runs to 23 so over 23 will be kinda ignored.

I never thought about changing the way the internal clock works... Sorry.

I did read something about that somebody made a script that does something with time, started with orange.

Not sure about the name.
 

Sideroxylon

Veteran
Veteran
Joined
Oct 30, 2015
Messages
29
Reaction score
5
First Language
German
Nice that you like it so much : D

What you can do for 4 time zones is changing the basic values.

Like this:

MidnightStart = 0

MorningStart = 6

NoonStart = 12

AfterNoon = 20

NightStart =  24 or higher. The clock only runs to 23 so over 23 will be kinda ignored.

I never thought about changing the way the internal clock works... Sorry.

I did read something about that somebody made a script that does something with time, started with orange.

Not sure about the name.
OrangeTimeSystem is the script and it's available here: http://download.hudell.com/OrangeTimeSystem.js

I am not quite sure, if it works properly yet, because it outputs errors in the console when playtesting.
 

Fox536

Veteran
Veteran
Joined
Nov 5, 2015
Messages
173
Reaction score
60
Primarily Uses
Hey are you taking feature requests?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Demo for Maze of the Lost MZ released. I would appreciate any and all feedback and constructive criticism. If you like Dungeon Crawlers and JRPG's with a hint of Metroidvania and Shadowgate/Uninvited you might like it. https://forums.rpgmakerweb.com/index.php?threads/maze-of-the-lost-mz-demo-port-from-mv.127971/
Well, here it is, colored. :kaoslp:
Stream will be live shortly with some Darkest Dungeon! Feel free to drop by!

Forum statistics

Threads
103,388
Messages
998,954
Members
134,906
Latest member
Sikey
Top