• The Eevee Expo Game Jam #10 has concluded, congratulations to all participants! Now it's time for the judges to play through the games, and you can play along to vote who deserves the community choice spotlight.
    You can check out the submitted games here!
    Play through the games and provide some feedback to the devs while you're at it!
  • 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.8

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
663
First of all, NO_WEATHER = true disables the weather. Unless you turn it to false sometime during the game, you will have no weather.

Aside from that, I see no problem. I tested it with your configuration but I'm having no error.
Two questions:
  1. Have you started a new game after making the changes?
  2. When does the error pop up? (As soon as you try to start a new game, when you try to continue with a save, when trying to change maps...)
 

Blakeline

Novice
Member
Joined
Nov 25, 2023
Posts
10
I turned that on when testing and forgot to disable it. I tried again with NO_WEATHER to false and obviously now it works haha, so I guess the issue really was that I was not using WeatherConfig::ZONE_WEATHER_SUMMER to define the other seasonal weathers. Thanks a whole lot, you really helped me out !
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
663
Glad we could finally find the issue! But I'm not sure why you were having this last error because of having the system off. I did try it and it just meant the weather not showing.
 

Blakeline

Novice
Member
Joined
Nov 25, 2023
Posts
10
Okay... that's peculiar. So, the weather system seems to be working. When I started the game with those settings it immediately started raining which is a good sign. I saved, went into config, changed it to 100% snow and 0% rain, went back in, and it was still raining. Normal so far. I talk to an npc that forces the weather update, go inside a house, walk back outside, and it's snowing. Seems like everything works.

But then I go to the TV to turn on a weather forecast and... the undefined method for nilclass pops up again. This is the error log :
[2023-11-25 18:50:24 +0100]
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.5]

Script error in event 35 (coords 9,11), map 32 (Tourneuve)
Exception: NoMethodError
Message: undefined method `[]' for nil:NilClass

***Full script:
pbWeatherForecast(0)

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'
Scene_Map:167:in `block in update'
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
663
Ok, that is an error on my part. I don't remember how I had the weather names defined in the configuration before but I didn't update the forecast since I first made it. I'll update the plugin with this fixed.
 

Blakeline

Novice
Member
Joined
Nov 25, 2023
Posts
10
That seems to have done it ! Thank you so much, this has honestly been a huge help. Glad I could track an issue down !
 

Jangajinx

An Overly Ambitious Developer
Member
Joined
Apr 21, 2023
Posts
213
Love this plugin! I wonder would it be possible for the real time feature be changed while the game is running? I have an option where players can switch between real and unreal time. Using the following to alter between the two options.

@unreal_time_usage = 0

Also, not sure what I am missing here, but I am not seeing the weather show up on the map for some reason. Everything was installed as default.
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
663
WeatherConfig::USE_REAL_TIME = true to use the PC time. WeatherConfig::USE_REAL_TIME = false to use Unreal Time System. Those codes should work on a script call on any event or any other plugin.

As for the weather not displaying on map, it could be that the active weather is "none". A good way to see if the system works is having a 0 probability for "none" and 100 (or any number different than 0) on rain. If the system works (which should), it should rain outdoors. You can configure probabilities for other weathers, the result should be similar. The weather each time you start a new game would be random but will always show the weather on screen.

Also, you have to do some configuration. You have to define the zones (and which maps are in said zones), the probability of each weather for each zone and season and some other things unique to your game.
 

Jangajinx

An Overly Ambitious Developer
Member
Joined
Apr 21, 2023
Posts
213
As for the weather not displaying on map, it could be that the active weather is "none". A good way to see if the system works is having a 0 probability for "none" and 100 (or any number different than 0) on rain. If the system works (which should), it should rain outdoors. You can configure probabilities for other weathers, the result should be similar. The weather each time you start a new game would be random but will always show the weather on screen.

Also, you have to do some configuration. You have to define the zones (and which maps are in said zones), the probability of each weather for each zone and season and some other things unique to your game.
I have not really made any maps changes so far. Map is default as it comes. In the picture below, It is raining where I am on the map, but there is no indication of rain or weather on town map. I am outside and set the config to understand I started the game indoors.

1701028721552.png


I may not be understanding what I should be seeing on the town map.
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
663
Ah, your only problem was with the town map? If you uninstall Arcky's Town Map it should appear. As I said, that feature isn't available with that plugin yet.
 

Jangajinx

An Overly Ambitious Developer
Member
Joined
Apr 21, 2023
Posts
213
Ah, your only problem was with the town map? If you uninstall Arcky's Town Map it should appear. As I said, that feature isn't available with that plugin yet.
Sorry late to this reply. I was under the assumption that it was. Ill wait for an update than my friend. Thanks for clearing that up for me.
 

Jangajinx

An Overly Ambitious Developer
Member
Joined
Apr 21, 2023
Posts
213
Sorry I am a bit lost. I have read through everything, but how do I add a new zone?
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
663
Ok, since there are multiple places where you have to define each zone, I'll explain how to do so for them.

So, the first one you'll find scrolling down the configuration file is WEATHER_SUBSTITUTE. This one is to define what main weather (the one that would normally happen) is changed for what weather in the maps defined to do so in MAPS_SUBSTITUTE. So by default, it looks like that (edited so it's easier to see my point):
Ruby:
Expand Collapse Copy
  WEATHER_SUBSTITUTE = [
    {:None => :None, :Rain => :Rain, :Storm => :Storm, :Snow => :Rain, :Blizzard => :Storm, :Sandstorm => :None},  #Zone 1
    {:Snow => :Rain, :Blizzard => :Storm, :Sandstorm => :None},  #Zone 2
    {:Snow => :Rain, :Blizzard => :HeavyRain}  #Zone 3
  ]
Like that, it has 3 zones. If I do that, it now has 4 zones:
Ruby:
Expand Collapse Copy
  WEATHER_SUBSTITUTE = [
    {:None => :None, :Rain => :Rain, :Storm => :Storm, :Snow => :Rain, :Blizzard => :Storm, :Sandstorm => :None},  #Zone 1
    {:Snow => :Rain, :Blizzard => :Storm, :Sandstorm => :None},  #Zone 2
    {:Snow => :Rain, :Blizzard => :HeavyRain},  #Zone 3
    {:None => :None}  #Zone 4
  ]
MAPS_POSITIONS works like that as well, just that you have to define the name of the map in the Town map and which map it corresponds to. Try not to have more than 1 map share the name or it'll bring trouble. Arcky's Town Map isn't compatible with this function yet but when it is, it'll likely use this to show the proper weather for each map.

The next one is the ZONE_MAPS. This one is what the plugin actually uses to see how many zones there are but you'll want all of the places I mention here to have the same number of zones.
By default, ZONE_MAPS looks like that:
Ruby:
Expand Collapse Copy
  ZONE_MAPS = [
    [2, 5],  #Zone 1
    [7],  #Zone 2
    [21]  #Zone 3
  ]
And with 4 zones it would look like that:
Ruby:
Expand Collapse Copy
  ZONE_MAPS = [
    [2, 5],  #Zone 1
    [7],  #Zone 2
    [21],  #Zone 3
    [30, 31]  #Zone 4
  ]
All of the seasonal zone weather works like that, just that with the probability of each main weather. The order for each (default) weather is stated above each seasonal weather. If you have added your own custom weather, the plugin can work with it. Look in GameData::Weather.tegister for each weather for their id_number to see in which order you have to define the probability for each weather.
Be aware that, like I said, the seasonal weather works with the main weather and not the secondary (or substitute) weather. The secondary weather will just change one weather for an allowed one for that map.
 

Jangajinx

An Overly Ambitious Developer
Member
Joined
Apr 21, 2023
Posts
213
Ok, since there are multiple places where you have to define each zone, I'll explain how to do so for them.

So, the first one you'll find scrolling down the configuration file is WEATHER_SUBSTITUTE. This one is to define what main weather (the one that would normally happen) is changed for what weather in the maps defined to do so in MAPS_SUBSTITUTE. So by default, it looks like that (edited so it's easier to see my point):
Ruby:
Expand Collapse Copy
  WEATHER_SUBSTITUTE = [
    {:None => :None, :Rain => :Rain, :Storm => :Storm, :Snow => :Rain, :Blizzard => :Storm, :Sandstorm => :None},  #Zone 1
    {:Snow => :Rain, :Blizzard => :Storm, :Sandstorm => :None},  #Zone 2
    {:Snow => :Rain, :Blizzard => :HeavyRain}  #Zone 3
  ]
Like that, it has 3 zones. If I do that, it now has 4 zones:
Ruby:
Expand Collapse Copy
  WEATHER_SUBSTITUTE = [
    {:None => :None, :Rain => :Rain, :Storm => :Storm, :Snow => :Rain, :Blizzard => :Storm, :Sandstorm => :None},  #Zone 1
    {:Snow => :Rain, :Blizzard => :Storm, :Sandstorm => :None},  #Zone 2
    {:Snow => :Rain, :Blizzard => :HeavyRain},  #Zone 3
    {:None => :None}  #Zone 4
  ]
MAPS_POSITIONS works like that as well, just that you have to define the name of the map in the Town map and which map it corresponds to. Try not to have more than 1 map share the name or it'll bring trouble. Arcky's Town Map isn't compatible with this function yet but when it is, it'll likely use this to show the proper weather for each map.

The next one is the ZONE_MAPS. This one is what the plugin actually uses to see how many zones there are but you'll want all of the places I mention here to have the same number of zones.
By default, ZONE_MAPS looks like that:
Ruby:
Expand Collapse Copy
  ZONE_MAPS = [
    [2, 5],  #Zone 1
    [7],  #Zone 2
    [21]  #Zone 3
  ]
And with 4 zones it would look like that:
Ruby:
Expand Collapse Copy
  ZONE_MAPS = [
    [2, 5],  #Zone 1
    [7],  #Zone 2
    [21],  #Zone 3
    [30, 31]  #Zone 4
  ]
All of the seasonal zone weather works like that, just that with the probability of each main weather. The order for each (default) weather is stated above each seasonal weather. If you have added your own custom weather, the plugin can work with it. Look in GameData::Weather.tegister for each weather for their id_number to see in which order you have to define the probability for each weather.
Be aware that, like I said, the seasonal weather works with the main weather and not the secondary (or substitute) weather. The secondary weather will just change one weather for an allowed one for that map.
I am sorry I wasted your time. I just realized the issue was I did not set the map to outdoors in the metadata. 🙃
 

OkunoShio

Cooltrainer
Member
Joined
Oct 22, 2022
Posts
128
Hey there! In many cases (not always) when I try to open the Town Map on an indoors map, it gives me this error:

Code:
Expand Collapse Copy
=================

[2023-12-03 12:59:41 +0100]
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]

Exception: NoMethodError
Message: undefined method `mainWeather' for [#<WeatherSystemData>, #<WeatherSystemData>, #<WeatherSystemData>, #<WeatherSystemData>, #<WeatherSystemData>, #<WeatherSystemData>, #<WeatherSystemData>, #<WeatherSystemData>, #<WeatherSystemData>, #<WeatherSystemData>]:Array

Backtrace:
[Lin's Weather System] 02 - Map_Display v20.1.rb:18:in `pbStartScene'
287:UI_RegionMap:347:in `pbStartScreen'
287:UI_RegionMap:361:in `block in pbShowMap'
082:MessageConfig:570:in `pbFadeOutIn'
287:UI_RegionMap:358:in `pbShowMap'
[Voltseon's Pause Menu] 005_VoltseonMenu_Entries.rb:153:in `selected'
[Voltseon's Pause Menu] 003_VoltseonMenu_Menu.rb:58:in `update'
[Voltseon's Pause Menu] 002_VoltseonMenu_Main.rb:219:in `block in update'
[Voltseon's Pause Menu] 002_VoltseonMenu_Main.rb:215:in `loop'
[Voltseon's Pause Menu] 002_VoltseonMenu_Main.rb:215:in `update'

(It happens both from Volteons Pause Menu as well as when I open the Town Map from the bag directly).
Any idea what the cause of this could be? Because I am a little lost on this one :(
 

OkunoShio

Cooltrainer
Member
Joined
Oct 22, 2022
Posts
128
Here is also my complete Configuration:


Ruby:
Expand Collapse Copy
#===============================================================================
# * 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 = [
    {:None => :None, :Rain => :Rain, :Storm => :Storm, :Snow => :Snow, :Blizzard => :Blizzard, :Sandstorm => :Sandstorm, :HeavyRain => :HeavyRain, :Sun => :Sun, :Fog => :Fog},
    {:None => :None, :Rain => :Rain, :Storm => :Storm, :Snow => :Snow, :Blizzard => :Blizzard, :Sandstorm => :Sandstorm, :HeavyRain => :HeavyRain, :Sun => :Sun, :Fog => :Fog},
    {:None => :None, :Rain => :Rain, :Storm => :Storm, :Snow => :Snow, :Blizzard => :Blizzard, :Sandstorm => :Sandstorm, :HeavyRain => :HeavyRain, :Sun => :Sun, :Fog => :Fog},
    {:None => :None, :Rain => :Rain, :Storm => :Storm, :Snow => :Snow, :Blizzard => :Blizzard, :Sandstorm => :Sandstorm, :HeavyRain => :HeavyRain, :Sun => :Sun, :Fog => :Fog},
    {:None => :None, :Rain => :Rain, :Storm => :Storm, :Snow => :Snow, :Blizzard => :Blizzard, :Sandstorm => :Sandstorm, :HeavyRain => :HeavyRain, :Sun => :Sun, :Fog => :Fog},
    {:None => :None, :Rain => :Rain, :Storm => :Storm, :Snow => :Snow, :Blizzard => :Blizzard, :Sandstorm => :Sandstorm, :HeavyRain => :HeavyRain, :Sun => :Sun, :Fog => :Fog},
    {:None => :None, :Rain => :Rain, :Storm => :Storm, :Snow => :Snow, :Blizzard => :Blizzard, :Sandstorm => :Sandstorm, :HeavyRain => :HeavyRain, :Sun => :Sun, :Fog => :Fog},
    {:None => :None, :Rain => :Rain, :Storm => :Storm, :Snow => :Snow, :Blizzard => :Blizzard, :Sandstorm => :Sandstorm, :HeavyRain => :HeavyRain, :Sun => :Sun, :Fog => :Fog},
    {:None => :None, :Rain => :Rain, :Storm => :Storm, :Snow => :Snow, :Blizzard => :Blizzard, :Sandstorm => :Sandstorm, :HeavyRain => :HeavyRain, :Sun => :Sun, :Fog => :Fog},
    {:None => :None, :Rain => :Rain, :Storm => :Storm, :Snow => :Snow, :Blizzard => :Blizzard, :Sandstorm => :Sandstorm, :HeavyRain => :HeavyRain, :Sun => :Sun, :Fog => :Fog}
  ]

#===============================================================================
# * 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, "Chushin City" => 376, "Chushin City" => 377, "Chushin City" => 378},
    {"Aki Forest" => 86, "Aki Forest" => 384, "Aki Forest" => 385, "Aki Forest" => 386},
    {"Noyanagi Plains" => 81, "Noyanagi Plains" => 82, "Noyanagi Plains" => 83, "Noyanagi Plains" => 84},
    {"Yosei Woods" => 88, "Yosei Woods" => 95, "Yosei Woods" => 92, "Yosei Woods" => 93},
    {"Suna Beach" => 94, "Suna Beach" => 99, "Suna Beach" => 100, "Suna Beach" => 101},
    {"Sakyu Valley" => 131, "Sakyu Valley" => 133, "Sakyu Valley" => 134, "Sakyu Valley" => 135},
    {"Yuki Village" => 138, "Shimo Mountain" => 155, "Shimo Mountain" => 169, "Shimo Mountain" => 170, "Shimo Mountain" => 171},
    {"Kiri Forest" => 177, "Kiri Forest" => 183, "Kiri Forest" => 185, "Kiri Forest" => 186},
    {"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
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
663
First, you don't need to define each weather in WEATHER_SUBSTITUTE if you will not change them to something else. Just having {:None => :None} will make it work just the same.

And I see you have two maps to have another weather when snow is the main weather but you are defining snow as their only weather possibility so I'm not sure what you are trying here?

Aside from that, some maps share the same name in MAPS_POSITIONS. Since they all have the same weather, delete the "duplicates" so you end with each name having only one map tied to them. It should look like this:
Ruby:
Expand Collapse Copy
  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}
  ]
Check if it solves the problem. If it does, I'll assume the plugin was having trouble retrieving a zone because of the multiple maps tied to a name and will comment about it in the instructions. If not, I will keep looking.
 

OkunoShio

Cooltrainer
Member
Joined
Oct 22, 2022
Posts
128
1) Okay I was not sure how to properly set it up and just went the extra mile to be save! :)

2) Those two maps are part of Zone 1, and they have None, Rain, Snow or Sun defined. I would have to add something like ":Snow => Sun" to WEATHER_SUBSTITUTE for Zone 1 then, right?

3) This is because my areas always consist of 4 tiles that have 4 different locations on the map, but are connected and have the same name. So I guess they all need to be in there to show the icon on all 4 locations of the map? I could maybe rename them and add something like NW, NE, SW, SE to make the names unique?

I find it weird that this error only occurs when I open the Town Map indoors, though 🤔
 
Last edited:

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
663
2) WEATHER_SUBSTITUTE works with MAPS_SUBSTITUTE. In MAPS_SUBSTITUTE, you are telling the plugin which weather you want to appear in only some maps (with the "include") or you don't want to appear in some maps (with the "exclude"). In WEATHER_SUBSTITUTE, you are telling the plugin to which weather changes it depending on the zone said maps are.
Let's say that the 2 maps you included there are on the coast and, because of it, you don't want there to snow or blizzard. You'll define them on MAPS_SUBSTITUTE for both snow and blizzard with the "exclude" and then you'll define a weather to change it for the proper zone, rain and storm for example. It would look something like this:
Ruby:
Expand Collapse Copy
  MAPS_SUBSTITUTE = {
    :Snow => ["exclude", 98, 117]
    :Blizzard => ["exclude", 98, 117],
    #    :Sandstorm => ["include", 5]
  }
  WEATHER_SUBSTITUTE = [
    {:Snow => :Rain, :Blizzard => :Storm},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None},
    {:None => :None}
  ]

3) The town map doesn't work with maps, but point names. What the plugin does here is check what name the point the cursor is in has. Then it checks which map you linked to that name to retrieve the weather for that place. In your case, this will mean that it will retrieve the zone's weather except for Route 3 and Netsumachi, which will show a different weather if you define one for snow (as you have it configured now). For that reason, you don't need to link each map to a point name.

In case you wanted a map with the same point name as another to have different weather, I would suggest having the point names be slightly different. For example, if you had each zone of the forest have a different weather, you could have it in the town map divided into "Kiri Forest (North)", "Kiri Forest (South)", "Kiri Forest (East)" and "Kiri Forest (West)" and then link each map to one of those point names to properly display their weather.
 
Back
Top