Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: Xenithas on November 26, 2010, 06:31:59 pm

Title: I need some help with ATES
Post by: Xenithas on November 26, 2010, 06:31:59 pm
Hi, I am relatively new to RMXP I have however tinkered quite a bit with RMVX. I want to rebuild my RPG using RMXP because I have found I like it better and I am running into a slight problem. I am trying to us the ATES system for my day to night transitions. So far the script has worked beautifully and is doing exactly what is expected. Now my questions and Dilemma is this.

-How can I make it so that only my outdoor maps are affected by the ATES system. I love the tinting effects and I really want to use the Script but what I need is some way (that I cannot figure out) to make it so that when I enter a building time can go by normally and the tinting will not affect the lighting inside. So I could respectively step inside a house during the day and leave at night or go into a cave at night and leave and its now day time.

-Is there a way to set it up so the script will ignore certain maps and continue to run or am I resorting to have the tinting turn off and on and manually change every time I enter or exit an indoor environment?.

I really want this to work out. I have been trying for a few hours now and its starting to really frustrate me. I have also tried using the (Complete Climate and Time system by ForeverZer0) it has the feature I want but I cannot get the tinting to work at all. Time passes but no tint and its is likely my own fault for not knowing exactly what i am doing.
Sorry for writing so much I hope someone can help me out.


Title: Re: I need some help with ATES
Post by: The Niche on November 26, 2010, 06:50:09 pm
Use Zero's CCTS. Problem solved.
Title: Re: I need some help with ATES
Post by: winkio on November 26, 2010, 07:02:28 pm
Quote from: The Niche on November 26, 2010, 06:50:09 pm
Use Zero's CCTS. Problem solved.


Quote from: Xenithas on November 26, 2010, 06:31:59 pm
I have also tried using the (Complete Climate and Time system by ForeverZer0) it has the feature I want but I cannot get the tinting to work at all. Time passes but no tint and its is likely my own fault for not knowing exactly what i am doing.


Guess who didn't read an 8 line long post?

Anyways, it takes a bit of configuration to set up the tints, have you tried looking at the CCTS demo?
Title: Re: I need some help with ATES
Post by: ForeverZer0 on November 26, 2010, 07:13:16 pm
I believe in the demo I have it set so that indoor maps are not tinted.
If not, there are comments explaining how different effects are achieved throughout the config. I can help you a little later tonight if you still need it. I got a few things I need to do before I fire up the ol' RMXP.  ;)
Title: Re: I need some help with ATES
Post by: Xenithas on November 26, 2010, 07:22:45 pm
I will take a long look through the demo and the script again and see what I can find. I will let you know if I get it worked out. It is pretty straight forward and I am sure its just my own error cause your script is solid from what I can tell.

On a side not I did notice when I was running a test on my RPG I had the Debug running and it showed the time passing as I stood there..I copied and pasted your time altering sprites into my game so I could change the times and dates...it work but for whatever reason the tinting statistics stayed at 0's across the board.
Title: Re: I need some help with ATES
Post by: ForeverZer0 on November 26, 2010, 07:22:47 pm
Okay, erase the entire section that defines the first climate, "Normal Indoors".
Simply replace it with this:
return [0, 0, 0, 0]
Title: Re: I need some help with ATES
Post by: Xenithas on November 26, 2010, 07:34:45 pm
This is all that is listed in the hourly tints section of the Script
Quote#-----------------------------------------------------------------------------
  # 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, 20], [9, 60], [2, 80]] #!!!
      # 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


I can see that it is not set up to tint the indoors, that is exactly what I need but for some reason nothing is tinting. I currently only have an open field with my character standing in it for my demo. The debug shows the script running but none of the tints are active. is there something i am missing like a script call that will define a map as being outdoor instead of indoor?
Title: Re: I need some help with ATES
Post by: ForeverZer0 on November 26, 2010, 07:38:51 pm
Are the maps defined correctly?
What is the debugger telling you for the current tint and tint rates?

By the way, I know what the script looks like.  ;)
Put it in a spoiler if you need to post a section as an example. I'm lazy and hate scrolling forever to read.  :P
Title: Re: I need some help with ATES
Post by: Xenithas on November 26, 2010, 07:45:30 pm
(http://i843.photobucket.com/albums/zz357/Xenithas/Screen1.jpg?t=1290818604)

This is a screen of what i am looking at. I think the problem is that my maps are not defined. I am likely just not reading carefully enough but how do I define a map so that the script can act accordingly? for example I wanna make this map an out door map.
Title: Re: I need some help with ATES
Post by: ForeverZer0 on November 26, 2010, 08:00:17 pm
  #-----------------------------------------------------------------------------
 # Maps for each climate
 # Include IDs of maps that use each respective climate.
 #-----------------------------------------------------------------------------
   @climate[0].maps = [1]
   @climate[1].maps = [2]
   @climate[2].maps = []
   @climate[3].maps = []
   @climate[4].maps = [3]

Just include the ID of any map you want into the array of the proper climate. For example, with the setup in the demo, you would add the id for indoor maps in the first array, outdoor maps in the second array, snowy maps in the third array, etc, etc.

Just make sure you seperate the IDs with commas.

Also, why is the clock not displaying anything? Is the font set to one that is not on your system?
Title: Re: I need some help with ATES
Post by: Xenithas on November 26, 2010, 08:15:37 pm
it seems to be working well, I will assume that the weather for a given climate is randomized accordingly and I am just gonna let it go and see how things turn out. The only thing I noticed in my test was that as I rolled the time forward to test the weather effects it changed properly but the screen got really bright like it does at mid day and then didn't seem to get dark again even at midnight?


Thanks a lot for all of the help.