Not compatible with Arcky's Region Map
Added the possibility to define more than 1 point for a map for the Town Map.
- Fixed error that would make the weather icon disappear from the Town Map.
- Changed (again and hopefully for the last time) how to get the position of the maps for the Town Map. It should be simpler this time. Check the overview for more explanation.
[2023-10-25 19:34:08 +0200]
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]
Exception: ArgumentError
Message: argument out of range
Backtrace:
<internal:timev>:310:in `initialize'
[Lin's Weather System] 01 - Main.rb:105:in `new'
[Lin's Weather System] 01 - Main.rb:105:in `pbGetEndTime'
[Lin's Weather System] 01 - Main.rb:173:in `pbUpdateWeather'
[Lin's Weather System] 03 - Handler.rb:17: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'
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
Fixed (hopefully) the error that happened at the end of each month when changing maps outdoors.
def pbGetEndTime(startTime)
# Midnight of the next day
longMonth = [1,3,5,7,8,10,12]
shortMonth = [4,6,9,11]
leapYear = (startTime.year % 4 == 0) ? true : false
if startTime.year % 100 == 0
leapYear = (startTime.year % 400 == 0 && leapYear) ? true : false
end
if longMont.include?(startTime.month) && startTime.day == 31
midnight = Time.new(startTime.year, startTime.month + 1, 1, 0, 0, 0)
elsif shortMont.include?(startTime.month) && startTime.day == 30
midnight = Time.new(startTime.year, startTime.month + 1, 1, 0, 0, 0)
elsif startTime.month == 2 && leapYear && startTime.day == 29
midnight = Time.new(startTime.year, startTime.month + 1, 1, 0, 0, 0)
elsif startTime.month == 2 && !leapYear && startTime.day == 28
midnight = Time.new(startTime.year, startTime.month + 1, 1, 0, 0, 0)
else
midnight = Time.new(startTime.year, startTime.month, startTime.day + 1, 0, 0, 0)
end
hours = rand(WeatherConfig::CHANGE_TIME_MIN...WeatherConfig::CHANGE_TIME_MAX)
elapse = hours * 60 * 60
endTime = startTime + elapse
# Sets the end of the weather at the next midnight or a determined amount of hours in the future
endTime = (WeatherConfig::CHANGE_MIDNIGHT) ? midnight : endTime
return endTime
end
Fixed spelling error on the code.
- Added new year to the end-of-the-month fix when changing maps outdoors.
- Added the possibility to deactivate the automatic weather update when changing maps. Instructions (hopefully clear enough) on how to manually update the weather on events are on the configuration for that feature.
- Added tileset change for maps based on the season.
- Added battle image change for battle based on the season.
- Added season splash images. Comes with a .txt file with details of the font used for the text.
- Changed the path for the weather icons from
Graphics/Pictures/Weather
toGraphics/Pictures/WeatherSystem/Weather
.
$game_screen.weather_type
or some similar code for the checks. Those codes check the weather for the map you are in and my plugin is configured to only change weather on outdoor maps, so obviously it always returns as none on indoor maps. You have to go directly to where the weather for the moment is stored to see what weather is active outside.01 - Main Code/02 - Forecast
. But $WeatherSystem.actualWeather[zone].mainWeather
and $WeatherSystem.actualWeather[zone].secondWeather
are the codes you need. You have to change "zone" with the number of the zone the outdoor map belongs to.MAPS_SUBSTITUTE
with "exclude"?MAPS_SUBSTITUTE
with "include"?$WeatherSystem.actualWeather[zone].secondWeather
. You have to use the other one if it's not the case.Thank you so much for all the explanation :)I guess you are using$game_screen.weather_type
or some similar code for the checks. Those codes check the weather for the map you are in and my plugin is configured to only change weather on outdoor maps, so obviously it always returns as none on indoor maps. You have to go directly to where the weather for the moment is stored to see what weather is active outside.
You have an example of it on01 - Main Code/02 - Forecast
. But$WeatherSystem.actualWeather[zone].mainWeather
and$WeatherSystem.actualWeather[zone].secondWeather
are the codes you need. You have to change "zone" with the number of the zone the outdoor map belongs to.
Also, you have to be aware of two things:
If the answer for the first is yes or the answer for the second is no, you have to use
- The outdoor map that the indoor map connects to can have any of the weathers you defined in
MAPS_SUBSTITUTE
with "exclude"?- The outdoor map that the indoor map connects to can have any of the weathers you defined in
MAPS_SUBSTITUTE
with "include"?$WeatherSystem.actualWeather[zone].secondWeather
. You have to use the other one if it's not the case.