- Pokémon Essentials Version
- v20.1 ➖
This is a script that allows the player to use Sandstorm, Hail, Rain Dance, and Sunny Day to summon their respective weathers in the overworld.
Please note the instructions below the scripts!
v20/v19
You can download the plugin here (v20), or paste in a script section above Main, or at the bottom of Overworld_FieldMoves.
Ruby:
#===============================================================================
# Rain Dance
#===============================================================================
HiddenMoveHandlers::CanUseMove.add(:RAINDANCE,proc { |move,pkmn,showmsg|
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
if !map_metadata || !map_metadata.outdoor_map
pbMessage(_INTL("Can't use that indoors.")) if showmsg
next false
end
if $game_screen.weather_type==:Rain ||
$game_screen.weather_type==:HeavyRain
pbMessage(_INTL("It's already raining.")) if showmsg
next false
end
for i in 0...pkmn.moves.length
if pkmn.moves[i].id==:RAINDANCE
moveno = i
end
end
if pkmn.moves[moveno].pp==0
pbMessage(_INTL("Not enough PP...")) if showmsg
next false
end
next true
})
HiddenMoveHandlers::UseMove.add(:RAINDANCE,proc { |move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
pbMessage(_INTL("{1} used {2}!",pokemon.name,move.name))
end
$game_screen.weather(:Rain, 9, 20)
for i in 0...pokemon.moves.length
if pokemon.moves[i].id==:RAINDANCE
pokemon.moves[i].pp -= 1
end
end
Graphics.update
Input.update
pbUpdateSceneMap
next true
})
#===============================================================================
# Sandstorm
#===============================================================================
HiddenMoveHandlers::CanUseMove.add(:SANDSTORM,proc { |move,pkmn,showmsg|
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
if !map_metadata || !map_metadata.outdoor_map
pbMessage(_INTL("Can't use that indoors.")) if showmsg
next false
end
if $game_screen.weather_type==:Sandstorm
pbMessage(_INTL("There is already a sandstorm.")) if showmsg
next false
end
for i in 0...pkmn.moves.length
if pkmn.moves[i].id==:SANDSTORM
moveno = i
end
end
if pkmn.moves[moveno].pp==0
pbMessage(_INTL("Not enough PP...")) if showmsg
next false
end
next true
})
HiddenMoveHandlers::UseMove.add(:SANDSTORM,proc { |move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
pbMessage(_INTL("{1} used {2}!",pokemon.name,move.name))
end
$game_screen.weather(:Sandstorm, 9, 20)
for i in 0...pokemon.moves.length
if pokemon.moves[i].id==:SANDSTORM
pokemon.moves[i].pp -= 1
end
end
Graphics.update
Input.update
pbUpdateSceneMap
next true
})
#===============================================================================
# Hail
#===============================================================================
HiddenMoveHandlers::CanUseMove.add(:HAIL,proc { |move,pkmn,showmsg|
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
if !map_metadata || !map_metadata.outdoor_map
pbMessage(_INTL("Can't use that indoors.")) if showmsg
next false
end
if $game_screen.weather_type==:Snow ||
$game_screen.weather_type==:Blizzard
pbMessage(_INTL("It's already snowing.")) if showmsg
next false
end
for i in 0...pkmn.moves.length
if pkmn.moves[i].id==:HAIL
moveno = i
end
end
if pkmn.moves[moveno].pp==0
pbMessage(_INTL("Not enough PP...")) if showmsg
next false
end
next true
})
HiddenMoveHandlers::UseMove.add(:HAIL,proc { |move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
pbMessage(_INTL("{1} used {2}!",pokemon.name,move.name))
end
$game_screen.weather(:Snow, 9, 20)
for i in 0...pokemon.moves.length
if pokemon.moves[i].id==:HAIL
pokemon.moves[i].pp -= 1
end
end
Graphics.update
Input.update
pbUpdateSceneMap
next true
})
#===============================================================================
# Sunny Day
#===============================================================================
HiddenMoveHandlers::CanUseMove.add(:SUNNYDAY,proc { |move,pkmn,showmsg|
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
if !map_metadata || !map_metadata.outdoor_map
pbMessage(_INTL("Can't use that indoors.")) if showmsg
next false
end
if $game_screen.weather_type==:Sun
pbMessage(_INTL("It's already sunny.")) if showmsg
next false
end
if PBDayNight.isNight?
pbMessage(_INTL("Can't use that at night.")) if showmsg
next false
end
for i in 0...pkmn.moves.length
if pkmn.moves[i].id==:SUNNYDAY
moveno = i
end
end
if pkmn.moves[moveno].pp==0
pbMessage(_INTL("Not enough PP...")) if showmsg
next false
end
next true
})
HiddenMoveHandlers::UseMove.add(:SUNNYDAY,proc { |move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
pbMessage(_INTL("{1} used {2}!",pokemon.name,move.name))
end
$game_screen.weather(:Sun, 9, 20)
for i in 0...pokemon.moves.length
if pokemon.moves[i].id==:SUNNYDAY
pokemon.moves[i].pp -= 1
end
end
Graphics.update
Input.update
pbUpdateSceneMap
next true
})
To prevent weather from being transferred over, find this section of code in Overworld.
Ruby:
EventHandlers.add(:on_leave_map, :end_weather,
proc { |new_map_id, new_map|
next if new_map_id == 0
old_map_metadata = $game_map.metadata
next if !old_map_metadata || !old_map_metadata.weather
map_infos = pbLoadMapInfos
if $game_map.name == map_infos[new_map_id].name
new_map_metadata = GameData::MapMetadata.try_get(new_map_id)
next if new_map_metadata&.weather
end
$game_screen.weather(:None, 0, 0)
}
)
Ruby:
Events.onMapChanging += proc { |_sender, e|
new_map_ID = e[0]
next if new_map_ID == 0
old_map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
next if !old_map_metadata || !old_map_metadata.weather
map_infos = pbLoadMapInfos
if $game_map.name == map_infos[new_map_ID].name
new_map_metadata = GameData::MapMetadata.try_get(new_map_ID)
next if new_map_metadata && new_map_metadata.weather
end
$game_screen.weather(:None, 0, 0)
}
next if !old_map_metadata || !old_map_metadata.weather
.(Unfortunately, this has to be done by editing the base scripts - I've tried making it part of the plugin, it just doesn't work.)
v18 and earlier
Just paste this down in a script section above Main, or at the bottom of PField_FieldMoves.
Ruby:
#===============================================================================
# Rain Dance
#===============================================================================
HiddenMoveHandlers::CanUseMove.add(:RAINDANCE,proc { |move,pkmn,showmsg|
if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
pbMessage(_INTL("Can't use that indoors.")) if showmsg
next false
end
if $game_screen.weather_type==1 ||
$game_screen.weather_type==2
pbMessage(_INTL("It's already raining.")) if showmsg
next false
end
for i in 0...pkmn.moves.length
move = pkmn.moves[i]
if isConst?(pkmn.moves[i].id,PBMoves,:RAINDANCE)
if pkmn.moves[i].pp==0
pbMessage(_INTL("Not enough PP...")) if showmsg
end
end
end
next true
})
HiddenMoveHandlers::UseMove.add(:RAINDANCE,proc { |move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
$game_screen.weather(PBFieldWeather::Rain,9.0,20)
for i in 0...pokemon.moves.length
move = pokemon.moves[i]
if isConst?(pokemon.moves[i].id,PBMoves,:RAINDANCE)
pokemon.moves[i].pp -= 1
end
end
Graphics.update
Input.update
pbUpdateSceneMap
next true
})
#===============================================================================
# Sandstorm
#===============================================================================
HiddenMoveHandlers::CanUseMove.add(:SANDSTORM,proc { |move,pkmn,showmsg|
if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
pbMessage(_INTL("Can't use that indoors.")) if showmsg
next false
end
if $game_screen.weather_type==5
pbMessage(_INTL("There is already a sandstorm.")) if showmsg
next false
end
for i in 0...pkmn.moves.length
move = pkmn.moves[i]
if isConst?(pkmn.moves[i].id,PBMoves,:SANDSTORM)
if pkmn.moves[i].pp==0
pbMessage(_INTL("Not enough PP...")) if showmsg
end
end
end
next true
})
HiddenMoveHandlers::UseMove.add(:SANDSTORM,proc { |move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
$game_screen.weather(PBFieldWeather::Sandstorm,9.0,20)
for i in 0...pokemon.moves.length
move = pokemon.moves[i]
if isConst?(pokemon.moves[i].id,PBMoves,:SANDSTORM)
pokemon.moves[i].pp -= 1
end
end
Graphics.update
Input.update
pbUpdateSceneMap
next true
})
#===============================================================================
# Hail
#===============================================================================
HiddenMoveHandlers::CanUseMove.add(:HAIL,proc { |move,pkmn,showmsg|
if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
pbMessage(_INTL("Can't use that indoors.")) if showmsg
next false
end
if $game_screen.weather_type==3 ||
$game_screen.weather_type==4
pbMessage(_INTL("It's already snowing.")) if showmsg
next false
end
for i in 0...pkmn.moves.length
move = pkmn.moves[i]
if isConst?(pkmn.moves[i].id,PBMoves,:HAIL)
if pkmn.moves[i].pp==0
pbMessage(_INTL("Not enough PP...")) if showmsg
end
end
end
next true
})
HiddenMoveHandlers::UseMove.add(:HAIL,proc { |move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
$game_screen.weather(PBFieldWeather::Snow,9.0,20)
for i in 0...pokemon.moves.length
move = pokemon.moves[i]
if isConst?(pokemon.moves[i].id,PBMoves,:HAIL)
pokemon.moves[i].pp -= 1
end
end
Graphics.update
Input.update
pbUpdateSceneMap
next true
})
#===============================================================================
# Sunny Day
#===============================================================================
HiddenMoveHandlers::CanUseMove.add(:SUNNYDAY,proc { |move,pkmn,showmsg|
if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
pbMessage(_INTL("Can't use that indoors.")) if showmsg
next false
end
if $game_screen.weather_type==7
pbMessage(_INTL("It's already sunny.")) if showmsg
next false
end
if PBDayNight.isNight?
pbMessage(_INTL("Can't use that at night.")) if showmsg
next false
end
for i in 0...pkmn.moves.length
move = pkmn.moves[i]
if isConst?(pkmn.moves[i].id,PBMoves,:SUNNYDAY)
if pkmn.moves[i].pp==0
pbMessage(_INTL("Not enough PP...")) if showmsg
end
end
end
next true
})
HiddenMoveHandlers::UseMove.add(:SUNNYDAY,proc { |move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
$game_screen.weather(PBFieldWeather::Sun,9.0,20)
for i in 0...pokemon.moves.length
move = pokemon.moves[i]
if isConst?(pokemon.moves[i].id,PBMoves,:SUNNYDAY)
pokemon.moves[i].pp -= 1
end
end
Graphics.update
Input.update
pbUpdateSceneMap
next true
})
(I actually wrote two versions of code for this- I had originally written it as a command in PScreen_Party. That version doesn't work quite as well, as it doesn't show the Hidden Move animation, and you have to exit the menu before the weather appears, but if you're interested, here it is:
In PScreen_Party, find this:
Change it to this:
Below that, find
Right after that last break, put in:
Ruby:
if !pkmn.egg? && (isConst?(move.id,PBMoves,:MILKDRINK) ||
isConst?(move.id,PBMoves,:SOFTBOILED) ||
HiddenMoveHandlers.hasHandler(move.id))
Change it to this:
Ruby:
if !pkmn.egg? && (isConst?(move.id,PBMoves,:MILKDRINK) ||
isConst?(move.id,PBMoves,:SOFTBOILED) ||
isConst?(move.id,PBMoves,:SUNNYDAY) ||
isConst?(move.id,PBMoves,:RAINDANCE) ||
isConst?(move.id,PBMoves,:HAIL) ||
isConst?(move.id,PBMoves,:SANDSTORM) ||
HiddenMoveHandlers.hasHandler(move.id))
Below that, find
Code:
break if pkmn.hp<=amt
end
@scene.pbSelect(oldpkmnid)
pbRefresh
break
Ruby:
elsif isConst?(pkmn.moves[i].id,PBMoves,:SANDSTORM)
if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
pbDisplay(_INTL("Can't use that indoors."))
@scene.pbSelect(pkmnid)
break
end
if $game_screen.weather_type==5
movename = PBMoves.getName(pkmn.moves[i].id)
pbDisplay(_INTL("There is already a sandstorm."))
@scene.pbSelect(pkmnid)
break
end
if pkmn.moves[i].pp<=1
pbDisplay(_INTL("Not enough PP..."))
break
end
$game_screen.weather(PBFieldWeather::Sandstorm,9.0,20)
@scene.pbDisplay(_INTL("{1} caused a sandstorm!",pkmn.name))
pkmn.moves[i].pp -= 1
pbRefresh
@scene.pbSelect(pkmnid)
pbRefresh
break
elsif isConst?(pkmn.moves[i].id,PBMoves,:RAINDANCE)
if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
pbDisplay(_INTL("Can't use that indoors."))
@scene.pbSelect(pkmnid)
break
end
if $game_screen.weather_type==1 ||
$game_screen.weather_type==2
movename = PBMoves.getName(pkmn.moves[i].id)
pbDisplay(_INTL("It's already raining."))
@scene.pbSelect(pkmnid)
break
end
if pkmn.moves[i].pp<=1
pbDisplay(_INTL("Not enough PP..."))
break
end
$game_screen.weather(PBFieldWeather::Rain,9.0,20)
@scene.pbDisplay(_INTL("{1} made it rain!",pkmn.name))
pkmn.moves[i].pp -= 1
pbRefresh
@scene.pbSelect(pkmnid)
pbRefresh
break
elsif isConst?(pkmn.moves[i].id,PBMoves,:HAIL)
if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
pbDisplay(_INTL("Can't use that indoors."))
@scene.pbSelect(pkmnid)
break
end
if $game_screen.weather_type==3 ||
$game_screen.weather_type==4
movename = PBMoves.getName(pkmn.moves[i].id)
pbDisplay(_INTL("It's already snowing."))
@scene.pbSelect(pkmnid)
break
end
if pkmn.moves[i].pp<=1
pbDisplay(_INTL("Not enough PP..."))
break
end
$game_screen.weather(PBFieldWeather::Snow,9.0,20)
@scene.pbDisplay(_INTL("{1} made it snow!",pkmn.name))
pkmn.moves[i].pp -= 1
pbRefresh
@scene.pbSelect(pkmnid)
pbRefresh
break
elsif isConst?(pkmn.moves[i].id,PBMoves,:SUNNYDAY)
if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
pbDisplay(_INTL("Can't use that indoors."))
@scene.pbSelect(pkmnid)
break
end
if PBDayNight.isNight?
pbDisplay(_INTL("Can't use that at night."))
@scene.pbSelect(pkmnid)
break
end
if $game_screen.weather_type==7
movename = PBMoves.getName(pkmn.moves[i].id)
pbDisplay(_INTL("It's already sunny."))
@scene.pbSelect(pkmnid)
break
end
if pkmn.moves[i].pp<=1
pbDisplay(_INTL("Not enough PP..."))
break
end
$game_screen.weather(PBFieldWeather::Sun,9.0,20)
@scene.pbDisplay(_INTL("{1} made it sunny!",pkmn.name))
pkmn.moves[i].pp -= 1
pbRefresh
@scene.pbSelect(pkmnid)
pbRefresh
break
Mechanics
- Using these moves depletes 1 PP from the move. If the move has 0 PP left, it can't be used. (I might need to make sure this works on earlier versions)
- None of these moves can be used indoors.
- Sunny Day can't be used at night.
GameData::Weather.get($game_screen.weather_type).category
, and you can check it against the categories defined in Weather. (:None, :Rain, :Hail, :Sandstorm, :Sun, :Fog)(In v18 and earlier, you could just check $game_screen.weather_type==#, with # being the number of your weather type)
Why bother with this?
Well, it's fun! But if you're looking for some ideas...
- Weather-based evolutions... but the player has to set the weather to be able to evolve them!
- Sidequests! Maybe you need to bring rain to someone's berry farm, or sunlight to power a solar panel!
- Remember BW's season system? Let the player form those seasonal paths on their own! Hail could bring snowdrifts, rain could expand rivers, etc!
- Special encounters! Maybe you can only find some Pokemon when they come out to sunbathe, or when the weather's cooler!
- Bizarre regi-style puzzles! Maybe you even need to get the sun to hit the strange rock to read something!
- this tutorial can help you make a global variable for weather, which can help make eventing a little easier!
- eattwo's Weather Encounters Plugin lets you set different encounter tables depending on the weather!( Note that it's currently for v19)
Looking for more overworld moves?
You may also be interested in Lucidious89's Improved Field Skills.
- Credits
- Credit to TechSkylander1518, please!