I'm not sure if I'll get crap for double-posting or not, but this issue is completely different from what I was talking about on the last post. Anyway, so there's a major bug in this script. I know that ForeverZero isn't really looking at these anymore but I figure that I'll point out the bug anyway.
Here's the bug:
Let's say that you have map 1 with a climate of raining with a 100% probability. You have map 2, which is a house located on map 1 and has no weather "case/when" set. There is a transfer event between the two. Then, you have map 3, which is a snow 100% probability climate. If you go into the snow map(map 3) and it starts snowing, then you go back to map 1(rain), and into the transfer event to get to map2(no weather) and then go back outside to map 1. Map 1 will show snow even though snow is not a part of it.
From what I've seen from the debugger, it will do this if the weather count has not finished with the current weather type. Once the count is done, it will choose a weather type within the climate. Mind you, this has nothing to do with the months or anything else.
The only way to fix this from what I see is to have each new map instance check if the weather type that is being used is part of the weather types of the new map climate. So, for instance if map 1 is getting snow(let's say weather type 16 for example), and 16 is not listed in that climate's weather array, then it stops the weather for 0 frames, therefore resetting the count and weather type to no weather until it is randomized again within that climate's proper list.
I'll try and add this to the code as a switch to prove my point and I can provide an example if anyone is interested in troubleshooting this. Anyway, I have a solution, but if ForeverZero isn't here maybe someone else can verify the cleanliness of my patch and update it?
Edit: Figured it out. Script add-on below.
Just add on below the CCTS to try it out whomever the script updater may be...
CCTS_MAP_CHANGE_FIX = true
if CCTS_MAP_CHANGE_FIX == true
class Game_Map
alias ccts_fix_ini setup
def setup(map_id)
ccts_fix_ini(map_id)
# Gets the current climate and month to determine weather for the season.
climate, month = $game_map.climate.id, $game_system.time.month
climate_weather = CCTS.weather_prob(climate, month)
weather_list = []
if climate_weather != nil
climate_weather.each do |x|
###print x[0]
weather_list.push(x[0])
end
end
current_weather = $game_screen.weather_type_target
if current_weather != 0
if weather_list.include?(current_weather)
#print("this weather is inside the list")
else
#print("fixing it")
$game_screen.weather(0,0,0)
end
end
end#end def setup
end#end Game_Map class
end#end if CCTS_MAP_CHANGE_FIX statement