• 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.
Resource icon

Resource [20.1+] Weather System 1.3.10

Willix

Novice
Member
Joined
Feb 7, 2024
Posts
42
Oh, wait, I see what the problem is. In the MAPS_SUBSTITUTE, you don't use the secondary weather. The code uses the primary weather to see if a map should not have the primary weather (exclude) or if it is the only map in a zone with that weather (include). So, you should change it to something like this:
Ruby:
Expand Collapse Copy
  MAPS_SUBSTITUTE = {
    #:Snow => ["exclude", 1, 4],
    #:Blizzard => ["exclude", 1, 4],
    #:Sandstorm => ["include", 5]
    :Rain => ["exclude", 5],
    :HeavyRain => ["exclude", 5],
    :Storm => ["exclude", 59, 60, 127]
  }

I'll add the explanation to the configuration file so people can understand how to configure it. I don't know why I didn't include it before.
Ooooh okay, now it is working perfectly. I knew it was just me not understanding how to configure it lol. Also thanks for the typo, I had def missed that 0 on the summer array
 

ClessioTV

Elite Trainer
Member
Joined
Sep 24, 2022
Posts
270
=================

[2024-08-28 15:37:18 +0200]
[Pokémon Essentials version 21.1]
[v21 Hotfixes 1.0.1]
[v21.1 Hotfixes 1.0.9]
[EBDX v1.4.7.1 (E21)]

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:143:in `block in pbInitializeWeather'
[Lin's Weather System] 01 - Main.rb:123:in `each'
[Lin's Weather System] 01 - Main.rb:123:in `pbInitializeWeather'
[Lin's Weather System] 03 - Handler.rb:10:in `block in <main>'
Event_Handlers:89:in `block in trigger'
Event_Handlers:89:in `each_value'
Event_Handlers:89:in `trigger'
Event_HandlerCollections:63:in `trigger'
Game_MapFactory:147:in `setMapChanged'
#===============================================================================
# * Weather System Configuration
#===============================================================================
module WeatherConfig
# Set to false to use the Weather System.
NO_WEATHER = false # Default: false
# Set to true to show the weather on the Town Map.
SHOW_WEATHER_ON_MAP = 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 = 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 = 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 = true # 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, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
# 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 = 1
AUTUMN_TILESET = 2
WINTER_TILESET = 3
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 = [
[8, 23],
[9, 24],
[10, 25],
[11, 26, 32],
[12, 27],
[13, 28],
[14, 29],
[15, 30],
[16, 31]
]
#===============================================================================
# * 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},
{"Town 1" => 8, "Route 1" => 23},
{"Town 2" => 9, "Route 2" => 24},
{"Town 3" => 10, "Route 3" => 25},
{"Town 4" => 11, "Route 4" => 26, "Route 10" => 32},
{"Town 5" => 12, "Route 5" => 27},
{"Town 6" => 13, "Route 6" => 28},
{"Town 7" => 14, "Route 7" => 29},
{"Town 8" => 15, "Route 8" => 30},
{"Town 9" => 16, "Route 9" => 31}
]
# 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 = [
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0]
]
# Probability of weather in autumn.
# Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
ZONE_WEATHER_AUTUMN = [
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0]
]
# Probability of weather in winter.
# Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
ZONE_WEATHER_WINTER = [
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0]
]
# Probability of weather in spring.
# Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
ZONE_WEATHER_SPRING = [
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0],
[100, 0, 0, 0, 0, 0, 0, 0]
]
end

Hello, I'm currently encountering this issue with the plugin when trying to start a "new game." Do you need more information from me about this bug, or do you have any questions?
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
676
I see that you have posted about two different errors.

For the first one, I could see no reason for it to happen unless you edited how seasons work in vanilla essentials. Since you took it out, I assume that it stopped happening.

As for the second error, you have fewer zones defined for WEATHER_SUBSTITUTE (3 zones) as there are zones in ZONE_MAPS (9 zones). You will need to add zones on the WEATHER_SUBSTITUTE array until it has 9 zones too. If you do not plan to use this system, you can fill the missing zones with {:None => :None} or things like that. {} seemed to work well for Willix too.

Also, I see that you have defined tilesets from 1 to 12 as outdoor tilesets but also add only 1 to 3 to their ID to get the summer, autumn and winter tilesets. You only define as outdoor tilesets the ones you actually use to create the map on the editor and is recommended for those tilesets to be of the same season so you can have one of the seasons add 0 to the tileset ID. Otherwise, it may cause season inconsistencies. For example, if you create two maps using tilesets 1 (a spring tileset) and 2 (a spring tileset), they will display in-game with tilesets 2 (spring tileset) and 3 (summer tileset) respectively when in summer and so on.
 

ClessioTV

Elite Trainer
Member
Joined
Sep 24, 2022
Posts
270
I see that you have posted about two different errors.

For the first one, I could see no reason for it to happen unless you edited how seasons work in vanilla essentials. Since you took it out, I assume that it stopped happening.

As for the second error, you have fewer zones defined for WEATHER_SUBSTITUTE (3 zones) as there are zones in ZONE_MAPS (9 zones). You will need to add zones on the WEATHER_SUBSTITUTE array until it has 9 zones too. If you do not plan to use this system, you can fill the missing zones with {:None => :None} or things like that. {} seemed to work well for Willix too.

Also, I see that you have defined tilesets from 1 to 12 as outdoor tilesets but also add only 1 to 3 to their ID to get the summer, autumn and winter tilesets. You only define as outdoor tilesets the ones you actually use to create the map on the editor and is recommended for those tilesets to be of the same season so you can have one of the seasons add 0 to the tileset ID. Otherwise, it may cause season inconsistencies. For example, if you create two maps using tilesets 1 (a spring tileset) and 2 (a spring tileset), they will display in-game with tilesets 2 (spring tileset) and 3 (summer tileset) respectively when in summer and so on.
Thank you for your help, I no longer have any issues in the game. As for the mapping, I'm still basing it on "Spring," specifically version 1, 5, 9. This shouldn't cause any problems, right?
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
676
There shouldn't be a problem so long you leave 3 unused tilesets between the ones you use on the RPG maker map editor.
 

Voletric

Rookie
Member
Joined
Sep 1, 2024
Posts
2
I'm currently having trouble getting weather to happen at all on any map IDs added to base 21.1 Essentials. I even put those Map IDs into the example ones and have tried to see if weather would show up if I bound one of the Map IDs to the Town Map (it did not). I've tried restarting, going in and out of indoor/outdoor maps, and anything else I could find that was tried here.

It works fine for all the example maps that came with essentials though, and displays those on the town map correctly. I'm using Unrealtime and I don't believe the few Plugins I do have conflict with Lin's Weather Systems (Just in case, I have the plugins Gen 9 Project, v21.1 Hotfixes, UnrealTime, Modular UI Scenes, and Enhanced Pokemon UI). I don't get any errors except when I call "pbForceUpdateWeather" with an event after I called "pbInitializeWeather" at all during the playtest, if that means anything. It pulls up this error:

Code:
Expand Collapse Copy
Exception: NoMethodError
Message: undefined method `length' for nil:NilClass

**Full script:
pbForceUpdateWeather()
pbInitializeWeather

Backtrace:
[Lin's Weather System] 01 - Main.rb:218:in `pbSetNewWeather'
[Lin's Weather System] 01 - Main.rb:196:in `block in pbForceUpdateWeather'
[Lin's Weather System] 01 - Main.rb:189:in `each'
[Lin's Weather System] 01 - Main.rb:189 `pbForceUpdateWeather'
(eval):1:in `execute_script'
Interperter:138:in `eval'
Interperter:138:in `execute_script'
Interperter_Commands:1177:in `command_335'
Interperter_Commands:116:in `execute_command'
Interperter:130:in `block in update'

Here is my Config as of right now:

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 = 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 = 4        # Default: 1
  CHANGE_TIME_MAX = 12        # 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],
    [42, 43, 77, 78, 80]
  ]
#===============================================================================
# * 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},
    {"Route 3" => 43}
  ]

  # 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, 0, 0, 0, 0, 0, 0, 0, 100]
  ]

  # 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, 0, 0, 0, 0, 0, 0, 0, 100]
  ]

  # 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, 0, 0, 0, 0, 0, 0, 0, 100]
  ]

  # 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, 0, 0, 0, 0, 0, 0, 0, 100]
  ]
end

Maybe I'm messing something simple up without realizing, but I can't figure out why it won't do anything with Map IDs outside of base essentials.
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
676
For the error you are getting:

1) the error log says you have them in the wrong order. You have to initialize the plugin (it should do so as soon as you start a new game or change maps) and then you can update the weather by force.

2) the code you used to force the update is wrong. It is pbForceUpdateWeather, without the "( )". It updates the weather for all zones so if you want to update a specific zone, you have to use pbForceUpdateZoneWeather(zone), with zone being the number of a zone, starting with 0.

As for the weather not displaying in the overworld:

The town map doesn't have anything to do with that. The town map only checks for the weather of a zone, checks if a map of the zone appears in the town map (by linking said map ID to a name that appears in the town map) and displays what weather should appear there. I see you did that though only map 43 is linked to a name. Are maps 42, 77, 78 and 80 also route 3? Or was it merely to check if the weather appeared on the town map?

The only real difference I can think of between the maps that come with vanilla essentials and the ones you created is the metadata. Have you defined the new maps as outdoors? The plugin only displays weather on a map if it is marked as outdoors on the metadata (so you can define indoor maps on a zone and use that to find in which zone you are, should you need it).
 

Voletric

Rookie
Member
Joined
Sep 1, 2024
Posts
2
For the error you are getting:

1) the error log says you have them in the wrong order. You have to initialize the plugin (it should do so as soon as you start a new game or change maps) and then you can update the weather by force.

2) the code you used to force the update is wrong. It is pbForceUpdateWeather, without the "( )". It updates the weather for all zones so if you want to update a specific zone, you have to use pbForceUpdateZoneWeather(zone), with zone being the number of a zone, starting with 0.

As for the weather not displaying in the overworld:

The town map doesn't have anything to do with that. The town map only checks for the weather of a zone, checks if a map of the zone appears in the town map (by linking said map ID to a name that appears in the town map) and displays what weather should appear there. I see you did that though only map 43 is linked to a name. Are maps 42, 77, 78 and 80 also route 3? Or was it merely to check if the weather appeared on the town map?

The only real difference I can think of between the maps that come with vanilla essentials and the ones you created is the metadata. Have you defined the new maps as outdoors? The plugin only displays weather on a map if it is marked as outdoors on the metadata (so you can define indoor maps on a zone and use that to find in which zone you are, should you need it).
Re(1): I tried a bunch of event tests that had ‘pbForceUpdateWeather’ and ‘pbInitializeWeather’ in various different events on different maps and no matter when and where I do these, ‘pbForceUpdateWeather’ works before ‘pbInitializeWeather’ is called, but if I do call ‘pbInitializeWeather’, ‘pbForceUpdateWeather’ will always call that error, even if I changed maps in between. That last function call actually works the first time I initiate it, and then calls the error if I call it again, even after entering and exiting between indoor and outdoor maps.

Re(2): I don’t think the ‘( )’ matters. I’ve noticed Ruby is a language that doesn’t mind if you omit certain Tokens that may be required by other programming languages.
I have events that use ‘pbForceUpdateWeather’ and ‘pbForceUpdateWeather()’ that have no functional difference. They both properly update the Essentials example maps correctly.

The route 3 was to show if that section on the base essentials town map would show Fog even though it didn’t seem to show up visually. It did not show up as fog on the town map, either.

All of my metadata is proper, I’ve quadruple checked it. All of the maps I’m trying to effect are outdoors and show night time shading (I have unreal time starting my game time at night).
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
676
If you use pbForceUpdateWeather only (without pbInitializeWeather) multiple times, does it work or it causes an error as well?

Seeing the last line of the code activated before the error, there seems to be a problem with the seasonal probabilities. Since you said that it works at least once, I'm not sure what is causing that to suddenly stop working (the error only tells me that there seem to be more zones defined than there are zones' probabilities, which doesn't seem the case looking at the configuration). I'll keep looking at this and what may cause that, since it's weird but I hope that not initializing the plugin again solves it.

As a side note, I see you changed the min and max time for the weather to change, but that only works when FORCE_UPDATE is false. When that configuration is set to true, the code doesn't check if the weather has to be updated every time the map is changed. pbForceUpdateWeather and pbForceUpdateZoneWeather(zone) can still work when FORCE_UPDATE is false, though. That option in the configuration is there if you want the weather to update only by interacting with events.
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
676
LinKazamine updated [20.1+] Weather System with a new update entry:

1.3.8

Fixed the code for pbInitializeWeather to stop it from creating extra weather zones not defined in the configuration file. With the fix, pbInitializeWeather now resets the weather of all zones (both current and future).

Since the plugin loads old saved weather if it exists when opening the game, it may be a good idea to add that code at the intro so the weather on the zones isn't exactly the same as the last saved game when starting a new game.

Read the rest of this update entry...
 

ClessioTV

Elite Trainer
Member
Joined
Sep 24, 2022
Posts
270
Do you have, or can you implement, a way to have seasonal encounters instead of weather-based encounters?
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
676
I'll have a look. I could add the weather based pools so it should be possible to add seasons to it too.
 

ClessioTV

Elite Trainer
Member
Joined
Sep 24, 2022
Posts
270
I'll have a look. I could add the weather based pools so it should be possible to add seasons to it too.
Thank you for your quick response, as always!
If you manage to do it, you will once again be my savior!
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
676
LinKazamine updated [20.1+] Weather System with a new update entry:

1.3.9

Added seasonal encounter pools. They aren't registered in the plugin but if you add them on 03 - Weather Encounters\01 - Encounter methods (or anywhere else), they should work.

The encounter structure should be one of the following: TypeWeather, TypeTimeWeather, TypeSeason, TypeTimeSeason, TypeWeatherSeason and TypeTimeWeatherSeason. Be sure to follow this structure when registering the seasonal encounters.

The code hasn't been tested so any report of problems will be...

Read the rest of this update entry...
 

Q-tip

Rookie
Member
Joined
May 4, 2024
Posts
1
Great plugin! Although I'm running into an issue, whenever I try and launch the game it tells me that the save data is corrupted, even after clearing all save data from the system.
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
676
If you tell the game 'yes' when it asks if you want to delete the save file, the error stays? I have just tested with an old saved file I had that told me that the save file was either corrupt or incompatible with the game and it solved when I did this. Unfortunately, I don't know what causes the problem so I can't help further than that.

Also, I have just tested with a saved file I made without the plugin and the game launched without problems when I added the plugin so that doesn't seem to be the cause. It seems that you or a plugin made serious changes to the saved data that has it made impossible for the old save file to still be used in your game.
 

ardicoozer

Cooltrainer
Member
Joined
Sep 29, 2020
Posts
173
I have found some typo in 01.Encounter methods.rb about :trigger_chance be a :trygger_chance in some encounters method
 
Back
Top