Forever ZerO's CCTS [XP]

Started by Persistent, July 09, 2014, 04:02:35 pm

Previous topic - Next topic

Persistent

I have four months set up through the CCTS. The problem occurs when I switch the season to Autumn and then enter and exit an Indoor climate. I'm guessing its something to do with refreshing the weather ID, probability, and variance. The error says : Script 'FZ CCTS' line 1178: NoMethodError occured. Undefined method '[]' for nil:NilClass. This is the section thats having problems. It only causes issues with Autumn. I'm only using four months and thats one of them. Also I took the script and put it in a different project by itself and it does the same thing so its not colliding with any other scripts. I'm really not great with this scripting stuff. I know just enough to go through and make preference changes in some cases. Another problem though not important at all (I can work around it) is the Underground climate won't change tint. Though I suspect I'll learn more about why when I make some new climates.

Line 1178 ->   type = variation = 0
    # Trim array down to only types that whose probability is higher than chance
    climate_weather.reject! {|array| array[1] < chance }
    unless climate_weather.empty?
      # Get a random type from all weather types that were greater than chance.
      r = rand(climate_weather.size)
      type = climate_weather[r][0]
      # Get variation if defined.
      if climate_weather[r][2] != nil
        variation = climate_weather[r][2]
      end
    end


SquareMan

It's been a while since I used Zer0's CCTS, but if I remember right, you have to define your months, seasons, etc. inside the script itself. Therefore, it would be helpful to know what order you defined everything in and it would be nice to see the code in the script where you defined everything. Just to make sure you didn't miss some symbol.
QuoteThey've got helmets on they're heads. But I gotta watermeloan instead!

ForeverZer0

As your first problem goes, there might be a bug in there somewhere. It's been so long since I ever even looked at that script...

As for underground not changing tint, by default it's set not to, I figured underground lighting would not be effected by changes in season or time of day above ground, so it's designed that way.
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.