module WeatherConfig
(at the start of the Configuration file) and the end
at the very end of the Configuration file. Just make sure you don't put it in the middle of another setting or it'll cause problems for you. # Array to force specific weather on specific months. Format: weather ID, month number, probability.
# 100 or more will cause the weather always to appear.
# Turn the month or probability to 0 to not use this feature.
MONTH_WEATHER = [
[:Snow, 1, 50],
[:Rain, 4, 100]
]
01 - Main Code/03 - Handler
, add those lines bellow the duration = 0
on line 23: WeatherConfig::MONTH_WEATHER.length.times do |i|
if WeatherConfig::MONTH_WEATHER[i][1] == pbGetTimeNow.mon
chance = rand(100)
weather = WeatherConfig::MONTH_WEATHER[i][0] if chance <= WeatherConfig::MONTH_WEATHER[i][2] && WeatherConfig::MONTH_WEATHER[i][2] != 0
break if chance <= WeatherConfig::MONTH_WEATHER[i][2]
end
end
pbGetTimeNow.mon
to the command that the plugin uses to get the month.ZONE_MAPS
array.[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]
Exception: NoMethodError
Message: undefined method `-' for nil:NilClass
Backtrace:
RubyUtilities:376:in `rand'
RubyUtilities:367:in `rand'
[Lin's Weather System] 01 - Main.rb:104:in `pbGetEndTime'
[Lin's Weather System] 01 - Main.rb:173:in `pbUpdateWeather'
[Lin's Weather System] 03 - Handler.rb:17:in `block in <main>'
Event_Handlers:89:in `block in trigger'
Event_Handlers:89:in `each_value'
Event_Handlers:89:in `trigger'
Event_HandlerCollections:63:in `trigger'
Game_MapFactory:147:in `setMapChanged'
#===============================================================================
# * Weather System Configuration
#===============================================================================
module WeatherConfig
# Set to false to use the Weather System.
NO_WEATHER = false # Default: false
# Set to true to show the weather on the Town Map.
SHOW_WEATHER_ON_MAP = false # Default: true
# Set to true to use the computer's time. Will not work without Unreal Time System.
USE_REAL_TIME = false # Default: true
# Set to true to have the weather change at midnight.
CHANGE_MIDNIGHT = false # Default: true
# Define the min and max amount of time (in hours) before the weather changes.
# Set the same number to not randomize the amount of time before the weather changes.
CHANGE_TIME_MIN = 1 # Default: 1
CHANGE_TIME_MAX = 1 # Default: 4
# Set to true to if you want to force the weather to change when interacting with certain events.
# Use pbForceUpdateWeather in an event to update all zone weathers.
# Use pbForceUpdateZoneWeather(zone) in an event to update the weather of a zone.
FORCE_UPDATE = false # Default: false
# Set to true to have the outdoor maps change with seasons.
# The map's appearance will update when leaving an indoor map.
SEASON_CHANGE = false # Default: false
# Set to true if your game starts outdoors and want to show the season splash when going somewhere indoors.
# Set to false if your game starts indoors and want to show the season splash when going somewhere outdoors.
OUTDOOR = false # Default: false
# Array with the ID of outside tilesets that will change with seasons.
OUTDOOR_TILESETS = [1, 2]
# The difference between the ID of the tileset defined for an outdoor map and it's season version.
# The difference has to be the same for any tileset defined in OUTDOOR_TILESETS.
# Use the same season tileset as the default outdoor map tileset and define the diference for that season as 0.
SUMMER_TILESET = 0
AUTUMN_TILESET = 0
WINTER_TILESET = 0
SPRING_TILESET = 0
#===============================================================================
# * Weather Substitute
#===============================================================================
# A hash with the ID of the maps that will have or not have certain weathers.
MAPS_SUBSTITUTE = {
:Snow => ["exclude", 1, 4],
:Blizzard => ["exclude", 1, 4],
:Sandstorm => ["include", 5]
}
# The ID of the weathers that will substitute the main when in one of the summer or sandstorm maps.
# There has to be a hash (defined between {}) for each defined zone with weather to substitute.
# Any weather not defined in the hash for a zone will use the main weather instead.
WEATHER_SUBSTITUTE = [
{:None => :None, :Rain => :Rain, :Storm => :Storm, :Snow => :Rain, :Blizzard => :Storm, :Sandstorm => :None, :HeavyRain => :HeavyRain, :Sun => :Sun, :Fog => :Fog},
{:Snow => :Rain, :Blizzard => :Storm, :Sandstorm => :None},
{:Snow => :Rain, :Blizzard => :HeavyRain}
]
#===============================================================================
# * Weather Names
#===============================================================================
# A hash that contains the ID of weather and the name to display for each one.
# Using .downcase will make them lowercase.
WEATHER_NAMES = {
:None => _INTL("None"),
:Rain => _INTL("Rain"),
:Storm => _INTL("Storm"),
:Snow => _INTL("Snow"),
:Blizzard => _INTL("Blizzard"),
:Sandstorm => _INTL("Sandstorm"),
:HeavyRain => _INTL("Heavy rain"),
:Sun => _INTL("Sun"),
:Fog => _INTL("Fog")
}
#===============================================================================
# * Zones Configuration
#===============================================================================
# Arrays of id of the maps of each zone. Each array within the main array is a zone.
# The maps within each zone will have the same weather at the same time.
# Each zone may have a different weather than the others.
ZONE_MAPS = [
[2, 5],
[7],
[21]
]
#===============================================================================
# * Map Display
#===============================================================================
# Array of hashes to get each map's position in the Town Map. Each hash corresponds to a zone in ZONE_MAPS.
# In "Map Name" you have to put the name the Town Map displays for that point.
# In Map ID you have to put the ID of the map the name corresponds to, like in ZONE_MAPS.
MAPS_POSITIONS = [
#{"Map Name" => Map ID},
{"Lappet Town" => 2, "Route 1" => 5},
{"Cedolan City" => 7},
{"Route 2" => 21}
]
# A hash for the plugin to display the proper weather image on the map.
# They have to be on Graphics/Pictures/Weather (in 20+) or Graphics/UI/Weather (in 21+).
WEATHER_IMAGE = {
:Rain => "mapRain",
:Storm => "mapStorm",
:Snow => "mapSnow",
:Blizzard => "mapBlizzard",
:Sandstorm => "mapSand",
:HeavyRain => "mapRain",
:Sun => "mapSun",
:Fog => "mapFog"
}
#===============================================================================
# * Season Probability Configuration
#===============================================================================
# Arrays of probability of weather for each zone in the different seasons.
# Each array within the main array corresponds to a zone in ZONE_MAPS.
# Put 0 to weather you don't want if you define a probability after it.
# If your game doesn't use seasons, edit the probabilities of one season and copy it to the others.
# Probability of weather in summer.
# Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
ZONE_WEATHER_SUMMER = [
[10, 80, 0, 0, 0, 0, 0, 0, 10],
[40, 50],
[60]
]
# Probability of weather in autumn.
# Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
ZONE_WEATHER_AUTUMN = [
[10, 80, 0, 0, 0, 0, 0, 0, 10],
[40, 50],
[60]
]
# Probability of weather in winter.
# Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
ZONE_WEATHER_WINTER = [
[10, 80, 0, 0, 0, 0, 0, 0, 10],
[40, 50],
[60]
]
# Probability of weather in spring.
# Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
ZONE_WEATHER_SPRING = [
[10, 80, 0, 0, 0, 0, 0, 0, 10],
[40, 50],
[60]
]
end
The only changes are in
- Changed the code so the WeatherSystem variable is added to existing save files.
- Fixed an error when the minimum and maximum change time for weather is set the same.
01 - Main Code/01 - Main
so there is no need to overwrite the configuration file.
If the plugin doesn't work on existing save files, report it. I'll change it back to require a new game until I figure out what the problem is.
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]
Exception: NoMethodError
Message: undefined method `length' for nil:NilClass
Backtrace:
[Lin's Weather System] 01 - Main.rb:121:in `block in pbInitializeWeather'
[Lin's Weather System] 01 - Main.rb:117:in `each'
[Lin's Weather System] 01 - Main.rb:117:in `pbInitializeWeather'
[Lin's Weather System] 03 - Handler.rb:8:in `block in <main>'
035:Event_Handlers:89:in `block in trigger'
035:Event_Handlers:89:in `each_value'
035:Event_Handlers:89:in `trigger'
036:Event_HandlerCollections:63:in `trigger'
044:Game_MapFactory:147:in `setMapChanged'
044:Game_MapFactory:26:in `setup'
Are those problems on an already existing save file? You will need to change maps (as in, move the character from one map to another) for the weather to update (it will only show it updated if you go to a map with a different weather or if it's time to change the weather of that zone). Be aware that this plugin stores 2 weathers simultaneously for each zone, so if it stored rain for the weather of the moment and the next one before you made the change, you will have to wait for 2 weather changes to see your new probabilities in effect.Hello! So I recently just came into a problem with this resource. The Seasons changing works perfectly! However today, randomly it started raining in the Winter. I then went to the config file and turned it to 0. However, I reloaded the game and it still continued to rain. It does this in every season. I've tried redownloading the plugin but it is still happening. I do not know what I am doing wrong. It even does this when I turn seasons off.
What you shared seems to be fine and should work. I imagine that you have also tried to see if there was any weather on the Dark Forest maps (which seems to be the easiest map where to see if the plugin was working on your game).I can't seem to get the weather from this plugin working. I've got my zones made and the probabilities set, but I see no weather at all in any of the maps. Here are the relevant bits from Configuration.rb - sorry I'm not sure how to format or send the entire file
NO_WEATHER = false
ZONE_MAPS = [
[84],
[89,81]
]
ZONE_WEATHER_SUMMER = [
[20,30,15,0,0,0,20,0,0], #Route 2
[0,0,15,0,0,0,0,0,100] #Dark Forests
]
ZONE_WEATHER_AUTUMN = [
[20,30,15,0,0,0,20,0,0], #Route 2
[0,0,15,0,0,0,0,0,100] #Dark Forests
]
ZONE_WEATHER_WINTER = [
[20,30,15,0,0,0,20,0,0], #Route 2
[0,0,15,0,0,0,0,0,100] #Dark Forests
]
ZONE_WEATHER_SPRING = [
[20,30,15,0,0,0,20,0,0], #Route 2
[0,0,15,0,0,0,0,0,100] #Dark Forests
]
01 - Main Code/03 - Handler
and delete lines 9 and 11 (they have $game_map.metadata&.outdoor_map
on it, in case they are not on lines 9 and 11 for some reason). This will make the weather display in any map added to the zones in the configuration file without having to mark them as outdoors.I do have them marked as outdoors in the metadata. I believe that is working cause I can see the day/night lighting on those maps. I would like to keep the indoor maps weather-free, so I don't want to delete those lines you mentioned.Are those problems on an already existing save file? You will need to change maps (as in, move the character from one map to another) for the weather to update (it will only show it updated if you go to a map with a different weather or if it's time to change the weather of that zone). Be aware that this plugin stores 2 weathers simultaneously for each zone, so if it stored rain for the weather of the moment and the next one before you made the change, you will have to wait for 2 weather changes to see your new probabilities in effect.
As a note, turning seasons off on the configuration file doesn't affect the weather. That configuration is only there to allow the tileset change (so the maps look different every season). It says so right above it.
What you shared seems to be fine and should work. I imagine that you have also tried to see if there was any weather on the Dark Forest maps (which seems to be the easiest map where to see if the plugin was working on your game).
The only thing I can think of that will cause this is that you haven't defined those 3 maps as outdoors. Please, do so if that's the case because the plugin will not display weather on a map unless it detects that it is marked as outdoors. I did it like that so you could add indoor maps to zones without weather displaying on them (so you could modify the example forecast that comes with the plugin and have it check in which zone the player is even when indoors and display a text message with the weather of that zone).
If you don't plan to add indoors maps on the zones (and marking those 3 maps as outdoors solved the issue), you can go to01 - Main Code/03 - Handler
and delete lines 9 and 11 (they have$game_map.metadata&.outdoor_map
on it, in case they are not on lines 9 and 11 for some reason). This will make the weather display in any map added to the zones in the configuration file without having to mark them as outdoors.
pbWeatherForecast(zone)
with "zone" being either 0 (for the route map) or 1 (for the forest maps).