• 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

PFG (Frankly)

Moderated dev Essentials tinker
Member
Joined
Aug 11, 2017
Posts
29
i also have another question, can you have it set to off at the start but like have a script to turn it on or it can only be on or off


plus i mean the weather change every hour on a week schedule or a every day schedule depends and we get to customized the weather systems,


ps nvm on the overworld enhance weather, just found out its that plugin problems
 
Last edited:

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
674
Turn the NO_WEATHER variable in the configuration to true to start the game without the weather system on by default. Use WeatherConfig::NO_WEATHER = false in a script call in an event to turn the weather system on and WeatherConfig::NO_WEATHER = true to turn the weather system off. You don't need a specific default configuration to use those aside from knowing how was configured last.

You could also add something like this in the plugin and you'll just need to call pbTurnOffWeatherSystem(true) or pbTurnOffWeatherSystem(false):
Ruby:
Expand Collapse Copy
def pbTurnOffWeatherSystem(mode)
  WeatherConfig::NO_WEATHER = mode
end

Or something like this that will toggle the switch automatically by calling pbToggleWeatherSystem:
Ruby:
Expand Collapse Copy
def pbToggleWeatherSystem
  if WeatherConfig::NO_WEATHER
      WeatherConfig::NO_WEATHER = false
  else
      WeatherConfig::NO_WEATHER = true
  end
end
Note: You can name those codes any way you want to. Just make sure that whatever the name you gave them after "def", is what you use to call them.

The plugin is made for the weather to last for a day at least. If you have it configured to change at midnight, you will have to change the code to make it happen on another day's midnight. If you are making it change by the number of hours, you could make it change every two days, every week, every month, every year or any amount of time you decide as long as you can calculate how many hours it would require to pass before the weather changes. I think you would not need to change the code for this method.
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
674
Use it, then. This plugin has been compatible with FL's unreal time system since the start.
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
674
Not sure what you are saying but this plugin works with the unreal time system and real time. You can decide which one to use on configuration if the unreal time system is installed. If it's not, the plugin will use the computer's time to work with.
 

ReshiramZ

Rookie
Member
Joined
Dec 13, 2023
Posts
3
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.7]

Exception: NoMethodError
Message: undefined method `tileset_name' for nil:NilClass

Backtrace:
Game_Map:78:in `updateTileset'
[Lin's Weather System] 01 - Main Code.rb:23:in `updateTileset'
Game_Map:49:in `setup'
Game_MapFactory:24:in `setup'
Scene_Map:79:in `transfer_player'
Scene_Map:173:in `block in update'
Scene_Map:166:in `loop'
Scene_Map:166:in `update'
Unreal_Time:256:in `update'
Scene_Map:238:in `block in main'

I'm sure I did something wrong, but I can't figure it out...I was Configuring the Seasons.
I Need More Details About Setting Up Seasons and Unreal Time (With Images Maybe)
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
674
The error you are showing is because the game is trying to change the tileset to one that doesn't exist.
1707344240626.png

This is not to place the ID number of tilesets to change when it's the apropiate season, but how much the game will add to the tilesets defined in OUTDOR_TILESETS to reach the proper seasonal tilesets. If after the tileset id is calculated, it tries to find it. The error happens when it can not find it. So make sure to set the numbers properly and to have the tilests defined.

An example:
This is the configuration of tileset change in the plugin.
1707344485922.png

And those are the tilesets you should have defined in the program based on the configuration of the plugin. (The important ones are 001: Outside, 002: Outside waterfall, and 024: Outside Summer and all the ones after it).
1707344565028.png

As you can see, there are seasonal tilesets for outside and outside waterfall and they intercalate every season. But the important part is, the ID for the summer ones are 23 numbers higher than the default ones. The autumn ones are 25 numbers higher and the ones for winter are 27 higher. You don't need to have them so far away of each other. You can have the default ones just before the seasonal ones. You don't even have to intercalate them. Just make sure that they always follow the same order.
Example: Outside, Outside waterfall, Outside Summer, Outside waterfall Summer, Outside Autumn, Outside waterfall Autumn, Outside Winter, Outside waterfall Winter
Example 2: Outside, Outside Autumn, Outside Summer, Outside Winter, Outside waterfall, Outside waterfall Autumn, Outside waterfall Summer, Outside waterfall Winter

As for the unreal time thing, there isn't much to configure. You either have this as true (will use the PC time) or false (will use Unreal Time System if it's installed).
1707344728128.png


For the rest, I think the examples that I put on the configuration should be enough to see how it's done but feel free to ask for anything you don't understand.
 

ReshiramZ

Rookie
Member
Joined
Dec 13, 2023
Posts
3
I found my mistake

Replica.png

The Image Above Is The Configuration That Didn't Work (Mistake)

Instead of me simply counting from tileset number 24 and putting spring as 0, summer as 1 and so on, for some reason I was counting from tileset number 1, even though only the number 24 is in the string. In other words, I actually placed a tileset that doesn't exist, it was a very silly mistake. But At Least The Seasons Worked.🤣

Exemple.png

The Image Above Is The Setting That Works

Thank You for Reply,Keep it up!
 

MyGames

Rookie
Member
Joined
Feb 20, 2024
Posts
1
Hey, I have a problem with weather effects showing on my own maps. The plugin works with the maps that came with essentials. Using my own "Tests" map for playing around with some plugins however doesn't seem to work. The map is an outdoor map and I added the data of the map in the config file. On the town map it actually shows the symbol for the current weather but i can't see the weather effects. The weather spesific encounters work too.
I'm using these plugins: Better Summary/ Customizable Level Caps/ Encounter List UI/ Following Pokemon EX/ Generation 8 Pack Scripts/ rainfallUtils/ Voltseon's A-Star Pathfinding/ Voltseon's Overworld Encounters/ Voltseon's Pause Menu

Does anyone now how I can fix this? I really like the Idea of this plugin and I believe it could be just a simple thing I don't seem to find for the effects to show up :/
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
674
When you say the map is an outdoor map, do you mean that it is defined as such on its metadata? Just for reference, this is how it has to be defined:
1708439625570.png

If the town map is properly displaying the weather, it means the plugin is working. And because of how the plugin is written, there are only 3 reasons a map will have no weather:
  1. The weather for the map is "None" (the town map will indicate it as such).
  2. You have set NO_WEATHER as false (can't be if there is weather on other maps).
  3. The map is not marked as an outdoor map on the map_metadata PBS.

If it's none of the cases above, try the plugin without the other plugins. If it works, then it may be because of a conflict with one of your plugins and you'll have to try adding them back one by one.
 

Gobljnslayer

Rookie
Member
Joined
Mar 2, 2024
Posts
3
Can anyone tell me how to fix this? The only weather it will show is sun despite being set otherwise and the pbForceUpdateZoneWeather commands both crash the game. Here is the crash log. Any help is appreciated.

[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.7]

Script error in event 6 (coords 21,7), map 2 (Lappet Town)
Exception: NameError
Message: undefined local variable or method `zone' for #<Interpreter @event_id: 6>

***Full script:
pbForceUpdateZoneWeather(zone)

Backtrace:
(eval):2: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'
Scene_Map:166:in `loop'
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
674
First of all, you are not telling the command what zone you want to update. The "(zone)" part is so you put there a number (the zone index) so the command can update this zone's weather. Just to be clear, it goes like that:
1709363877240.png

Or you could use pbForceUpdateWeather which doesn't need you to add nor change anything but will update the weather for all zones you have defined.

As for the weather only being sun, could you share an image of how you configured the weather probabilities for all the seasons?
 

Gobljnslayer

Rookie
Member
Joined
Mar 2, 2024
Posts
3
#===============================================================================
# * 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 = 1 # Default: 4

# Set to true to if you want to force the weather to change when interacting with certain events.
# Use pbForceUpdateWeather in an event to update all zone weathers.
# Use pbForceUpdateZoneWeather(zone) in an event to update the weather of a zone.
FORCE_UPDATE = false # Default: false

# Set to true to have the outdoor maps change with seasons.
# The map's appearance will update when leaving an indoor map.
SEASON_CHANGE = false # Default: false

# Set to true if your game starts outdoors and want to show the season splash when going somewhere indoors.
# Set to false if your game starts indoors and want to show the season splash when going somewhere outdoors.
OUTDOOR = false # Default: false

# Array with the ID of outside tilesets that will change with seasons.
OUTDOOR_TILESETS = [1, 2]

# The difference between the ID of the tileset defined for an outdoor map and it's season version.
# The difference has to be the same for any tileset defined in OUTDOOR_TILESETS.
# Use the same season tileset as the default outdoor map tileset and define the diference for that season as 0.
SUMMER_TILESET = 0
AUTUMN_TILESET = 0
WINTER_TILESET = 0
SPRING_TILESET = 0

#===============================================================================
# * Weather Substitute
#===============================================================================
# A hash with the ID of the maps that will have or not have certain weathers.
MAPS_SUBSTITUTE = {
:Snow => ["exclude", 1, 4],
:Blizzard => ["exclude", 1, 4],
:Sandstorm => ["include", 5]
}

# The ID of the weathers that will substitute the main when in one of the summer or sandstorm maps.
# There has to be a hash (defined between {}) for each defined zone with weather to substitute.
# Any weather not defined in the hash for a zone will use the main weather instead.
WEATHER_SUBSTITUTE = [
{:None => :None, :Rain => :Rain, :Storm => :Storm, :Snow => :Rain, :Blizzard => :Storm, :Sandstorm => :None, :HeavyRain => :HeavyRain, :Sun => :Sun, :Fog => :Fog},
{:Snow => :Rain, :Blizzard => :Storm, :Sandstorm => :None},
{:Snow => :Rain, :Blizzard => :HeavyRain}
]

#===============================================================================
# * Weather Names
#===============================================================================
# A hash that contains the ID of weather and the name to display for each one.
# Using .downcase will make them lowercase.
WEATHER_NAMES = {
:None => _INTL("None"),
:Rain => _INTL("Rain"),
:Storm => _INTL("Storm"),
:Snow => _INTL("Snow"),
:Blizzard => _INTL("Blizzard"),
:Sandstorm => _INTL("Sandstorm"),
:HeavyRain => _INTL("Heavy rain"),
:Sun => _INTL("Sun"),
:Fog => _INTL("Fog")
}

#===============================================================================
# * Zones Configuration
#===============================================================================
# Arrays of id of the maps of each zone. Each array within the main array is a zone.
# The maps within each zone will have the same weather at the same time.
# Each zone may have a different weather than the others.
ZONE_MAPS = [
[2, 5],
[7],
[21]
]
#===============================================================================
# * Map Display
#===============================================================================
# Array of hashes to get each map's position in the Town Map. Each hash corresponds to a zone in ZONE_MAPS.
# In "Map Name" you have to put the name the Town Map displays for that point.
# In Map ID you have to put the ID of the map the name corresponds to, like in ZONE_MAPS.
MAPS_POSITIONS = [
#{"Map Name" => Map ID},
{"Lappet Town" => 2, "Route 1" => 5},
{"Cedolan City" => 7},
{"Route 2" => 21}
]

# A hash for the plugin to display the proper weather image on the map.
# They have to be on Graphics/Pictures/Weather (in 20+) or Graphics/UI/Weather (in 21+).
WEATHER_IMAGE = {
:Rain => "mapRain",
:Storm => "mapStorm",
:Snow => "mapSnow",
:Blizzard => "mapBlizzard",
:Sandstorm => "mapSand",
:HeavyRain => "mapRain",
:Sun => "mapSun",
:Fog => "mapFog"
}
#===============================================================================
# * Season Probability Configuration
#===============================================================================
# Arrays of probability of weather for each zone in the different seasons.
# Each array within the main array corresponds to a zone in ZONE_MAPS.
# Put 0 to weather you don't want if you define a probability after it.
# If your game doesn't use seasons, edit the probabilities of one season and copy it to the others.

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

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

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

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

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
674
Ok, you have quite a high probability of having sunny weather so it may be simply luck that you have only found that weather. I found myself finding multiple times the same weather when testing the game despite having other weathers with high probability as well so it's not unusual.
You can either try to activate pbForceUpdateZoneWeather(0) or pbForceUpdateWeather multiple times to see if other weathers are selected as well.
You could also make use of pbWeatherForecast(0), which tells you what is the weather stored to activate next.
 

Gobljnslayer

Rookie
Member
Joined
Mar 2, 2024
Posts
3
I'll give it a shot. Thank you for your help!

Edit: After going into the map metadata through notepad and deleting the weather of a map that was included in an earlier test run, it works like a charm.
 
Last edited:

Eyebull21

Novice
Member
Joined
Aug 8, 2019
Posts
10
I'm getting a error when looking at the map.
[2024-03-11 14:52:29 -0400]
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.7]

Exception: NoMethodError
Message: undefined method `setBitmap' for nil:NilClass

Backtrace:
[Lin's Weather System] 02 - Map_Display v21.rb:81:in `block in pbMapScene'
[Lin's Weather System] 02 - Map_Display v21.rb:40:in `loop'
[Lin's Weather System] 02 - Map_Display v21.rb:40:in `pbMapScene'
301:UI_RegionMap:339:in `pbStartScreen'
300:UI_Pokegear:169:in `block (2 levels) in <main>'
079:MessageConfig:575:in `pbFadeOutIn'
300:UI_Pokegear:166:in `block in <main>'
[Lin's Pokegear Themes] Pokegear_Main.rb:192:in `block in pbStartScreen'
[Lin's Pokegear Themes] Pokegear_Main.rb:186:in `loop'
[Lin's Pokegear Themes] Pokegear_Main.rb:186:in `pbStartScreen'

1710183385723.png
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
674
I can't replicate this error. Is this a new game or an already existing save file? Have you tried downloading and installing the plugin again?
 

Capparh

Rookie
Member
Joined
Nov 10, 2020
Posts
4
Hey LinKazamine, great plugin I really love it!

Is there a way to implement so that sunny weather disappears during the "evening" and comes back in the "morning"
Having sunny weather throughout the night seems abit silly. :D
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
674
The plugin should already come with that function included. You can check it at Lin's Weather System/01 - Main Code/03 - Handler. On line 20 there should be the line weather = :None if PBDayNight.isNight? && weather == :Sun.

If it's not working for you, check if :None, :Sun or PbDayNight.isNight? exist on the default code of your pokemon essentials.
 
Back
Top