• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • Eevee Expo's webhost has been having technical issues since Nov. 20th and you might be unable to connect to our site. Staff are also facing issues connecting, so please send a DM to Cat on-site or through Discord directly for faster service!
Resource icon

Resource [20.1+] Weather System 1.4.0

ardicoozer

Cooltrainer
Member
Joined
Sep 29, 2020
Posts
182
I assume that you added arrays to SUMMER_TILESET, AUTUMN_TILESET, WINTER_TILESET, and SPRING_TILESET, which caused the error. The plugin comes with an example, but I'll explain each part here.

There are two parts for that to work, one in OUTDOOR_TILESETS and another in the season tilesets.

In the OUTDOOR_TILESETS you have to put the ID of all tilesets you use when creating a map that you want to change depending on the season. And it has to look something like this: OUTDOOR_TILESETS = [1, 2, 3, 4]. The numbers don't have to be these, but they have to follow this structure.

Then, on the part of the season tilesets, you have to put a single number. That number will be added to the ID in the OUTDOOR_TILESETS to get the ID of the corresponding seasonal tileset. Following the example I put above, it could be something like this:
OUTDOOR_TILESETS = [1, 2, 3, 4]
SUMMER_TILESET = 4
AUTUMN_TILESET = 8
WINTER_TILESET = 12
SPRING_TILESET = 0

With that configuration, the plugin will do this with a map that uses the tileset with ID 1:
Spring: 1 + 0 = 1 so tileset ID 1 will be used as the spring tileset for the map.
Summer: 1 + 4 = 5 so tileset ID 5 will be used as the summer tileset for the map.
Autumn: 1 + 8 = 9 so tileset ID 9 will be used as the autumn tileset for the map.
Winter: 1 + 12 = 13 so tileset ID 13 will be used as the winter tileset for the map.

This configuration puts together the tilesets of the same season together. If you want to put together the tilesets that will transition from one to the other (so you have the spring, summer, autumn and winter tilesets for the same maps one after the other), you have to put a configuration like this one:

OUTDOOR_TILESETS = [1, 6, 11, 16]
SUMMER_TILESET = 1
AUTUMN_TILESET = 2
WINTER_TILESET = 3
SPRING_TILESET = 4

With that configuration, the plugin will do this with a map that uses tileset with ID 1:
Summer: 1 + 1 = 2 so tileset ID 2 will be used as the summer tileset for the map.
Autumn: 1 + 2 = 3 so tileset ID 3 will be used as the autumn tileset for the map.
Winter: 1 + 3 = 4 so tileset ID 4 will be used as the winter tileset for the map.
Spring: 1 + 4 = 5 so tileset ID 5 will be used as the spring tileset for the map.

You have to make sure to put all the tilesets for the same season at the same distance from the tilesets used to create maps (which should be all of the same season unless you use 4 different tilesets for the seasons) so the plugin can change them correctly.

Hope this helps understand how that part of the plugin works.
Okay...
in my case, I'm using a different tilesets for Town and route..
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
691
It doesn't matter. You have to set the tileset you used to create the maps on OUTDOOR_TILESET. Then you have to add the seasonal variations at the same interval and add said interval on SUMMER_TILESET, AUTUMN_TILESET, WINTER_TILESET and SPRING_TILESET.

Let's say you used tilesets 1 and 7 to make the maps, that you want to use them as the summer tileset and you had no other tilesets after the 7, then you would need a configuration like this one:
OUTDOOR_TILESET = [1, 7]
SUMMER_TILESET = 0
AUTUMN_TILESET = 7
WINTER_TILESET = 14
SPRING_TILESET = 21
And you would need a tileset list like this (for the seasonal changes):
1. Town tileset Summer
2.
3.
4.
5.
6.
7. Route tileset Summer
8. Town tileset Autumn
9.
10.
11.
12.
13.
14. Route tileset Autumn
15. Town tileset Winter
16.
17.
18.
19.
20.
21. Route tileset Winter
22. Town tileset Spring
23.
24.
25.
26.
27.
28. Route tileset Spring

As long as you keep a configuration like this one, you can have as many tilesets have seasonal changes as you want.

I recommend having said tilesets (including the one you use to make the map if they are not consecutive tilesets) together at the bottom of the list, so you can have lower numbers on SUMMER_TILESET, AUTUMN_TILESET, WINTER_TILESET and SPRING_TILESET. It will also keep the list from becoming too big and with too many blank spaces.
 

mindbender12

Novice
Member
Joined
Jan 15, 2022
Posts
47
If I wanted to define a variable based on the current weather, would I need to add $game_variables[38] = type to this code or the base code?
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
691
That depends on how often you will check the value, I guess. If it's not often, just setting the variable to a value before the conditional branch that checks it would be enough. Doing something like [imath]game_variables[38] =[/imath]WeatherSystem.actualWeather[zone] in a script call and changing "zone" by the zone index number.

If you want to use it quite often and in multiple zones, you can add it on 01 - Main Code/03 - Handler (somewhere between lines 16 and 27, I think). That code already checks in which zone the player is in and which weather should be displayed so it seems like the proper place to modify a variable's value based on the displayed weather.
 

koda3498

Rookie
Member
Joined
Jan 24, 2024
Posts
7
Don't know what i'm doing wrong but i just cannot get the weather to actually change. This is my config.
Ruby:
Expand Collapse Copy
#===============================================================================
# * 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 = true    # 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 = 4        # 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 = true        # 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 = 22
  AUTUMN_TILESET = 24
  WINTER_TILESET = 26
  SPRING_TILESET = 0

#===============================================================================
# * Weather Substitute
#===============================================================================
  # A hash with the ID of the maps that will have or not have certain weathers.
  # The ID of the weather has to be of the main one you want to change with WEATHER_SUBSTITUTE.
  # Use "exclude" to define a list of maps that will not use that weather when it's the main one.
  #     Any maps of a zone not added on the "exclude" list will use the main weather.
  # Use "include" to define a list of maps that will use that weather when it's the main one.
  #     Any maps of a zone not added on the "include" list will use the secondary weather.
  MAPS_SUBSTITUTE = {
    :Snow => ["exclude", 1, 4],
    :Blizzard => ["exclude", 1, 4],
    :Sandstorm => ["include", 5]
  }

  # The ID of the weathers that will substitute the main when appropiate (conditions defined in MAPS_SUBSTITUTE).
  # 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.
  def self.weather_names
    return {
      :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")
    }
  end
#===============================================================================
# * 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],
    [32, 42, 43, 97, 78, 98, 122],
    [77, 114, 115],
    [99, 101, 105],
    [94, 100, 102, 104, 106],
    [83, 85, 116],
    [79, 82, 121],
    [84, 89, 93, 111, 117],
    [90, 107, 109, 110],
    [112, 113, 120, 123, 124, 125]
  ]
#===============================================================================
# * 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 = [
    [50, 20, 3, 0, 0, 0, 5, 30],
    [40, 50],
    [60],
    [0, 100, 0, 0, 0, 0, 0, 0],
    [0, 30, 10, 0, 0, 0, 10, 30, 60],
    [30, 50, 40, 0, 0, 0, 50],
    [50, 20, 10, 40],
    [50, 30, 20, 0, 0, 0, 30, 40],
    [50, 30, 20, 0, 0, 10, 10],
    [40, 20, 0, 30],
    [20, 0, 0, 50, 40],
    [50, 40, 40, 0, 0, 0, 30, 50]
  ]

  # Probability of weather in autumn.
  # Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
  ZONE_WEATHER_AUTUMN = [
    [50, 20, 3, 0, 0, 0, 5, 30],
    [40, 50],
    [60],
    [0, 100, 0, 0, 0, 0, 0, 0],
    [0, 30, 10, 0, 0, 0, 10, 30, 60],
    [30, 50, 40, 0, 0, 0, 50],
    [50, 20, 10, 40],
    [50, 30, 20, 0, 0, 0, 30, 40],
    [50, 30, 20, 0, 0, 10, 10],
    [40, 20, 0, 30],
    [20, 0, 0, 50, 40],
    [50, 40, 40, 0, 0, 0, 30, 50]
  ]

  # Probability of weather in winter.
  # Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
  ZONE_WEATHER_WINTER = [
    [50, 20, 3, 0, 0, 0, 5, 30],
    [40, 50],
    [60],
    [0, 100, 0, 0, 0, 0, 0, 0],
    [0, 30, 10, 0, 0, 0, 10, 30, 60],
    [30, 50, 40, 0, 0, 0, 50],
    [50, 20, 10, 40],
    [50, 30, 20, 0, 0, 0, 30, 40],
    [50, 30, 20, 0, 0, 10, 10],
    [40, 20, 0, 30],
    [20, 0, 0, 50, 40],
    [50, 40, 40, 0, 0, 0, 30, 50]
  ]

  # Probability of weather in spring.
  # Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
  ZONE_WEATHER_SPRING = [
    [50, 20, 3, 0, 0, 0, 5, 30],
    [40, 50],
    [60],
    [0, 100, 0, 0, 0, 0, 0, 0],
    [0, 30, 10, 0, 0, 0, 10, 30, 60],
    [30, 50, 40, 0, 0, 0, 50],
    [50, 20, 10, 40],
    [50, 30, 20, 0, 0, 0, 30, 40],
    [50, 30, 20, 0, 0, 10, 10],
    [40, 20, 0, 30],
    [20, 0, 0, 50, 40],
    [50, 40, 40, 0, 0, 0, 30, 50]
  ]
end
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
691
If you use pbForceUpdateWeather and change maps to refresh the displayed weather, it doesn't change at all? I suggest using the code above multiple times and changing maps every time because the code updates the weather only when loading a map.
You could also use pbWeatherForecast to see if the active weather has changed and then refresh the map to see if it updates accordingly.
 

koda3498

Rookie
Member
Joined
Jan 24, 2024
Posts
7
pbForceUpdateWeather didn't do anything when i tried and the other one is giving me this error which makes me think it might be incompatible with the following pokemon plugin
Ruby:
Expand Collapse Copy
[2025-01-11 02:08:08 -0600]
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]

Script error in event 3 (coords 14,12), map 32 (Hillside)
Exception: NoMethodError
Message: undefined method `mainWeather' for nil:NilClass

***Full script:
pbWeatherForecast(3)

Backtrace:
[Lin's Weather System] 02 - Forecast.rb:6:in `pbWeatherForecast'
(eval):1:in `execute_script'
Interpreter:138:in `eval'
Interpreter:138:in `execute_script'
Interpreter_Commands:1177:in `command_355'
Interpreter_Commands:116:in `execute_command'
Interpreter:130:in `block in update'
Interpreter:86:in `loop'
Interpreter:86:in `update'
[Following Pokemon EX] Refresh.rb:268:in `update'
 

koda3498

Rookie
Member
Joined
Jan 24, 2024
Posts
7
pbForceUpdateWeather didn't do anything when i tried and the other one is giving me this error which makes me think it might be incompatible with the following pokemon plugin
Ruby:
Expand Collapse Copy
[2025-01-11 02:08:08 -0600]
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]

Script error in event 3 (coords 14,12), map 32 (Hillside)
Exception: NoMethodError
Message: undefined method `mainWeather' for nil:NilClass

***Full script:
pbWeatherForecast(3)

Backtrace:
[Lin's Weather System] 02 - Forecast.rb:6:in `pbWeatherForecast'
(eval):1:in `execute_script'
Interpreter:138:in `eval'
Interpreter:138:in `execute_script'
Interpreter_Commands:1177:in `command_355'
Interpreter_Commands:116:in `execute_command'
Interpreter:130:in `block in update'
Interpreter:86:in `loop'
Interpreter:86:in `update'
[Following Pokemon EX] Refresh.rb:268:in `update'
Tried disabling the following pokemon plugin, still did not work, same error just minus the part about the following pokemon at the bottom.
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
691
Judging by the error, it doesn't seem like the plugin was initialized at all. Have you changed maps or used pbInitializeWeather after installing the plugin?
 

koda3498

Rookie
Member
Joined
Jan 24, 2024
Posts
7
Running that gives me a different error, sorry for all the trouble i feel like the answer is staring me dead in the face and i'm just not seeing it
Ruby:
Expand Collapse Copy
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]

Script error in event 3 (coords 14,12), map 32 (Hillside)
Exception: NoMethodError
Message: undefined method `[]' for nil:NilClass

***Full script:
pbInitializeWeather

Backtrace:
[Lin's Weather System] 01 - Main.rb:70:in `pbValidSecondWeather'
[Lin's Weather System] 01 - Main.rb:147:in `block in pbInitializeWeather'
[Lin's Weather System] 01 - Main.rb:127:in `each'
[Lin's Weather System] 01 - Main.rb:127:in `pbInitializeWeather'
(eval):1:in `execute_script'
Interpreter:138:in `eval'
Interpreter:138:in `execute_script'
Interpreter_Commands:1177:in `command_355'
Interpreter_Commands:116:in `execute_command'
Interpreter:130:in `block in update'
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
691
Ok, this error is telling you that it isn't finding valid secondary weather for some zones. The WEATHER_SUBSTITUTE in the configuration has to have the same number of zones as you defined in ZONES_MAPS so you can simply fill it with {:None => :None} for the missing zones.

And don't worry for the trouble. I know this plugin is hard to install and configure so it works properly.
 
Back
Top