- Joined
- Sep 29, 2020
- Posts
- 182
I'll try that when I'm home.
Okay...I assume that you added arrays to SUMMER_TILESET, AUTUMN_TILESET, WINTER_TILESET, and SPRING_TILESET, which caused the error. The plugin comes with an example, but I'll explain each part here.
There are two parts for that to work, one in OUTDOOR_TILESETS and another in the season tilesets.
In the OUTDOOR_TILESETS you have to put the ID of all tilesets you use when creating a map that you want to change depending on the season. And it has to look something like this: OUTDOOR_TILESETS = [1, 2, 3, 4]. The numbers don't have to be these, but they have to follow this structure.
Then, on the part of the season tilesets, you have to put a single number. That number will be added to the ID in the OUTDOOR_TILESETS to get the ID of the corresponding seasonal tileset. Following the example I put above, it could be something like this:
OUTDOOR_TILESETS = [1, 2, 3, 4]
SUMMER_TILESET = 4
AUTUMN_TILESET = 8
WINTER_TILESET = 12
SPRING_TILESET = 0
With that configuration, the plugin will do this with a map that uses the tileset with ID 1:
Spring: 1 + 0 = 1 so tileset ID 1 will be used as the spring tileset for the map.
Summer: 1 + 4 = 5 so tileset ID 5 will be used as the summer tileset for the map.
Autumn: 1 + 8 = 9 so tileset ID 9 will be used as the autumn tileset for the map.
Winter: 1 + 12 = 13 so tileset ID 13 will be used as the winter tileset for the map.
This configuration puts together the tilesets of the same season together. If you want to put together the tilesets that will transition from one to the other (so you have the spring, summer, autumn and winter tilesets for the same maps one after the other), you have to put a configuration like this one:
OUTDOOR_TILESETS = [1, 6, 11, 16]
SUMMER_TILESET = 1
AUTUMN_TILESET = 2
WINTER_TILESET = 3
SPRING_TILESET = 4
With that configuration, the plugin will do this with a map that uses tileset with ID 1:
Summer: 1 + 1 = 2 so tileset ID 2 will be used as the summer tileset for the map.
Autumn: 1 + 2 = 3 so tileset ID 3 will be used as the autumn tileset for the map.
Winter: 1 + 3 = 4 so tileset ID 4 will be used as the winter tileset for the map.
Spring: 1 + 4 = 5 so tileset ID 5 will be used as the spring tileset for the map.
You have to make sure to put all the tilesets for the same season at the same distance from the tilesets used to create maps (which should be all of the same season unless you use 4 different tilesets for the seasons) so the plugin can change them correctly.
Hope this helps understand how that part of the plugin works.
Fixed an error caused by the version's number if another plugin has this one as required or optional.
[imath]game_variables[38] =[/imath]WeatherSystem.actualWeather[zone]
in a script call and changing "zone" by the zone index number.#===============================================================================
# * Weather System Configuration
#===============================================================================
module WeatherConfig
# Set to false to use the Weather System.
NO_WEATHER = false # Default: false
# Set to true to show the weather on the Town Map.
SHOW_WEATHER_ON_MAP = false # Default: true
# Set to true to use the computer's time. Will not work without Unreal Time System.
USE_REAL_TIME = false # Default: true
# Set to true to have the weather change at midnight.
CHANGE_MIDNIGHT = true # Default: true
# Define the min and max amount of time (in hours) before the weather changes.
# Set the same number to not randomize the amount of time before the weather changes.
CHANGE_TIME_MIN = 1 # Default: 1
CHANGE_TIME_MAX = 4 # Default: 4
# Set to true to if you want to force the weather to change when interacting with certain events.
# Use pbForceUpdateWeather in an event to update all zone weathers.
# Use pbForceUpdateZoneWeather(zone) in an event to update the weather of a zone.
FORCE_UPDATE = true # Default: false
# Set to true to have the outdoor maps change with seasons.
# The map's appearance will update when leaving an indoor map.
SEASON_CHANGE = false # Default: false
# Set to true if your game starts outdoors and want to show the season splash when going somewhere indoors.
# Set to false if your game starts indoors and want to show the season splash when going somewhere outdoors.
OUTDOOR = false # Default: false
# Array with the ID of outside tilesets that will change with seasons.
OUTDOOR_TILESETS = [1, 2]
# The difference between the ID of the tileset defined for an outdoor map and it's season version.
# The difference has to be the same for any tileset defined in OUTDOOR_TILESETS.
# Use the same season tileset as the default outdoor map tileset and define the diference for that season as 0.
SUMMER_TILESET = 22
AUTUMN_TILESET = 24
WINTER_TILESET = 26
SPRING_TILESET = 0
#===============================================================================
# * Weather Substitute
#===============================================================================
# A hash with the ID of the maps that will have or not have certain weathers.
# The ID of the weather has to be of the main one you want to change with WEATHER_SUBSTITUTE.
# Use "exclude" to define a list of maps that will not use that weather when it's the main one.
# Any maps of a zone not added on the "exclude" list will use the main weather.
# Use "include" to define a list of maps that will use that weather when it's the main one.
# Any maps of a zone not added on the "include" list will use the secondary weather.
MAPS_SUBSTITUTE = {
:Snow => ["exclude", 1, 4],
:Blizzard => ["exclude", 1, 4],
:Sandstorm => ["include", 5]
}
# The ID of the weathers that will substitute the main when appropiate (conditions defined in MAPS_SUBSTITUTE).
# There has to be a hash (defined between {}) for each defined zone with weather to substitute.
# Any weather not defined in the hash for a zone will use the main weather instead.
WEATHER_SUBSTITUTE = [
{:None => :None, :Rain => :Rain, :Storm => :Storm, :Snow => :Rain, :Blizzard => :Storm, :Sandstorm => :None, :HeavyRain => :HeavyRain, :Sun => :Sun, :Fog => :Fog},
{:Snow => :Rain, :Blizzard => :Storm, :Sandstorm => :None},
{:Snow => :Rain, :Blizzard => :HeavyRain}
]
#===============================================================================
# * Weather Names
#===============================================================================
# A hash that contains the ID of weather and the name to display for each one.
# Using .downcase will make them lowercase.
def self.weather_names
return {
:None => _INTL("None"),
:Rain => _INTL("Rain"),
:Storm => _INTL("Storm"),
:Snow => _INTL("Snow"),
:Blizzard => _INTL("Blizzard"),
:Sandstorm => _INTL("Sandstorm"),
:HeavyRain => _INTL("Heavy rain"),
:Sun => _INTL("Sun"),
:Fog => _INTL("Fog")
}
end
#===============================================================================
# * Zones Configuration
#===============================================================================
# Arrays of id of the maps of each zone. Each array within the main array is a zone.
# The maps within each zone will have the same weather at the same time.
# Each zone may have a different weather than the others.
ZONE_MAPS = [
[2, 5],
[7],
[21],
[32, 42, 43, 97, 78, 98, 122],
[77, 114, 115],
[99, 101, 105],
[94, 100, 102, 104, 106],
[83, 85, 116],
[79, 82, 121],
[84, 89, 93, 111, 117],
[90, 107, 109, 110],
[112, 113, 120, 123, 124, 125]
]
#===============================================================================
# * Map Display
#===============================================================================
# Array of hashes to get each map's position in the Town Map. Each hash corresponds to a zone in ZONE_MAPS.
# In "Map Name" you have to put the name the Town Map displays for that point.
# In Map ID you have to put the ID of the map the name corresponds to, like in ZONE_MAPS.
MAPS_POSITIONS = [
#{"Map Name" => Map ID},
{"Lappet Town" => 2, "Route 1" => 5},
{"Cedolan City" => 7},
{"Route 2" => 21}
]
# A hash for the plugin to display the proper weather image on the map.
# They have to be on Graphics/Pictures/Weather (in 20+) or Graphics/UI/Weather (in 21+).
WEATHER_IMAGE = {
:Rain => "mapRain",
:Storm => "mapStorm",
:Snow => "mapSnow",
:Blizzard => "mapBlizzard",
:Sandstorm => "mapSand",
:HeavyRain => "mapRain",
:Sun => "mapSun",
:Fog => "mapFog"
}
#===============================================================================
# * Season Probability Configuration
#===============================================================================
# Arrays of probability of weather for each zone in the different seasons.
# Each array within the main array corresponds to a zone in ZONE_MAPS.
# Put 0 to weather you don't want if you define a probability after it.
# If your game doesn't use seasons, edit the probabilities of one season and copy it to the others.
# Probability of weather in summer.
# Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
ZONE_WEATHER_SUMMER = [
[50, 20, 3, 0, 0, 0, 5, 30],
[40, 50],
[60],
[0, 100, 0, 0, 0, 0, 0, 0],
[0, 30, 10, 0, 0, 0, 10, 30, 60],
[30, 50, 40, 0, 0, 0, 50],
[50, 20, 10, 40],
[50, 30, 20, 0, 0, 0, 30, 40],
[50, 30, 20, 0, 0, 10, 10],
[40, 20, 0, 30],
[20, 0, 0, 50, 40],
[50, 40, 40, 0, 0, 0, 30, 50]
]
# Probability of weather in autumn.
# Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
ZONE_WEATHER_AUTUMN = [
[50, 20, 3, 0, 0, 0, 5, 30],
[40, 50],
[60],
[0, 100, 0, 0, 0, 0, 0, 0],
[0, 30, 10, 0, 0, 0, 10, 30, 60],
[30, 50, 40, 0, 0, 0, 50],
[50, 20, 10, 40],
[50, 30, 20, 0, 0, 0, 30, 40],
[50, 30, 20, 0, 0, 10, 10],
[40, 20, 0, 30],
[20, 0, 0, 50, 40],
[50, 40, 40, 0, 0, 0, 30, 50]
]
# Probability of weather in winter.
# Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
ZONE_WEATHER_WINTER = [
[50, 20, 3, 0, 0, 0, 5, 30],
[40, 50],
[60],
[0, 100, 0, 0, 0, 0, 0, 0],
[0, 30, 10, 0, 0, 0, 10, 30, 60],
[30, 50, 40, 0, 0, 0, 50],
[50, 20, 10, 40],
[50, 30, 20, 0, 0, 0, 30, 40],
[50, 30, 20, 0, 0, 10, 10],
[40, 20, 0, 30],
[20, 0, 0, 50, 40],
[50, 40, 40, 0, 0, 0, 30, 50]
]
# Probability of weather in spring.
# Order: None, Rain, Storm, Snow, Blizzard, Sandstorm, HeavyRain, Sun/Sunny, Fog
ZONE_WEATHER_SPRING = [
[50, 20, 3, 0, 0, 0, 5, 30],
[40, 50],
[60],
[0, 100, 0, 0, 0, 0, 0, 0],
[0, 30, 10, 0, 0, 0, 10, 30, 60],
[30, 50, 40, 0, 0, 0, 50],
[50, 20, 10, 40],
[50, 30, 20, 0, 0, 0, 30, 40],
[50, 30, 20, 0, 0, 10, 10],
[40, 20, 0, 30],
[20, 0, 0, 50, 40],
[50, 40, 40, 0, 0, 0, 30, 50]
]
end
pbForceUpdateWeather
and change maps to refresh the displayed weather, it doesn't change at all? I suggest using the code above multiple times and changing maps every time because the code updates the weather only when loading a map.pbWeatherForecast
to see if the active weather has changed and then refresh the map to see if it updates accordingly.[2025-01-11 02:08:08 -0600]
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]
Script error in event 3 (coords 14,12), map 32 (Hillside)
Exception: NoMethodError
Message: undefined method `mainWeather' for nil:NilClass
***Full script:
pbWeatherForecast(3)
Backtrace:
[Lin's Weather System] 02 - Forecast.rb:6:in `pbWeatherForecast'
(eval):1:in `execute_script'
Interpreter:138:in `eval'
Interpreter:138:in `execute_script'
Interpreter_Commands:1177:in `command_355'
Interpreter_Commands:116:in `execute_command'
Interpreter:130:in `block in update'
Interpreter:86:in `loop'
Interpreter:86:in `update'
[Following Pokemon EX] Refresh.rb:268:in `update'
Tried disabling the following pokemon plugin, still did not work, same error just minus the part about the following pokemon at the bottom.pbForceUpdateWeather didn't do anything when i tried and the other one is giving me this error which makes me think it might be incompatible with the following pokemon plugin
Ruby:[2025-01-11 02:08:08 -0600] [Pokémon Essentials version 21.1] [v21.1 Hotfixes 1.0.9] Script error in event 3 (coords 14,12), map 32 (Hillside) Exception: NoMethodError Message: undefined method `mainWeather' for nil:NilClass ***Full script: pbWeatherForecast(3) Backtrace: [Lin's Weather System] 02 - Forecast.rb:6:in `pbWeatherForecast' (eval):1:in `execute_script' Interpreter:138:in `eval' Interpreter:138:in `execute_script' Interpreter_Commands:1177:in `command_355' Interpreter_Commands:116:in `execute_command' Interpreter:130:in `block in update' Interpreter:86:in `loop' Interpreter:86:in `update' [Following Pokemon EX] Refresh.rb:268:in `update'
pbInitializeWeather
after installing the plugin?[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]
Script error in event 3 (coords 14,12), map 32 (Hillside)
Exception: NoMethodError
Message: undefined method `[]' for nil:NilClass
***Full script:
pbInitializeWeather
Backtrace:
[Lin's Weather System] 01 - Main.rb:70:in `pbValidSecondWeather'
[Lin's Weather System] 01 - Main.rb:147:in `block in pbInitializeWeather'
[Lin's Weather System] 01 - Main.rb:127:in `each'
[Lin's Weather System] 01 - Main.rb:127:in `pbInitializeWeather'
(eval):1:in `execute_script'
Interpreter:138:in `eval'
Interpreter:138:in `execute_script'
Interpreter_Commands:1177:in `command_355'
Interpreter_Commands:116:in `execute_command'
Interpreter:130:in `block in update'