[XP] Complete Climate and Time System (CCTS)

Started by ForeverZer0, May 12, 2010, 06:08:20 pm

Previous topic - Next topic

ForeverZer0

@keyonne
Thanks for the feedback. Let me see if I can maybe answer some of your questions.

1. Just make a weather system and include the IDs of all the maps that the town uses.

2. Adding a "Good Weather Switch would be very simple. I can do it if you like, but it would essentially be the same as checking if the Bad Weather Switch is false.

3. Not sure what the deal is with the last one. Try just changing...
$game_map.need_refresh = true

...to just...
$game_map.refresh

...and see if that helps anything.
I may just make an add-on real quick for shop opening/closing etc. That should eliminate a lot of problems.

As for the window not reappearing, it was likely just an over-sight by me. Thanks for letting me know. I plan on updating this script and Zer0 Add-Ons as soon as I finish this CBS I'm working on.
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.

keyonne

By weather system, do you mean the climate? because I already Have all the town<s maps under the indoor and outdoor climates accordingly.

ForeverZer0

Quote from: keyonne on August 19, 2010, 12:02:10 pm
By weather system, do you mean the climate? because I already Have all the town<s maps under the indoor and outdoor climates accordingly.

Yeah, I mean create a climate that is custom for each town that you want to use a unique climate for, and add the map IDs to that new climate. Then you will have each town have it's own custom climate.
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.

keyonne

August 25, 2010, 05:21:12 pm #43 Last Edit: August 25, 2010, 05:30:17 pm by keyonne
It would be helpful to have something to add in that would indeed check for the bad weather switch. I'm completely unknowledgable in scripting, so I haven't the slightest clue on how to do that. Do you know of anywhere that has a tutitorial for scripting basics?

And I'm still having the issue with my climates. Though the town's maps are all within the same climate, one map is having rain and it is sunshine in another. I don't quite understand what it going on...

ForeverZer0

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.

rlm1000

This script works really good...well until I add in the SDK at least, I've tried 1.5 and 2.3, and both stop the auto tinting completely. Basically I'm trying to get this script, Dynamic Light and Shadows by someone called Trebor777, and the SDK required to make it work to all play nicely together. The effect I'm trying to create is lights that come on at night, and turn off at dawn. If anyone needs more info, let me know.

ForeverZer0

SDK sucks. That is why nobody uses it. If it is not this script that SDK has incompatibility issues with, it will be another.
I would suggest to either not use the script that requires it, or request for someone to de-SDK it.
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.

rlm1000

Thanks for the super fast reply. I had a feeling the SDK would keep things from working, so I removed it and will continue to look for a light script to use with my game, since the light script I found is very heavily reliant on the SDK, and removing the dependencies would probably render the script blank  :haha: Thanks again for your help.

rlm1000

OK I'm sorry to bother you with this possibly noob question, (and I hope this isn't a double post) but I've been trying for a couple weeks to figure this out. I want to use the day and night switches to operate outside lights, using the Light Effects script version 3 by Near Fantastica. Now if I leave a map and come back, or open and close the menu, the lights are on when the night switch is on, but they don't work automatically, I've tried using the $game_map.refresh in the CCTS script, in the event, in common events, and even set a variable, but when I use a script command to refresh the map, the game freezes completely. I've ran out of ideas, so any help would be greatly appreciated.

ForeverZer0

CCTS is likely not going to be compatible with another script that automatically effects the screen tone, especially an SDK one. I'm sorry, but the best advice I can tell you is to pick one of the two scripts not to use in your game.
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.

rlm1000

Just to clarify, I erased the SDK and the Dynamic light script out of my game, and selected a new light script, that does not use the SDK at all, it basically uses a picture and changes it's size, blending and opacity to simulate a handful of lighting effects. It works great with your script, but i couldn't get it to refresh in real time, like if you were outside and it's 9pm, the lights come on automatically. I will probably have to either start a topic on it here or find the author of the light effects script and ask if there is a script command to refresh the light effect events when a switch is turned on, because the ones I have used lock up the game. Thank you for your response though, and I look forward to any new updates on this excellent script  :)

rlm1000

OK, well I managed to get the light effects script to work automatically, by changing the day and night switches to variables (maybe it's just me, but variables seem to update instantly) and adding $scene = Scene_Map.new AND $game_map.refresh in the refresh switches section, it seems to only work if both commands are present. Now i just need to figure out how to get it to not refresh in a battle, because it kicks you out of the battle when the screen refreshes, and it refreshes every game hour. This is my first time messing with the scripting engine in any RPG maker, but so far so good.

ForeverZer0

$scene = Scene_Map.new should not be in the method.
That is just going to cause all sorts of unforeseen problems, and lots of big obvious ones.
That is also why you get kicked out of battle.
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.

rlm1000

Hello again, I just wanted to stop by and give some thanks for the advice on the scripting, I'm no good at it right now, but maybe with some practice I'll get better. I didn't realize that the scene_map.new caused so much trouble, I was just excited to see the events update  :haha: I've ran out of ideas to make it work automatically, but at least i learned a few things, and even managed to merge the Thomas Edison VX script into the Light Effects XP script with little to no problems. Anyway, thanks again for the help, hopefully I haven't bugged you too much, and I look forward to any new releases of this script.

ForeverZer0

Quote from: rlm1000 on September 23, 2010, 01:19:48 pm
Hello again, I just wanted to stop by and give some thanks for the advice on the scripting, I'm no good at it right now, but maybe with some practice I'll get better. I didn't realize that the scene_map.new caused so much trouble, I was just excited to see the events update  :haha: I've ran out of ideas to make it work automatically, but at least i learned a few things, and even managed to merge the Thomas Edison VX script into the Light Effects XP script with little to no problems. Anyway, thanks again for the help, hopefully I haven't bugged you too much, and I look forward to any new releases of this script.


You're not bugging me, thats the point of the thread.  ;)
I will be updating this script very soon. I'm re-writing the weather module, and once that is done I plan on updating this one as well.
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.

Magus

ATES has the Dswitches and Nswitches :/  and its easier to use. I couldn't get this thing to work :/ I really think someone should consider finishing it.
LEVEL ME DOWN. THE ANTI-BLIZZ GROUP IS AMONG YOU... Do it for the chick below...She watches..<br />

The Niche

I get an error with this line

    unless $game_system.time.speed_frozen

It's a no method error.
My configuration: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
# Complete Climate and Time System (CCTS) by ForeverZer0
# Version: 1.0
# Date: 5.12.2010
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
#
# Introduction:
#
#   This script will give you TOTAL control of weather and time in your game. It
#   will allow you to set up different climates that use different weather
#   patterns, tints, sounds, and effects. It is also a complete Time System that
#   gives you full control of, and keeps track of, time, with every possible
#   configuration at your disposal. Note this script comes with a preset config
#   that will be suitable for most's needs, but it can be configured to the most
#   extreme level if so desired, which will require more work. It is not
#   neccessary to do this, but the ability is there.
#
# Features:
#
#   - Automatic weather control with defined types, frequency, probabilities,
#     tints, and sounds for any and every map in your game.
#   - Weather tint and BGS will fade in/out smoothly with the weather for a very
#     realistic feel
#   - Configurable screen tints for every climate, month, and hour that will
#     smoothly transition over the course of each hour, not transition to day
#     or night in matter of seconds.
#   - Completely configurable calendar system that can use custom names for days
#     and months, custom month lengths, etc.
#   - Can easily use configurable switches and variables for event conditions
#     based off the hour of the day, the season of the year, or the current
#     weather.
#   - Comes with a clock that can be toggled on/off by the player, with custom
#     location, opacity, and font name/size options.
#   - Complete control to freeze the time, screen tone, weather, or time speed,
#     seperately or together, with simple script calls.
#   - Comes with error checking and a debugger for easily testing your own
#     customization, and to help understand the system.
#   - Short, simple script calls for easy manipulation
#   - Compatible with Zero Advanced Weather and MAWS (v.1.2 or higher)
#
# Instructions:
#   
#   All the configuration is within this part of the script. The other part is
#   the actual working of the script and should not be altered without knowing
#   what you are doing.
#
#   All instructions for configuration are explained below in each section.
#
#   ------------------------------------------------------------------------
#
#   Script Calls:
#
# ► time.freeze(true/false)
#     - Will freeze/unfreeze time, tone, and weather.
#
# ► time.tone_freeze(true/false)
#     - Will freeze/unfreeze the screen tone from updating automatically. Use
#       before you would like to set a custom screen tone, otherwise the system
#       will override it.
#
# ► time.weather_freeze(true/false)
#     - Will freeze/unfreeze the weather from updating. Freeze if you would like
#       to manually set the weather and do not want the system to override it.
#
# ► time.speed_freeze(true/false)
#     - Will keep the time speed set at a specific rate, and not change per each
#       map as the system usually does.
#
# ► time.change_speed(SPEED)
#     - Will set the time speed to SPEED. Use time.speed_freeze if you would
#       would like to keep it there indefinitely
#
# ► time.set(m, h, d, m, y)
#     - Sets the time to time defined in (minute, hour, day, month, year)
#       This will also allow you to 'go back' in time.
#
# ► time.advance_minute(NUMBER)
#     - Advances minute by NUMBER
#
# ► time.advance_hour(NUMBER)
#     - Advances hour by NUMBER
#
# ► time.advance_day(NUMBER)
#     - Advances day by NUMBER
#
# ► time.advance_month(NUMBER)
#     - Advances month by NUMBER
#
# ► time.advance_year(NUMBER)
#     - Advances year by NUMBER
#
# ► time.memorize(INDEX)
#     - Memorizes the current time to an array at INDEX. The INDEX can be any
#       integer you like, it is used to reference later if the time is restored.
#       This will allow for you to memorize as many 'times' as you need. Using
#       an existing INDEX will over-write the old one.
#
# ► time.restore(INDEX)
#     - Sets the time to memorized time at INDEX. Does nothing if INDEX does not
#       exist. Obviously, you must have a memorized time before using.
#
# ► time.clock(true/false)
#     - Enables/Disables player from toggling clock. Will dispose the clock
#       if disabled when clock is showing.
#
# ► time.simple_clock(true/false)
#     - By default, the clock displays the time, day, and date. If this is true,
#       the clock will only display the time, nothing else.
#
# ► time.clock_face(x, y, opacity, fontname, fontsize)
#     - Changes the clock settings to defined values. The opacity, fontname, and
#       fontsize can be omitted if you are only changing the X and Y. Will also
#       make sure the font is found in the system before changing.
#
# ► time.show_clock
#     - Forcibly toggles the clock ON. Used for showing the clock when it is
#       unknown if the player will have it ON or OFF at that time. The clock must
#       be enabled for this method to work. (Only during Scene_Map)
#
# ► time.change_climate(MAP_ID, CLIMATE_ID)
#     - Will permanently change map with MAP_ID from its current climate to the
#       the one defined by CLIMATE_ID. Will not have an immediate effect on the
#       current map, but will be applied next time the player returns.
#
# ► CCTS.time_system_debugger
#     - Calls a screen that will show all pertinent information to the Time
#       System that you may need when debugging your setup
#
# ► CCTS.missing_climates
#     - Checks your climate configuration to make sure all maps are accounted
#       for and that it is all correct.
#
#  For scripters:
#   If you would like to create any script that is based on time in any way, you
#   can use the method: "$game_system.time.current_time" in another script. It
#   will return this array: [minute, hour, day, month, year].
#   From there you can use/manipulate the data without having to create a bunch
#   of local variables set to the different time values. This can also be used
#   to store in a variable, etc. to be referenced later.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
#                         BEGIN CONFIGURATION
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:

module CCTS
 
  # The names for your days. Use as many as you want.
  Days =  ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday',
           'Saturday', 'Sunday']
           
  # The name for your months. Use as many as you want.         
  Months = ['January', 'February', 'March', 'April', 'May', 'June', 'July',
            'August', 'September', 'October', 'November', 'December']
           
  # How many days in a month? (Per each index above)
  Month_Length = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
           
  # Set up as follows: [Minute, Hour, Day, Month, Year]
  Start_Date = [0, 17, 4, 7, 1776]
 
  # Button used to toggle clock ON/OFF (if enabled). This is the game button,
  # not just the key on your keyboard.
  Clock_Button = Input::Z
 
  # Default settings for the clock.
  # Set up using this pattern. [X, Y, OPACITY, FONTNAME, FONTSIZE]
  # All can be changed in-game with a script call at any time.
  Clock_Face =  [0, 60, 160, 'Calibri', 15]
 
  # The minimun/maximum number of seconds before the system re-calculates what
  # weather pattern will be used. The number will be randomly selected from
  # within the defined range.
  Weather_Wait = [20, 25]#[120, 180]
 
  # This variable will be always be equal to the weather type. Lets you create
  # event conditions based off the weather. (must be raining to do this, etc...)
  # If using Zer0 Advanced Weather, just set to same as "Weather_Type_Variable"
  Weather_Variable = 1
 
  # This switch will only be ON during "bad" weather effects (below). Used for
  # event conditions. (Villagers go inside if it is raining, storming, etc...)
  # If using Zer0 Advanced Weather, just set to same as "Adverse_Weather_Switch"
  Bad_Weather_Switch = 1
 
  # Include all "bad" weather types in this array. The above switch will only
  # be on when one of them is occurring
  # Same as from Zer0 Advanced Weather, if using.
  Bad_Weather_Types = [1, 2, 4, 5, 9, 16]
 
  # This variable will be set by the "season" of the year. This can also be used
  # as a condition in events.
  Season_Variable = 11
  # 0 = Summer
  # 1 = Autumn
  # 2 = Winter
  # 3 = Spring
  # Define the months for each season.
  Season_Months = [ [6, 7, 8],    # Summer
                    [9, 10, 11],  # Autumn
                    [12, 1, 2],   # Winter
                    [3, 4, 5] ]   # Spring
             
  # These switches will be used as conditions for events, etc. They will only
  # be ON during the hours defined below.
  Day_Switch_ID = 2
  Night_Switch_ID = 3
 
  # Define the hours that are considered "Day" and "Night". The respective
  # switch above will be ON/OFF depending on the hour of the day.
  Day_Start_Hour = 6        # (6:00 a.m. - 9:00 p.m.) = Day
  Night_Start_Hour = 21     # (9:00 p.m. - 6:00 a.m.) = Night
 
 
  #-----------------------------------------------------------------------------
  # Weather Tints
  #   Set the tint influence for each weather type. These are NOT the values
  #   the screen tint will be, rather they are the amount applied to whatever
  #   the current screen tint already is. They will transition in/out at the
  #   same rate of the weather transition.
  #-----------------------------------------------------------------------------
  def self.weather_tint(type)
    case type
  # when WEATHER_TYPE then return [RED, GREEN, BLUE, GRAY]
    when 1, 4
      return [-20, -20, -15, 10]
    when 2, 5, 9
      return [-30, -30, -20, 15]
    when 3, 16
      return [-15, -15, -15, 20]   
    end
    return [0, 0, 0, 0]
  end
  #-----------------------------------------------------------------------------
  # Hourly Tints
  #   Define the target tints for each hour of the day for each climate.
  #   The month, hour, and climate_id are all passed as arguments so you can
  #   create as in-depth of a configuration as you like. Just create branches
  #   within branches using the climate, month, and hour as conditions to define
  #   the desired screen tone. There will be no tint (0, 0, 0, 0) for anything
  #   left undefined. (see presets below for examples)
  #
  #   Setup: [RED, GREEN, BLUE, GRAY]
  #-----------------------------------------------------------------------------
  def self.time_tint(climate_id, hour, month)
    case climate_id
    #-------------------------------------------------------------------
    when 0   
      # Climate 0 (Normal Outdoors)
      case month
      when 1, 2, 12 # Winter Months (Less daylight hours, overall more gray)
        case hour
        when 17 then return [-20, -20, -20, 10]
        when 18 then return [-30, -30, -30, 20]
        when 0..6, 19..23
          return [-100, -100, -20, 15]
        when 7 then return [-15, -15, -25, 10]
        when 8..18
          return [-10, -10, -10, 10]
        end
      when 6, 7, 8 # Summer Months (More hours of daylight, brighter)
        case hour
        when 18 then return [-25, -25, -10, 5]
        when 19 then return [-50, -50, -15, 10]
        when 20..23, 0..5
          return [-100, -100, -20, 15]
        when 6 then return [10, 10, -10, 0]
        when 7..17
          return [5, 5, -5, 0]
        end
      when 3, 4, 5 # Spring Months (Average)
        case hour
        when 18 then return [0, 0, -15, 5]
        when 19 then return [-15, -15, -30, 10]
        when 20..23, 0..5
          return [-100, -100, -20, 10]
        when 6 then return [-5, -5, -20, 0]
        end
      when 9, 10, 11 # Autumn Months (More 'Orange-Yellow' tinting in evening)
        case hour
        when 18 then return [5, 5, -20, 0]
        when 19 then return [-5, -5, -25, 10]
        when 20..23, 0..5
          return [-100, -100, -20, 10]
        when 6 then return [10, 5, -10, 10]
        end
      end
    #-------------------------------------------------------------------
    when 2
      # Climate 2 (Snow)
      # No month branches. Same tints used year-round
      case hour
      when 17 then return [-20, -20, -20, 10]
      when 18 then return [-30, -30, -30, 20]
      when 0..6, 19..23
        return [-100, -100, -20, 20]
      when 7 then return [-15, -15, -25, 10]
      when 8..18
        return [-10, -10, -10, 10]
      end
    #-------------------------------------------------------------------
    when 3
    # Climate 3 (Desert)
    # No month branches. Same tints used year-round
      case hour
      when 18 then return [-25, -25, -10, 5]
      when 19 then return [-50, -50, -15, 10]
      when 20..23, 0..5
        return [-100, -100, -20, 15]
      when 6 then return [10, 10, -10, 0]
      when 7..17
        return [5, 5, -5, 0]
      end
    #-------------------------------------------------------------------
    when 4
    # Climate 4 (Underground/Cave)
    # Same tint, year-round for every hour
      return [-20, -20, -20, 0]
    #-------------------------------------------------------------------
    end
    # Default return value for undefined time/climate (Don't edit)
    return [0, 0, 0, 0]
  end
  #-----------------------------------------------------------------------------
  # Weather Probability
  #   Define the weather probabilities for each climate. The climate ID and the
  #   month are passed as arguments for branching. This will allow you to make
  #   it snow in the winter, storm in the summer, etc.
  #
  #   Set up like this:
  #
  #   case climate_id
  #   when CLIMATE_ID
  #     case month
  #     when MONTH then return [[TYPE, PROB], [TYPE, PROB], [TYPE, PROB], etc]
  #
  #   If you are using Zer0 Advanced Weather or MAWS (v.1.2 or >) where the
  #   "variation" is used, just add the variation value into the respective
  #   array, like this:
  #                     [TYPE, PROBABILITY, VARIATION]
  #
  #   You need not define a probability for 0, or no weather. It is the default
  #   value used for undefined weather and when the weather probability is not
  #   high enough when the system calculates it.
  #
  #   The actual weather will be chosen randomly from all types that have a   
  #   probability above the randomly chosen 'chance' at each weather update.
  #-----------------------------------------------------------------------------
  def self.weather_prob(climate_id, month)
    case climate_id
    when 0, 1 # Normal Outdoor
      case month
      # Winter
      when 1, 2, 12
        return [[3, 17], [16, 12]]
      # Spring
      when 3, 4, 5
        return [[1, 30], [2, 25], [9, 25]] 
      # Summer 
      when 6, 7, 8
        return [[1, 60], [9, 60]]#[[1, 60], [2, 7], [9, 11]]
      # Autumn
      when 9, 10, 11
        return [[1, 15], [9, 10], [6, 25, rand(3)],  # random "variation"
                [7, 25, rand(3)], [8, 25, rand(3)]]
      end
    when 2 # Snow/Arctic (year-round, no month branching)     
      return [[3, 80], [16, 50]]
    when 3 # Desert (year-round, no month branching)
      return [[1, 5]]
    end
  end
  #-----------------------------------------------------------------------------
  # Weather BGS
  #   Define the BGS used for each weather type. They BGS will fade in/out at
  #   the same rate of the weather's transition. Volume will be 50% for maps
  #   that do not have weather, but still have weather sound.
  #-----------------------------------------------------------------------------
  def self.weather_BGS(type)
    case type
  # when WEATHER_TYPE then return ['FILENAME', VOLUME, PITCH]
    when 1 then return ['005-Rain01', 80, 100]    # Rain
    when 2 then return ['006-Rain02', 80, 100]    # Heavy Rain
    when 3 then return ['001-Wind01', 80, 100]    # Snow
    when 4 then return ['005-Rain01', 60, 75]     # Hail
    when 5, 9
      return ['007-Rain03', 80, 100]              # Thunder/Realistic Storm
    when 7 then return ['003-Wind03', 80, 100]    # Blowing Leaves
    when 8, 16
      return ['004-Wind04', 80, 100]              # Swirling Leaves/Blowing Snow
    when 22 then return ['015-Quake01', 100, 125] # Falling Rocks
    end
  end
end

  #-----------------------------------------------------------------------------

class Climate
 
  attr_accessor :maps

  def initialize
    @climate = []
  #-----------------------------------------------------------------------------
  # Initialize New Climates
  #   Simply follow the same pattern for each new climate you create.
  #-----------------------------------------------------------------------------
    @climate[0] = Game_Climate.new(0)
    @climate[1] = Game_Climate.new(1)
    @climate[2] = Game_Climate.new(2)
    @climate[3] = Game_Climate.new(3)
    @climate[4] = Game_Climate.new(4)
    @climate[5] = Game_Climate.new(5)
  #-----------------------------------------------------------------------------
  # Climate Names
  #   Create names for the different climates.
  #-----------------------------------------------------------------------------
    @climate[0].name = 'Outdoors'
    @climate[1].name = 'Indoors'
    @climate[2].name = 'Snow'
    @climate[3].name = 'Desert'
    @climate[4].name = 'Underground'
    @climate[5].name = 'DUMMY CLIMATE'
  #-----------------------------------------------------------------------------
  # Weather for this Climate?
  #   If false, no weather will be shown for climate, although weather sound and
  #   tinting can still be used if desired.
  #-----------------------------------------------------------------------------
    @climate[0].weather = true
    @climate[1].weather = false
    @climate[2].weather = true
    @climate[3].weather = true
    @climate[4].weather = false
    @climate[5].weather = false
  #-----------------------------------------------------------------------------
  # Weather Tinting?
  #   If true, different weather patterns will influence the screen tint
  #-----------------------------------------------------------------------------
    @climate[0].weather_tinting = true
    @climate[1].weather_tinting = false
    @climate[2].weather_tinting = true
    @climate[3].weather_tinting = true
    @climate[4].weather_tinting = false
    @climate[5].weather_tinting = false
  #----------------------------------------------------------------------------- 
  # Weather Sound?
  #   If true, weather BGS will be played automatically for that climate
  #-----------------------------------------------------------------------------
    @climate[0].weather_sound = true
    @climate[1].weather_sound = true
    @climate[2].weather_sound = true
    @climate[3].weather_sound = true
    @climate[4].weather_sound = false
    @climate[5].weather_sound = false
  #----------------------------------------------------------------------------- 
  # Time Speed
  #   This will be the default time speed used for the climate. It can be
  #   overridden with script calls in-game if needed. "1" is real-time, and
  #   any other number is multiples of real-time, so "5" is 5 times as fast as
  #   the real world. (unless you live in a videogame)
  #-----------------------------------------------------------------------------
    @climate[0].time_speed = 100#5
    @climate[1].time_speed = 8
    @climate[2].time_speed = 5
    @climate[3].time_speed = 4
    @climate[4].time_speed = 2
    @climate[5].time_speed = 5
  #-----------------------------------------------------------------------------
  # Maps for each climate
  # Include IDs of maps that use each respective climate.
  # Use script call 'CCTS.missing_climates' to check.
  #-----------------------------------------------------------------------------
    @climate[0].maps = []
    @climate[1].maps = []
    @climate[2].maps = []
    @climate[3].maps = []
    @climate[4].maps = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20, 21, 22, 23, 24]
    @climate[5].maps = []
  #-----------------------------------------------------------------------------
  end
#-------------------------------------------------------------------------------
  def map_climate(map_id)
    @climate.each {|climate| return climate if climate.maps.include?(map_id)}
    return @climate[5] # <--
    # This is the 'dummy climate' to prevent crashes if no climate is defined.
  end
end

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
#                     END CONFIGURATION (finally!)
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:

Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

ForeverZer0

What version are you using?
I thought i had fixed that bug, though I could be mistaken.

If you add this line to the Time class, it should fix it:
attr_reader :speed_frozen


Just place it with the other attr_readers at the top of the script.
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.

The Niche

Thanks. I probably missed that version, owing to censorship and such.
Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

ForeverZer0

* Updates to 1.2 *

Added a bundle of new stuff, improved some coding. Here's the highlights:

  • Added a "Good Weather" switch for events
  • Added ability to set game variables to the current time values.
  • Fixed bug so that map would refresh properly when switches/variables are altered
  • Fixed bug that would not re-draw clock after scene returns to Scene_Map from another scene
  • Changed the "Debugger". It no longer just displays the data to the standard output, but now puts it to the game screen where the changes can be viewed in real-time
  • Missing Climate Logger will now simply create a log in the games directory (configurable) each time the game is played in Debug Mode instead of having to be initiated by script calls
  • Added configuration to how the time is formatted on the clock
  • Added options to how the standard clock is displayed
  • Added the option to use an Analog Clock
  • Cleaned up overall code, made a bunch of minor coding improvements
  • Added comments to make the code a little more over-viewable and to help others understand it and better and follow the main flow.
  • Consolidated the scripts.


A few of the options and configurations have changed. Please be sure to reconfigure accordingly.

If anyone finds any bugs, be sure to let me know and they will be fixed in the next update.
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.