Advanced Time and Environment System (ATES)Authors: Blizzard, ThallionDarkshineVersion: 1.1Type: Time and Weather SystemKey Term: Custom Environment System

Introduction

You all know Blizz's old time system, the ATES. Well, I saw it in his dev pack, and saw that he had never finished implementing all the planned features. So, I decided to finish it for him. This system adds a time and weather system to games that can be turned on and off at will. Every aspect of the script is configurable, from the time system, to the weather system, and even the clock hud.

The time system allows you to create multiple times of day, each with their own unique and configurable tint. At any point within the day, the script will interpolate between the two closest times of day to create the current tint. In turn, these times of day will fall at different times throughout the year. You can set the values for the longest and shortest days of the year, and the script will determine the current times by interpolating between these.

The weather system gives you lots of options, allowing you to customize the bgs, fog, weather effect, and even effects like thunder with screen flashes and sound effects. Each weather effect can be assigned a severity, which influences the likelihood that they will occur. More on this when I talk about seasons. You can also configure a range of durations for each weather effect. When a weather effect starts, a random value in the range will be chosen for its duration.

Both the tint and the weather effects are influenced by the player's current location (outside, inside, or inside a dark place). When outside, all tint and weather effects will be applied at full force. When inside, the engine weather effects (rain, snow, etc) and fog effects will not be applied, and sounds and tints will be dampened. When inside a dark place, everything is the same as for inside, except the screen tint will be set to a fixed configurable value.

The year is divided into seasons set up in the configuration. Each season has a defined temperature range, probability of weather, bad weather, and very bad weather, and set of weather possibilities.

You can also configure various terrains that can influence various aspects of the system. Each terrain has a defined range of temperature modifiers, and a set of weather effect exclusions.

You can create holidays, which have essentially no effect besides changing certain lines of text in the clock. Each holiday can either be defined by date or by a position within the month (i.e. first monday, second to last thursday, etc).

Finally, the clock is fully configurable, and gives you a wide range of information to pull from and various methods to display it. For instance, you can display either the weekday name (replaced by the holiday if applicable) or the weekday abbreviation. More on these in the instructions in the script.

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=# Advanced Time and Environment System (ATES) by Blizzard and ThallionDarkshine# Version: 1.1# Type: Autonomous Timeflow and Environment Controller# Date v0.3: 11.3.2008# Date v0.31: 8.4.2009# Date v0.32: 13.4.2009# Date v0.33: 4.5.2009# Date v0.34: 5.5.2009# Date v1.0: 12.2.2013# Date v1.01: 28.4.2013# Date v1.02: 20.3.2015# Date v1.1: 18.12.2017#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=# # This work is protected by the following license:# #----------------------------------------------------------------------------# # # # Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported# # ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )# # # # You are free:# # # # to Share - to copy, distribute and transmit the work# # to Remix - to adapt the work# # # # Under the following conditions:# # # # Attribution. You must attribute the work in the manner specified by the# # author or licensor (but not in any way that suggests that they endorse you# # or your use of the work).# # # # Noncommercial. You may not use this work for commercial purposes.# # # # Share alike. If you alter, transform, or build upon this work, you may# # distribute the resulting work only under the same or similar license to# # this one.# # # # - For any reuse or distribution, you must make clear to others the license# # terms of this work. The best way to do this is with a link to this web# # page.# # # # - Any of the above conditions can be waived if you get permission from the# # copyright holder.# # # # - Nothing in this license impairs or restricts the author's moral rights.# # # #----------------------------------------------------------------------------# #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=# # Compatibility:# # 99% compatible with SDK v1.x. 90% compatible with SDK 2.x. WILL corrupt old# savegames. Can cause incompatibilty issues with DNS-es.# # # Features:# # - complete control over and easy manipulating of time and weather# - customizable day and night tinting# - HUD clock optional# - easier to control and more powerful than DDNS# # # IMPORTANT NOTES:# # - This system has a working preconfiguration, be aware that a custom setup# will need you to understand what each option does, so please read the# configuration instructions.# - Why does this system use switches to determine whether it's day or night?# Simple: You can use conditions in enemy attacks to determine whether an# attack should be used only at night or only at day.# # # Instructions:# # - Explanation:# # This Time System will make your game have daytime and nighttime periods.# The screen will be tinted accordingly. You can set up the length of the# day. Other features are explained below. Please be sure to configure this# system appropriately.# # # - Basic manipulation of ATES:# # This system is based upon your eventing. It will work basically if you# want, but with a little bit of using the "Call Script" event command you# are able to control this system fully. You can call following commands:# # On/Off Controls# ------------------------------------------------------------------------------# ATES.on# Turns ATES on.# # ATES.off# Turns ATES off.# # ATES.tint_on# Turns ATES's screen tinting on.# # ATES.tint_off# Turns ATES's screen tinting off.# # ATES.clock_on# Turns ATES's clock display on.# # ATES.clock_off# Turns ATES's clock display off.# # ATES.weather_on# Turns ATES's weather system on.## ATES.weather_off# Turns ATES's weather system off.# ------------------------------------------------------------------------------# # Time Controls# ------------------------------------------------------------------------------# ATES.advance(M, H)# This will make the time advanced by M minutes and H hours. Any negative# value used will cancel the execution of this command.# # ATES.make_it_day# This is a feature from DDNS which allows you to quickly jump to the# daytime.# # ATES.make_it_night# This is a feature from DDNS which allows you to quickly jump to the# nighttime.## ATES.set_time(TIME_INDEX or TIME_NAME)# Sets the current time to the time at the index of TIME_INDEX or with the# name of TIME_NAME. Its better to use TIME_NAME because some bugs may occur# from using TIME_INDEX.# ------------------------------------------------------------------------------# # Weather Controls# ------------------------------------------------------------------------------# ATES.lock_weather# This allows you to lock the current weather in place without disabling the# weather system entirely.## ATES.unlock_weather# This command unlocks the current weather.## ATES.set_weather(INDEX)# Sets the current weather to the weather at index INDEX.# ------------------------------------------------------------------------------## Location (inside/outside) Controls# ------------------------------------------------------------------------------# ATES.go_inside# A feature from the DDNS which allows you to change the lighting mode to# inside.## ATES.go_inside_dark# A feature from the DDNS which allows you to change the lighting mode to# inside dark.## ATES.go_outside# A feature from the DDNS which allows you to change the lighting mode to# outside.# ------------------------------------------------------------------------------## Terrain Controls# ------------------------------------------------------------------------------# ATES.terrain=(TERRAIN_NAME)# Sets the terrain to the terrain named TERRAIN_NAME.# ------------------------------------------------------------------------------# # Conditionals# ------------------------------------------------------------------------------# ATES.active?# Returns true if ATES is turned on, otherwise false.# # ATES.tinting?# Returns true if ATES tinting is turned on, otherwise false.## ATES.weather_active?# Returns true if the weather system is turned on, otherwise false.# # ATES.day?# Returns true if it's day, otherwise false. Alternatively you can check the# assigned switch instead.# # ATES.night?# Returns true if it's night, otherwise false. Alternatively you can check# the assigned switch instead.# ------------------------------------------------------------------------------## Getters# ------------------------------------------------------------------------------# ATES.time_name# Returns the name of the current time of day.# ------------------------------------------------------------------------------# # - Enhancement hints:# # If you wish to implement the DDNS further into your game and e.g. allow# different behavious of monsters during day and night, you only need to# check the the state of the appropriate switch. e.g. If NSWITCH is turned# on inflict "Sleep" on one enemy. The same is true for temperature (check# TVARIABLE) and weather (check WVARIABLE).# # # Additional info:# # - The daytime and nighttime tintings were tested appropriately and optimal# tinting is being used.# # - Keep in mind that all aspects of the ATES are initially turned off, so# you'll have to use the commands ATES.on, ATES.tint_on, ATES.clock_on, and# ATES.weather_on to enable the components.# # - Further instructions can be found in the script database topic:# http://forum.chaos-project.com/index.php/topic,12869.0.html# # If you find any bugs, please report them here:# http://forum.chaos-project.com#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

# Perform some simple checks of the config if ATES::MONTHS.size > ATES::MONTHDAYS.size raise 'ATEScfgError: Not all months have a length in days specified!' elsif ATES::LENGTH < 36 raise 'ATEScfgError: A day\'s length must be equal to or greater than 36 seconds!' end

# loop through the times of day to determine where the current time falls for i in 0...@current_times.length time1 = get_time(@current_times[i][2], @current_times[i][1]) time2 = get_time(@current_times[(i + 1) % @current_times.length][2], @current_times[(i + 1) % @current_times.length][1]) current = get_time(@time.min, @time.hour) if time2 < time1 time2 += 24 * 60 end if current < time1 current += 24 * 60 end

treign

Been working on a game for a couple months. Been using this script, and got myself a bug.First i'm running in this order, Letter by Letter Message Window : Tons of Add-ons 7.65b : Easy LvlUp Notifier 1.21b : Stormtronics CMS 5,51b : ATES 1.01 : Battle Memory Commands v1.3The issue is with ATES and with tone change i believe. The error i get is....

It happens when i'm in a town/map and the weather changes to clouds and i exit out to the world/map using the transfer player event.

If the weather don't change i don't get the error when i leave. I'm coping and pasting the script as it sits in my game below. I can't for the life of me figure this out and can't find a solution anywhere.

I was going to use the old 0.4 script i used back in the day but the script link as 404'd.

Help is appreciated. Ill check back tomorrow night for any reply's

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=# Advanced Time and Environment System (ATES) by Blizzard and ThallionDarkshine# Version: 1.01# Type: Autonomous Timeflow and Environment Controller# Date v0.3: 11.3.2008# Date v0.31: 8.4.2009# Date v0.32: 13.4.2009# Date v0.33: 4.5.2009# Date v0.34: 5.5.2009# Date v1.0: 12.2.2013# Date v1.01: 28.4.2013#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=# # This work is protected by the following license:# #----------------------------------------------------------------------------# # # # Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported# # ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )# # # # You are free:# # # # to Share - to copy, distribute and transmit the work# # to Remix - to adapt the work# # # # Under the following conditions:# # # # Attribution. You must attribute the work in the manner specified by the# # author or licensor (but not in any way that suggests that they endorse you# # or your use of the work).# # # # Noncommercial. You may not use this work for commercial purposes.# # # # Share alike. If you alter, transform, or build upon this work, you may# # distribute the resulting work only under the same or similar license to# # this one.# # # # - For any reuse or distribution, you must make clear to others the license# # terms of this work. The best way to do this is with a link to this web# # page.# # # # - Any of the above conditions can be waived if you get permission from the# # copyright holder.# # # # - Nothing in this license impairs or restricts the author's moral rights.# # # #----------------------------------------------------------------------------# #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=# # Compatibility:# # 99% compatible with SDK v1.x. 90% compatible with SDK 2.x. WILL corrupt old# savegames. Can cause incompatibilty issues with DNS-es.# # # Features:# # - complete control over and easy manipulating of time and weather# - customizable day and night tinting# - HUD clock optional# - easier to control and more powerful than DDNS# # # IMPORTANT NOTES:# # - This system has a working preconfiguration, be aware that a custom setup# will need you to understand what each option does, so please read the# configuration instructions.# - Why does this system use switches to determine whether it's day or night?# Simple: You can use conditions in enemy attacks to determine whether an# attack should be used only at night or only at day.# # # Instructions:# # - Explanation:# # This Time System will make your game have daytime and nighttime periods.# The screen will be tinted accordingly. You can set up the length of the# day. Other features are explained below. Please be sure to configure this# system appropriately.# # # - Basic manipulation of ATES:# # This system is based upon your eventing. It will work basically if you# want, but with a little bit of using the "Call Script" event command you# are able to control this system fully. You can call following commands:# # ATES.on# Turns ATES on.# # ATES.off# Turns ATES off.# # ATES.tint_on# Turns ATES's screen tinting on.# # ATES.tint_off# Turns ATES's screen tinting off.# # ATES.clock_on# Turns ATES's clock display on.# # ATES.clock_off# Turns ATES's clock display off.# # ATES.active?# Returns true if ATES is turned on, otherwise false.# # ATES.tinting?# Returns true if ATES tinting is turned on, otherwise false.# # ATES.day?# Returns true if it's day, otherwise false. Alternatively you can check the# assigned switch instead.# # ATES.night?# Returns true if it's night, otherwise false. Alternatively you can check# the assigned switch instead.# # ATES.advance(M, H)# This will make the time advanced by M minutes and H hours. Any negative# value used will cancel the execution of this command.# # ATES.make_it_day# This is a feature from DDNS which allows you to quickly jump to the# daytime.# # ATES.make_it_night# This is a feature from DDNS which allows you to quickly jump to the# nighttime.# # ATES.weather_on# This allows you to turn on the weather system.## ATES.weather_off# This allows you to turn off the weather system.## ATES.lock_weather# This allows you to lock the current weather in place without disabling the# weather system entirely.## ATES.unlock_weather# This command unlocks the current weather.## ATES.weather_active?# Returns true if the weather system is turned on, otherwise false.## ATES.set_time(TIME_INDEX or TIME_NAME)# Sets the current time to the time at the index of TIME_INDEX or with the# name of TIME_NAME. Its better to use TIME_NAME because some bugs may occur# from using TIME_INDEX.## ATES.go_inside# A feature from the DDNS which allows you to change the lighting mode to# inside.## ATES.go_inside_dark# A feature from the DDNS which allows you to change the lighting mode to# inside dark.## ATES.go_outside# A feature from the DDNS which allows you to change the lighting mode to# outside.## ATES.set_weather(INDEX)# Sets the current weather to the weather at index INDEX.## ATES.terrain=(TERRAIN_NAME)# Sets the terrain to the terrain named TERRAIN_NAME.## ATES.time_name# Returns the name of the current time of day.# # - Enhancement hints:# # If you wish to implement the DDNS further into your game and e.g. allow# different behavious of monsters during day and night, you only need to# check the the state of the appropriate switch. e.g. If NSWITCH is turned# on inflict "Sleep" on one enemy.# # # Additional info:# # The daytime and nighttime tintings were tested appropriately and optimal# tinting is being used.# Keep in mind that ATES is initially turned off, you need to turn it on by# using the ATES.on and ATES.tint_on commands together.# # # If you find any bugs, please report them here:# http://forum.chaos-project.com#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

First off, use code tags when pasting any code at all. Secondly, there really was no point to post the entire script when it's already provided in the OP. Besides, it's a huge script--you can't even fit the entire thing in a message post. I edited your post to reflect these changes.

The error message is stating that a Script event command is acting weird. Do you have any events, probably parallel process or autorun, that uses a script call? If so, post it.

treign

Yes i do have a parallel process using a call script, on both the map transferring from and one on the map transferring too.Blown away you got that from the info i provided, anyways here are how each are set up.

I know its basically the same thing besides the speed change, and the reason behind me doing it that way was because if a player saved the game and i had manually set tint options and disabled the ATES i wanted to make sure everything weather related stayed on when he returned. I have parallel events on every map setting up the conditions of each. I'm guessing you will tell me to remove the script calls which i will be doing if necessary.

Oh and sorry for ticking ya off with the script paste....new as you can tell. That being said i used too talk with blizzard back on rpgmaker rmx or something back in 07. Decided i wanted to finish at least one game before i kick the bucket. Take care and thanks for replying.

treign

That did the trick......thank you kindly. Greatly appreciate your time, Though my game won't be as crazy as some of the others i saw i'm going to finish it. I think the biggest thing i got going for mine is i'm doing all the music for it. Take care and hope you have a great weekend.

And thanks for confirming the solution. Fixed in OP.There were actually a couple more script calls that didn't have any return statements in them so I fixed those other ones too, just in case.(Scary thing is this has not been reported nor touched on for around 2 years. Maybe it's because those who used this also have Interpreter Script Call Fix.)

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=# Advanced Time and Environment System (ATES) by Blizzard and ThallionDarkshine# Version: 1.02# Type: Autonomous Timeflow and Environment Controller# Date v0.3: 11.3.2008# Date v0.31: 8.4.2009# Date v0.32: 13.4.2009# Date v0.33: 4.5.2009# Date v0.34: 5.5.2009# Date v1.0: 12.2.2013# Date v1.01: 28.4.2013# Date v1.02: 20.3.2015#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=# # This work is protected by the following license:# #----------------------------------------------------------------------------# # # # Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported# # ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )# # # # You are free:# # # # to Share - to copy, distribute and transmit the work# # to Remix - to adapt the work# # # # Under the following conditions:# # # # Attribution. You must attribute the work in the manner specified by the# # author or licensor (but not in any way that suggests that they endorse you# # or your use of the work).# # # # Noncommercial. You may not use this work for commercial purposes.# # # # Share alike. If you alter, transform, or build upon this work, you may# # distribute the resulting work only under the same or similar license to# # this one.# # # # - For any reuse or distribution, you must make clear to others the license# # terms of this work. The best way to do this is with a link to this web# # page.# # # # - Any of the above conditions can be waived if you get permission from the# # copyright holder.# # # # - Nothing in this license impairs or restricts the author's moral rights.# # # #----------------------------------------------------------------------------# #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=# # Compatibility:# # 99% compatible with SDK v1.x. 90% compatible with SDK 2.x. WILL corrupt old# savegames. Can cause incompatibilty issues with DNS-es.# # # Features:# # - complete control over and easy manipulating of time and weather# - customizable day and night tinting# - HUD clock optional# - easier to control and more powerful than DDNS# # # IMPORTANT NOTES:# # - This system has a working preconfiguration, be aware that a custom setup# will need you to understand what each option does, so please read the# configuration instructions.# - Why does this system use switches to determine whether it's day or night?# Simple: You can use conditions in enemy attacks to determine whether an# attack should be used only at night or only at day.# # # Instructions:# # - Explanation:# # This Time System will make your game have daytime and nighttime periods.# The screen will be tinted accordingly. You can set up the length of the# day. Other features are explained below. Please be sure to configure this# system appropriately.# # # - Basic manipulation of ATES:# # This system is based upon your eventing. It will work basically if you# want, but with a little bit of using the "Call Script" event command you# are able to control this system fully. You can call following commands:# # ATES.on# Turns ATES on.# # ATES.off# Turns ATES off.# # ATES.tint_on# Turns ATES's screen tinting on.# # ATES.tint_off# Turns ATES's screen tinting off.# # ATES.clock_on# Turns ATES's clock display on.# # ATES.clock_off# Turns ATES's clock display off.# # ATES.active?# Returns true if ATES is turned on, otherwise false.# # ATES.tinting?# Returns true if ATES tinting is turned on, otherwise false.# # ATES.day?# Returns true if it's day, otherwise false. Alternatively you can check the# assigned switch instead.# # ATES.night?# Returns true if it's night, otherwise false. Alternatively you can check# the assigned switch instead.# # ATES.advance(Minutos, Horas, día, mes, año)# This will make the time advanced by M minutes and H hours. Any negative# value used will cancel the execution of this command.# # ATES.make_it_day# This is a feature from DDNS which allows you to quickly jump to the# daytime.# # ATES.make_it_night# This is a feature from DDNS which allows you to quickly jump to the# nighttime.# # ATES.weather_on# This allows you to turn on the weather system.## ATES.weather_off# This allows you to turn off the weather system.## ATES.lock_weather# This allows you to lock the current weather in place without disabling the# weather system entirely.## ATES.unlock_weather# This command unlocks the current weather.## ATES.weather_active?# Returns true if the weather system is turned on, otherwise false.## ATES.set_time(TIME_INDEX or TIME_NAME)# Sets the current time to the time at the index of TIME_INDEX or with the# name of TIME_NAME. Its better to use TIME_NAME because some bugs may occur# from using TIME_INDEX.## ATES.go_inside# A feature from the DDNS which allows you to change the lighting mode to# inside.## ATES.go_inside_dark# A feature from the DDNS which allows you to change the lighting mode to# inside dark.## ATES.go_outside# A feature from the DDNS which allows you to change the lighting mode to# outside.## ATES.set_weather(INDEX)# Sets the current weather to the weather at index INDEX.## ATES.terrain=(TERRAIN_NAME)# Sets the terrain to the terrain named TERRAIN_NAME.## ATES.time_name# Returns the name of the current time of day.# # - Enhancement hints:# # If you wish to implement the DDNS further into your game and e.g. allow# different behavious of monsters during day and night, you only need to# check the the state of the appropriate switch. e.g. If NSWITCH is turned# on inflict "Sleep" on one enemy.# # # Additional info:# # The daytime and nighttime tintings were tested appropriately and optimal# tinting is being used.# Keep in mind that ATES is initially turned off, you need to turn it on by# using the ATES.on and ATES.tint_on commands together.# # # If you find any bugs, please report them here:# http://forum.chaos-project.com#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

if ATES::MONTHS.size > ATES::MONTHDAYS.size raise 'ATEScfgError: Not all months have a length in days specified!'#elsif ATES::DAY_START > ATES::NIGHT_START# raise 'ATEScfgError: A night can\'t start earlier than a day.'elsif ATES::LENGTH < 36 raise 'ATEScfgError: A day\'s length must be equal to or greater than 36 seconds!'end