• Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Resource icon

Resource [20.1+] Weather System 1.3.4

OkunoShio

Cooltrainer
Member
Joined
Oct 22, 2022
Posts
127
So, I did all the changes you recommended, still get the same error (only on certain indoors maps) ... :( see my updated Configuration file:


Ruby:
#===============================================================================
# * Weather System Configuration
#===============================================================================

module WeatherConfig
  # Set to false to use the Weather System.
  NO_WEATHER = false        # Default: false

  # Set to false to use the Weather System.
  SHOW_WEATHER_ON_MAP = true    # 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 = 8        # Default: 1
  CHANGE_TIME_MAX = 16        # Default: 4

#===============================================================================
# * Weather Substitute
#===============================================================================
  # A hash with the ID of the maps that will have or not have certain weathers.
  MAPS_SUBSTITUTE = {
    :Snow => ["exclude", 98, 117]
    #: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 = [
    {:Snow => :Sun},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None}
  ]

#===============================================================================
# * 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 = [
    [22, 32, 33, 98, 156, 117],#Shison & Routes
    [15, 376, 377, 378],#Chushin City
    [86, 384, 385, 386],#Aki Forest
    [81, 82, 83, 84],#Noyanagi
    [88, 95, 92, 93],#Yosei Woods
    [94, 99, 100, 101],#Suna Beach
    [131, 133, 134, 135],#Sakyu Valley
    [138, 155, 169, 170, 171],#Shimo Mountain
    [177, 183, 185, 186],#Kiri Forest
    [179]#Road of Ascension
  ]

#===============================================================================
# * 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},
    {"Shison Village" => 22, "Route 1" => 32, "Route 2" => 33, "Route 3" => 98, "Route 4" => 156, "Netsumachi" => 117},
    {"Chushin City" => 15},
    {"Aki Forest" => 86},
    {"Noyanagi Plains" => 81},
    {"Yosei Woods" => 88},
    {"Suna Beach" => 94},
    {"Sakyu Valley" => 131},
    {"Yuki Village" => 138, "Shimo Mountain" => 155},
    {"Kiri Forest" => 177},
    {"Road of Ascension" => 179}
  ]

  # 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 = [
    [60, 15, 0, 5, 0, 0, 0, 20, 0],#Shison & Routes
    [60, 15, 0, 5, 0, 0, 0, 20, 0],#Chushin City
    [50, 20, 0, 10, 0, 0, 0, 10, 10],#Aki Forest
    [60, 15, 0, 10, 0, 0, 0, 15, 0],#Noyanagi
    [60, 15, 0, 0, 0, 0, 0, 15, 10],#Yosei Woods
    [50, 10, 5, 0, 0, 0, 0, 35, 0],#Suna Beach
    [50, 0, 0, 0, 0, 15, 0, 35, 0],#Sakyu Valley
    [20, 0, 0, 60, 10, 0, 0, 10, 0],#Shimo Mountain
    [40, 25, 0, 10, 0, 0, 0, 0, 25],#Kiri Forest
    [0, 0, 0, 100, 0, 0, 0, 0, 0]#Road of Ascension
  ]

  # Probability of weather in autumn.
  # Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
  ZONE_WEATHER_AUTUMN = [
    [60, 15, 0, 5, 0, 0, 0, 20, 0],#Shison & Routes
    [60, 15, 0, 5, 0, 0, 0, 20, 0],#Chushin City
    [50, 20, 0, 10, 0, 0, 0, 10, 10],#Aki Forest
    [60, 15, 0, 10, 0, 0, 0, 15, 0],#Noyanagi
    [60, 15, 0, 0, 0, 0, 0, 15, 10],#Yosei Woods
    [50, 10, 5, 0, 0, 0, 0, 35, 0],#Suna Beach
    [50, 0, 0, 0, 0, 15, 0, 35, 0],#Sakyu Valley
    [20, 0, 0, 60, 10, 0, 0, 10, 0],#Shimo Mountain
    [40, 25, 0, 10, 0, 0, 0, 0, 25],#Kiri Forest
    [0, 0, 0, 100, 0, 0, 0, 0, 0]#Road of Ascension
  ]

  # Probability of weather in winter.
  # Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
  ZONE_WEATHER_WINTER = [
    [60, 15, 0, 5, 0, 0, 0, 20, 0],#Shison & Routes
    [60, 15, 0, 5, 0, 0, 0, 20, 0],#Chushin City
    [50, 20, 0, 10, 0, 0, 0, 10, 10],#Aki Forest
    [60, 15, 0, 10, 0, 0, 0, 15, 0],#Noyanagi
    [60, 15, 0, 0, 0, 0, 0, 15, 10],#Yosei Woods
    [50, 10, 5, 0, 0, 0, 0, 35, 0],#Suna Beach
    [50, 0, 0, 0, 0, 15, 0, 35, 0],#Sakyu Valley
    [20, 0, 0, 60, 10, 0, 0, 10, 0],#Shimo Mountain
    [40, 25, 0, 10, 0, 0, 0, 0, 25],#Kiri Forest
    [0, 0, 0, 100, 0, 0, 0, 0, 0]#Road of Ascension
  ]

  # Probability of weather in spring.
  # Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
  ZONE_WEATHER_SPRING = [
    [60, 15, 0, 5, 0, 0, 0, 20, 0],#Shison & Routes
    [60, 15, 0, 5, 0, 0, 0, 20, 0],#Chushin City
    [50, 20, 0, 10, 0, 0, 0, 10, 10],#Aki Forest
    [60, 15, 0, 10, 0, 0, 0, 15, 0],#Noyanagi
    [60, 15, 0, 0, 0, 0, 0, 15, 10],#Yosei Woods
    [50, 10, 5, 0, 0, 0, 0, 35, 0],#Suna Beach
    [50, 0, 0, 0, 0, 15, 0, 35, 0],#Sakyu Valley
    [20, 0, 0, 60, 10, 0, 0, 10, 0],#Shimo Mountain
    [40, 25, 0, 10, 0, 0, 0, 0, 25],#Kiri Forest
    [0, 0, 0, 100, 0, 0, 0, 0, 0]#Road of Ascension
  ]
end
 

OkunoShio

Cooltrainer
Member
Joined
Oct 22, 2022
Posts
127
Well, I updated the plugin... at least I get a different error now? 😅


Code:
=================

[2023-12-04 21:25:17 +0100]
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]

Exception: TypeError
Message: no implicit conversion from nil to integer

Backtrace:
[Lin's Weather System] 02 - Map_Display v20.1.rb:18:in `pbStartScene'
287:UI_RegionMap:347:in `pbStartScreen'
250:Item_Effects:74:in `block (2 levels) in <main>'
082:MessageConfig:570:in `pbFadeOutIn'
250:Item_Effects:71:in `block in <main>'
035:Event_Handlers:227:in `trigger'
249:Item_Utilities:58:in `triggerUseFromBag'
249:Item_Utilities:714:in `pbUseItem'
[Terastal Phenomenon] [002] Item Handlers.rb:76:in `pbUseItem'
[Essentials Deluxe] Interactable Bag Screen.rb:333:in `block in pbStartScreen'

For context: the maps this happens on are indoor maps located on a point on the town map that have no weather assigned (because that point on the map has no outdoor location).
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
614
The fact that the map you are in is outdoors or indoors has no relevance. The code for displaying the weather in the Town Map doesn't check it. The only PBS it gets data from is the town_map file and only picks the point's name. What was important is that some points on the town map were not defined in the MAPS_POSITIONS and that was causing problems when trying to get that point's zone when opening the Town Map on them.

As for the error, it is because I didn't copy all the changes I did on the code to make it work. I'll update the fix right away.
 

OkunoShio

Cooltrainer
Member
Joined
Oct 22, 2022
Posts
127
Well, found something new 😅 since I updated the plugin, every time I want to start a new game, I get this error:


Code:
=================

[2023-12-05 21:56:56 +0100]
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]

Exception: NoMethodError
Message: undefined method `[]' for nil:NilClass

Backtrace:
[Lin's Weather System] 01 - Main.rb:69:in `pbValidSecondWeather'
[Lin's Weather System] 01 - Main.rb:137: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'

Am I missing some initialization in the Configuration file (you see that one a few posts up already)?
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
614
I don't know about this one. All my tests are on a copy of essentials without a save file and I'm not getting this error.

When you say "want to start a new game", do you mean that you have a saved file and try to select the "New game" option? Also, have you changed something of the configuration since you shared it last?
 

OkunoShio

Cooltrainer
Member
Joined
Oct 22, 2022
Posts
127
I tried with and without the save file in my folder. Have not changed a thing, however just to be super sure, here is my Configuration file again ;)

Ruby:
#===============================================================================
# * Weather System Configuration
#===============================================================================

module WeatherConfig
  # Set to false to use the Weather System.
  NO_WEATHER = false        # Default: false

  # Set to false to use the Weather System.
  SHOW_WEATHER_ON_MAP = true    # 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 = 8        # Default: 1
  CHANGE_TIME_MAX = 16        # 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 = [50]

  # 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", 98, 117]
    #: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 = [
    {:Snow => :Sun},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None}
  ]

#===============================================================================
# * 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 = [
    [22, 32, 33, 98, 156, 117],#Shison & Routes
    [15, 376, 377, 378],#Chushin City
    [86, 384, 385, 386],#Aki Forest
    [81, 82, 83, 84],#Noyanagi
    [88, 95, 92, 93],#Yosei Woods
    [94, 99, 100, 101],#Suna Beach
    [131, 133, 134, 135],#Sakyu Valley
    [138, 155, 169, 170, 171],#Shimo Mountain
    [177, 183, 185, 186],#Kiri Forest
    [179, 102],#Road of Ascension
    [372, 107, 124, 123, 126, 127, 128, 130, 112, 113]#Indoor Maps
  ]

#===============================================================================
# * 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},
    {"Shison Village" => 22, "Route 1" => 32, "Route 2" => 33, "Route 3" => 98, "Route 4" => 156, "Netsumachi" => 117 ,"Kazan Passage" => 124},
    {"Chushin City" => 15},
    {"Aki Forest" => 86},
    {"Noyanagi Plains" => 81},
    {"Yosei Woods" => 88},
    {"Suna Beach" => 94},
    {"Sakyu Valley" => 131},
    {"Yuki Village" => 138, "Shimo Mountain" => 155},
    {"Kiri Forest" => 177},
    {"Road of Ascension" => 179, "Keisatsu Castle" => 102},
    {"Aki Gate" => 372, "Yosei - Suna Gate" => 107, "Kazan Passage" => 124, "Kazan Mountain" => 123, "Yama Passage" => 112}
  ]

  # 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 = [
    [60, 15, 0, 5, 0, 0, 0, 20, 0],#Shison & Routes
    [60, 15, 0, 5, 0, 0, 0, 20, 0],#Chushin City
    [50, 20, 0, 10, 0, 0, 0, 10, 10],#Aki Forest
    [60, 15, 0, 10, 0, 0, 0, 15, 0],#Noyanagi
    [60, 15, 0, 0, 0, 0, 0, 15, 10],#Yosei Woods
    [50, 10, 5, 0, 0, 0, 0, 35, 0],#Suna Beach
    [50, 0, 0, 0, 0, 15, 0, 35, 0],#Sakyu Valley
    [20, 0, 0, 60, 10, 0, 0, 10, 0],#Shimo Mountain
    [40, 25, 0, 10, 0, 0, 0, 0, 25],#Kiri Forest
    [0, 0, 0, 100, 0, 0, 0, 0, 0],#Road of Ascension
    [100, 0, 0, 0, 0, 0, 0, 0, 0]#Indoor Maps
  ]

  # Probability of weather in autumn.
  # Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
  ZONE_WEATHER_AUTUMN = [
    [60, 15, 0, 5, 0, 0, 0, 20, 0],#Shison & Routes
    [60, 15, 0, 5, 0, 0, 0, 20, 0],#Chushin City
    [50, 20, 0, 10, 0, 0, 0, 10, 10],#Aki Forest
    [60, 15, 0, 10, 0, 0, 0, 15, 0],#Noyanagi
    [60, 15, 0, 0, 0, 0, 0, 15, 10],#Yosei Woods
    [50, 10, 5, 0, 0, 0, 0, 35, 0],#Suna Beach
    [50, 0, 0, 0, 0, 15, 0, 35, 0],#Sakyu Valley
    [20, 0, 0, 60, 10, 0, 0, 10, 0],#Shimo Mountain
    [40, 25, 0, 10, 0, 0, 0, 0, 25],#Kiri Forest
    [0, 0, 0, 100, 0, 0, 0, 0, 0],#Road of Ascension
    [100, 0, 0, 0, 0, 0, 0, 0, 0]#Indoor Maps
  ]

  # Probability of weather in winter.
  # Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
  ZONE_WEATHER_WINTER = [
    [60, 15, 0, 5, 0, 0, 0, 20, 0],#Shison & Routes
    [60, 15, 0, 5, 0, 0, 0, 20, 0],#Chushin City
    [50, 20, 0, 10, 0, 0, 0, 10, 10],#Aki Forest
    [60, 15, 0, 10, 0, 0, 0, 15, 0],#Noyanagi
    [60, 15, 0, 0, 0, 0, 0, 15, 10],#Yosei Woods
    [50, 10, 5, 0, 0, 0, 0, 35, 0],#Suna Beach
    [50, 0, 0, 0, 0, 15, 0, 35, 0],#Sakyu Valley
    [20, 0, 0, 60, 10, 0, 0, 10, 0],#Shimo Mountain
    [40, 25, 0, 10, 0, 0, 0, 0, 25],#Kiri Forest
    [0, 0, 0, 100, 0, 0, 0, 0, 0],#Road of Ascension
    [100, 0, 0, 0, 0, 0, 0, 0, 0]#Indoor Maps
  ]

  # Probability of weather in spring.
  # Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
  ZONE_WEATHER_SPRING = [
    [60, 15, 0, 5, 0, 0, 0, 20, 0],#Shison & Routes
    [60, 15, 0, 5, 0, 0, 0, 20, 0],#Chushin City
    [50, 20, 0, 10, 0, 0, 0, 10, 10],#Aki Forest
    [60, 15, 0, 10, 0, 0, 0, 15, 0],#Noyanagi
    [60, 15, 0, 0, 0, 0, 0, 15, 10],#Yosei Woods
    [50, 10, 5, 0, 0, 0, 0, 35, 0],#Suna Beach
    [50, 0, 0, 0, 0, 15, 0, 35, 0],#Sakyu Valley
    [20, 0, 0, 60, 10, 0, 0, 10, 0],#Shimo Mountain
    [40, 25, 0, 10, 0, 0, 0, 0, 25],#Kiri Forest
    [0, 0, 0, 100, 0, 0, 0, 0, 0],#Road of Ascension
    [100, 0, 0, 0, 0, 0, 0, 0, 0]#Indoor Maps
  ]
end
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
614
Yeah, I saw that the number of zones isn't the same which may be the cause of why you are getting this error since the plugin can't find that zone in the WEATHER_SUBSTITUTE.
 

Aguadiablo

Novice
Member
Joined
Jul 26, 2023
Posts
22
Hi,

I have just tried installing and configuring this plug-in.

However, I am getting the following error whilst trying to start a new game:
Ruby:
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.5]

Exception: NoMethodError
Message: undefined method `[]' for nil:NilClass

Backtrace:
[Lin's Weather System] 01 - Main.rb:69:in `pbValidSecondWeather'
[Lin's Weather System] 01 - Main.rb:137: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>'
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'

My configuration file:

Ruby:
#===============================================================================
# * 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 = true    # Default: true

  # Set to true to use the computer's time. Will not work without Unreal Time System.
  USE_REAL_TIME = true        # 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 = 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.
  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,116,106], #Costal Zone
    [76,6,5,33,42,], #Forest Zone
    [98,115,93,95,97,99], #Urban Zone
    [104,112,102,103,105,107,108,109,110,111], #Mountain Zone
    [87,91,92], #Highland Zone
    [77,78,101,117], #Countryside Zone
  ]
#===============================================================================
# * 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 = [   
    [40, 30, 0, 0, 0, 0, 20, 0, 10], #Costal
    [30, 35, 0, 0, 0, 0, 20, 0, 15], #Forest   
    [50, 20, 0, 0, 0, 0, 15, 15, 0], #Urban
    [30, 25, 15, 0, 0, 0, 0, 20, 10], #Mountain   
    [30, 30, 10, 0, 0, 0, 0, 20, 10], #Highland
    [40, 30, 0, 0, 0, 0, 0, 20, 10] #Coutryside
  ]

  # Probability of weather in autumn.
  # Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
  ZONE_WEATHER_AUTUMN = [   
    [25, 25, 15, 0, 0, 0, 15, 0, 20], #Costal
    [25, 30, 5, 0, 0, 0, 15, 0, 25], #Forest
    [45, 25, 0, 0, 0, 0, 15, 0, 15], #Urban
    [25, 25, 10, 10, 0, 0, 0, 15, 15], #Mountain   
    [25, 25, 0, 25, 0, 0, 0, 10, 15], #Highland   
    [40, 25, 0, 0, 0, 0, 0, 20, 15] #Countryside
  ]

  # Probability of weather in winter.
  # Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
  ZONE_WEATHER_WINTER = [   
    [20, 20, 0, 10, 10, 0, 15, 0, 25], #Costal
    [15, 20, 0, 25, 15, 0, 0, 0, 25], #Forest
    [40, 20, 0, 10, 5, 0, 15, 0, 10], #Urban   
    [10, 15, 10, 30, 20, 0, 0, 0, 15], #Mountain
    [5, 10, 0, 40, 30, 0, 0, 0, 15], #Highland
    [30, 15, 0, 25, 15, 0, 0, 0, 15] #Countryside
  ]

  # Probability of weather in spring.
  # Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
  ZONE_WEATHER_SPRING = [   
    [30, 25, 10, 0, 0, 0, 15, 0, 20], #Costal
    [20, 30, 10, 0, 0, 0, 25, 0, 15], #Forest   
    [40, 25, 0, 0, 0, 0, 15, 10, 10], #Urban
    [20, 30, 10, 0, 0, 0, 20, 10, 10], #Mountain   
    [20, 30, 0, 20, 0, 0, 0, 15, 15], #Highland
    [35, 30, 10, 0, 0, 0, 0, 15, 10] #Countryside
]
end
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
614
Configuration that uses zones: WEATHER_SUBSTITUTE, ZONE_MAPS, MAPS_POSITIONS and all of the ZONE_WEATHER. That means that you have to have as many zones in all of them for the plugin to work.

You have 6 zones defined in ZONE_MAPS and all the ZONE_WEATHER but only have the default zones in WEATHER_SUBSTITUTE and MAPS_POSITIONS. That means that you will be having errors when the plugin tries to define alternative weather for the zone (which is your problem) and when you open the Town Map (unless you use Arcky's Town Map).

For the WEATHER_SUBSTITUTE, you can have something as simple as this for no error if you don't want maps to have a different weather than the rest of the zone:
Ruby:
  WEATHER_SUBSTITUTE = [
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None}
  ]

As for the MAPS_POSITIONS, you have to link each unique point name to a map so the Town Map displays the proper weather. I would suggest linking each point name to the corresponding map but you can simply link all the point names of a zone to the same map if no map of the zone can have a different weather. For reference, those are the point names I'm referring to:
1701900302519.png
 

Aguadiablo

Novice
Member
Joined
Jul 26, 2023
Posts
22
Configuration that uses zones: WEATHER_SUBSTITUTE, ZONE_MAPS, MAPS_POSITIONS and all of the ZONE_WEATHER. That means that you have to have as many zones in all of them for the plugin to work.

You have 6 zones defined in ZONE_MAPS and all the ZONE_WEATHER but only have the default zones in WEATHER_SUBSTITUTE and MAPS_POSITIONS. That means that you will be having errors when the plugin tries to define alternative weather for the zone (which is your problem) and when you open the Town Map (unless you use Arcky's Town Map).

For the WEATHER_SUBSTITUTE, you can have something as simple as this for no error if you don't want maps to have a different weather than the rest of the zone:
Ruby:
  WEATHER_SUBSTITUTE = [
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None}
  ]

As for the MAPS_POSITIONS, you have to link each unique point name to a map so the Town Map displays the proper weather. I would suggest linking each point name to the corresponding map but you can simply link all the point names of a zone to the same map if no map of the zone can have a different weather. For reference, those are the point names I'm referring to:
View attachment 23059

Ah, okay. I was a bit confused about the WEATHER_SUBSTITUTE and MAPS_POSITIONS.

I think MAPS_POSITIONS is making slightly more sense now, but I am still confused about WEATHER_SUBSTITUTE.
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
614
It works with MAPS_SUBSTITUTE. In MAPS_SUBSTITUTE you define a weather and which maps will be the only ones having a chance of having it (using "include") or that will never display it (using "exclude"). Then, on WEATHER_SUBSTITUTE, you define (per zone) which weather will happen on a map if they can't have the main one.

For example: you define a zone with 5 maps and 1 of them is a beach. You want this zone to have a chance of having snow and blizzard and want the beach to have the same weather at the same moment as the other 4 maps but without the snow or blizzard. Let's say that you only have 1 zone defined, the maps have ID from 1 to 5 and the beach one has ID 4. Then you would have something like this:
Ruby:
#===============================================================================
# * Weather Substitute
#===============================================================================
  # A hash with the ID of the maps that will have or not have certain weathers.
  MAPS_SUBSTITUTE = {
    :Snow => ["exclude", 4],
    :Blizzard => ["exclude", 4]
  }

  # 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 = [
    {:Snow => :Rain, :Blizzard => :Storm}
  ]

#===============================================================================
# * 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 = [   
    [1, 2, 3, 4, 5]
  ]
 

OkunoShio

Cooltrainer
Member
Joined
Oct 22, 2022
Posts
127
Once again I am here to bother you... 😅 I was doing some stress testing on whether the weather effects can all appear on my maps, and ran into this:
image.png

This is one of my "Yosei Woods" maps. It should have 55% no weather, 15% rain, 15% sun and 15% fog - but no sandstorm. And I cannot seem to get fog at all. Let me also link my Configuration file again, just to make sure its up to date here ;)


Ruby:
#===============================================================================
# * Weather System Configuration
#===============================================================================

module WeatherConfig
  # Set to false to use the Weather System.
  NO_WEATHER = false        # Default: false

  # Set to false to use the Weather System.
  SHOW_WEATHER_ON_MAP = true    # 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 = 8        # Default: 1
  CHANGE_TIME_MAX = 16        # 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 = [50]

  # 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", 98, 117]
    #: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 = [
    {:Snow => :Sun},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None}
  ]

#===============================================================================
# * 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 = [
    [22, 32, 33, 98, 156, 117],#Shison & Routes
    [15, 376, 377, 378],#Chushin City
    [86, 384, 385, 386],#Aki Forest
    [81, 82, 83, 84],#Noyanagi
    [88, 95, 92, 93],#Yosei Woods
    [94, 99, 100, 101],#Suna Beach
    [131, 133, 134, 135],#Sakyu Valley
    [138, 155, 169, 170, 171],#Shimo Mountain
    [177, 183, 185, 186],#Kiri Forest
    [179, 102],#Road of Ascension
    [372, 107, 124, 123, 126, 127, 128, 130, 112, 113]#Indoor Maps
  ]

#===============================================================================
# * 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},
    {"Shison Village" => 22, "Route 1" => 32, "Route 2" => 33, "Route 3" => 98, "Route 4" => 156, "Netsumachi" => 117 ,"Kazan Passage" => 124},
    {"Chushin City" => 15},
    {"Aki Forest" => 86},
    {"Noyanagi Plains" => 81},
    {"Yosei Woods" => 88},
    {"Suna Beach" => 94},
    {"Sakyu Valley" => 131},
    {"Yuki Village" => 138, "Shimo Mountain" => 155},
    {"Kiri Forest" => 177},
    {"Road of Ascension" => 179, "Keisatsu Castle" => 102},
    {"Aki Gate" => 372, "Yosei - Suna Gate" => 107, "Kazan Passage" => 124, "Kazan Mountain" => 123, "Yama Passage" => 112}
  ]

  # 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 = [
    [45, 20, 0, 15, 0, 0, 0, 20, 0],#Shison & Routes
    [45, 20, 0, 15, 0, 0, 0, 20, 0],#Chushin City
    [35, 20, 0, 15, 0, 0, 0, 15, 15],#Aki Forest
    [55, 15, 0, 15, 0, 0, 0, 15, 0],#Noyanagi
    [55, 15, 0, 0, 0, 0, 0, 15, 15],#Yosei Woods
    [40, 10, 15, 0, 0, 0, 0, 35, 0],#Suna Beach
    [50, 0, 0, 0, 0, 15, 0, 35, 0],#Sakyu Valley
    [20, 0, 0, 50, 15, 0, 0, 15, 0],#Shimo Mountain
    [35, 25, 0, 15, 0, 0, 0, 0, 25],#Kiri Forest
    [0, 0, 0, 100, 0, 0, 0, 0, 0],#Road of Ascension
    [100, 0, 0, 0, 0, 0, 0, 0, 0]#Indoor Maps
  ]

  # Probability of weather in autumn.
  # Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
  ZONE_WEATHER_AUTUMN = [
    [45, 20, 0, 15, 0, 0, 0, 20, 0],#Shison & Routes
    [45, 20, 0, 15, 0, 0, 0, 20, 0],#Chushin City
    [35, 20, 0, 15, 0, 0, 0, 15, 15],#Aki Forest
    [55, 15, 0, 15, 0, 0, 0, 15, 0],#Noyanagi
    [55, 15, 0, 0, 0, 0, 0, 15, 15],#Yosei Woods
    [40, 10, 15, 0, 0, 0, 0, 35, 0],#Suna Beach
    [50, 0, 0, 0, 0, 15, 0, 35, 0],#Sakyu Valley
    [20, 0, 0, 50, 15, 0, 0, 15, 0],#Shimo Mountain
    [35, 25, 0, 15, 0, 0, 0, 0, 25],#Kiri Forest
    [0, 0, 0, 100, 0, 0, 0, 0, 0],#Road of Ascension
    [100, 0, 0, 0, 0, 0, 0, 0, 0]#Indoor Maps
  ]

  # Probability of weather in winter.
  # Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
  ZONE_WEATHER_WINTER = [
    [45, 20, 0, 15, 0, 0, 0, 20, 0],#Shison & Routes
    [45, 20, 0, 15, 0, 0, 0, 20, 0],#Chushin City
    [35, 20, 0, 15, 0, 0, 0, 15, 15],#Aki Forest
    [55, 15, 0, 15, 0, 0, 0, 15, 0],#Noyanagi
    [55, 15, 0, 0, 0, 0, 0, 15, 15],#Yosei Woods
    [40, 10, 15, 0, 0, 0, 0, 35, 0],#Suna Beach
    [50, 0, 0, 0, 0, 15, 0, 35, 0],#Sakyu Valley
    [20, 0, 0, 50, 15, 0, 0, 15, 0],#Shimo Mountain
    [35, 25, 0, 15, 0, 0, 0, 0, 25],#Kiri Forest
    [0, 0, 0, 100, 0, 0, 0, 0, 0],#Road of Ascension
    [100, 0, 0, 0, 0, 0, 0, 0, 0]#Indoor Maps
  ]

  # Probability of weather in spring.
  # Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
  ZONE_WEATHER_SPRING = [
    [45, 20, 0, 15, 0, 0, 0, 20, 0],#Shison & Routes
    [45, 20, 0, 15, 0, 0, 0, 20, 0],#Chushin City
    [35, 20, 0, 15, 0, 0, 0, 15, 15],#Aki Forest
    [55, 15, 0, 15, 0, 0, 0, 15, 0],#Noyanagi
    [55, 15, 0, 0, 0, 0, 0, 15, 15],#Yosei Woods
    [40, 10, 15, 0, 0, 0, 0, 35, 0],#Suna Beach
    [50, 0, 0, 0, 0, 15, 0, 35, 0],#Sakyu Valley
    [20, 0, 0, 50, 15, 0, 0, 15, 0],#Shimo Mountain
    [35, 25, 0, 15, 0, 0, 0, 0, 25],#Kiri Forest
    [0, 0, 0, 100, 0, 0, 0, 0, 0],#Road of Ascension
    [100, 0, 0, 0, 0, 0, 0, 0, 0]#Indoor Maps
  ]
end

Any idea what could cause this? And thank you as always for your help!!
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
614
Just to be sure. Does this happen on a new save file? Did you have a code to change the weather probability on an event that could have been activated? I will look at the code that checks for weather probability, but wanted to be sure I had all the info.
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
614
Once again I am here to bother you... 😅 I was doing some stress testing on whether the weather effects can all appear on my maps, and ran into this:
image.png

This is one of my "Yosei Woods" maps. It should have 55% no weather, 15% rain, 15% sun and 15% fog - but no sandstorm. And I cannot seem to get fog at all. Let me also link my Configuration file again, just to make sure its up to date here ;)


Ruby:
#===============================================================================
# * Weather System Configuration
#===============================================================================

module WeatherConfig
  # Set to false to use the Weather System.
  NO_WEATHER = false        # Default: false

  # Set to false to use the Weather System.
  SHOW_WEATHER_ON_MAP = true    # 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 = 8        # Default: 1
  CHANGE_TIME_MAX = 16        # 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 = [50]

  # 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", 98, 117]
    #: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 = [
    {:Snow => :Sun},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None}
  ]

#===============================================================================
# * 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 = [
    [22, 32, 33, 98, 156, 117],#Shison & Routes
    [15, 376, 377, 378],#Chushin City
    [86, 384, 385, 386],#Aki Forest
    [81, 82, 83, 84],#Noyanagi
    [88, 95, 92, 93],#Yosei Woods
    [94, 99, 100, 101],#Suna Beach
    [131, 133, 134, 135],#Sakyu Valley
    [138, 155, 169, 170, 171],#Shimo Mountain
    [177, 183, 185, 186],#Kiri Forest
    [179, 102],#Road of Ascension
    [372, 107, 124, 123, 126, 127, 128, 130, 112, 113]#Indoor Maps
  ]

#===============================================================================
# * 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},
    {"Shison Village" => 22, "Route 1" => 32, "Route 2" => 33, "Route 3" => 98, "Route 4" => 156, "Netsumachi" => 117 ,"Kazan Passage" => 124},
    {"Chushin City" => 15},
    {"Aki Forest" => 86},
    {"Noyanagi Plains" => 81},
    {"Yosei Woods" => 88},
    {"Suna Beach" => 94},
    {"Sakyu Valley" => 131},
    {"Yuki Village" => 138, "Shimo Mountain" => 155},
    {"Kiri Forest" => 177},
    {"Road of Ascension" => 179, "Keisatsu Castle" => 102},
    {"Aki Gate" => 372, "Yosei - Suna Gate" => 107, "Kazan Passage" => 124, "Kazan Mountain" => 123, "Yama Passage" => 112}
  ]

  # 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 = [
    [45, 20, 0, 15, 0, 0, 0, 20, 0],#Shison & Routes
    [45, 20, 0, 15, 0, 0, 0, 20, 0],#Chushin City
    [35, 20, 0, 15, 0, 0, 0, 15, 15],#Aki Forest
    [55, 15, 0, 15, 0, 0, 0, 15, 0],#Noyanagi
    [55, 15, 0, 0, 0, 0, 0, 15, 15],#Yosei Woods
    [40, 10, 15, 0, 0, 0, 0, 35, 0],#Suna Beach
    [50, 0, 0, 0, 0, 15, 0, 35, 0],#Sakyu Valley
    [20, 0, 0, 50, 15, 0, 0, 15, 0],#Shimo Mountain
    [35, 25, 0, 15, 0, 0, 0, 0, 25],#Kiri Forest
    [0, 0, 0, 100, 0, 0, 0, 0, 0],#Road of Ascension
    [100, 0, 0, 0, 0, 0, 0, 0, 0]#Indoor Maps
  ]

  # Probability of weather in autumn.
  # Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
  ZONE_WEATHER_AUTUMN = [
    [45, 20, 0, 15, 0, 0, 0, 20, 0],#Shison & Routes
    [45, 20, 0, 15, 0, 0, 0, 20, 0],#Chushin City
    [35, 20, 0, 15, 0, 0, 0, 15, 15],#Aki Forest
    [55, 15, 0, 15, 0, 0, 0, 15, 0],#Noyanagi
    [55, 15, 0, 0, 0, 0, 0, 15, 15],#Yosei Woods
    [40, 10, 15, 0, 0, 0, 0, 35, 0],#Suna Beach
    [50, 0, 0, 0, 0, 15, 0, 35, 0],#Sakyu Valley
    [20, 0, 0, 50, 15, 0, 0, 15, 0],#Shimo Mountain
    [35, 25, 0, 15, 0, 0, 0, 0, 25],#Kiri Forest
    [0, 0, 0, 100, 0, 0, 0, 0, 0],#Road of Ascension
    [100, 0, 0, 0, 0, 0, 0, 0, 0]#Indoor Maps
  ]

  # Probability of weather in winter.
  # Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
  ZONE_WEATHER_WINTER = [
    [45, 20, 0, 15, 0, 0, 0, 20, 0],#Shison & Routes
    [45, 20, 0, 15, 0, 0, 0, 20, 0],#Chushin City
    [35, 20, 0, 15, 0, 0, 0, 15, 15],#Aki Forest
    [55, 15, 0, 15, 0, 0, 0, 15, 0],#Noyanagi
    [55, 15, 0, 0, 0, 0, 0, 15, 15],#Yosei Woods
    [40, 10, 15, 0, 0, 0, 0, 35, 0],#Suna Beach
    [50, 0, 0, 0, 0, 15, 0, 35, 0],#Sakyu Valley
    [20, 0, 0, 50, 15, 0, 0, 15, 0],#Shimo Mountain
    [35, 25, 0, 15, 0, 0, 0, 0, 25],#Kiri Forest
    [0, 0, 0, 100, 0, 0, 0, 0, 0],#Road of Ascension
    [100, 0, 0, 0, 0, 0, 0, 0, 0]#Indoor Maps
  ]

  # Probability of weather in spring.
  # Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
  ZONE_WEATHER_SPRING = [
    [45, 20, 0, 15, 0, 0, 0, 20, 0],#Shison & Routes
    [45, 20, 0, 15, 0, 0, 0, 20, 0],#Chushin City
    [35, 20, 0, 15, 0, 0, 0, 15, 15],#Aki Forest
    [55, 15, 0, 15, 0, 0, 0, 15, 0],#Noyanagi
    [55, 15, 0, 0, 0, 0, 0, 15, 15],#Yosei Woods
    [40, 10, 15, 0, 0, 0, 0, 35, 0],#Suna Beach
    [50, 0, 0, 0, 0, 15, 0, 35, 0],#Sakyu Valley
    [20, 0, 0, 50, 15, 0, 0, 15, 0],#Shimo Mountain
    [35, 25, 0, 15, 0, 0, 0, 0, 25],#Kiri Forest
    [0, 0, 0, 100, 0, 0, 0, 0, 0],#Road of Ascension
    [100, 0, 0, 0, 0, 0, 0, 0, 0]#Indoor Maps
  ]
end

Any idea what could cause this? And thank you as always for your help!!
See if the update fixes this. I think the problem was that, somehow, you managed to get a value of 0 randomly generated when the plugin was comparing the sandstorm probability.

As for the fog, I would suggest adding an incredibly high number to it (something like 400) just to check if there's a problem that causes the fog not to appear or if it's just your luck. I would also suggest checking the weather in some way when no weather is on display to see if the fog weather was chosen and is simply not appearing.
 
Back
Top