- Joined
- Sep 8, 2024
- Posts
- 2
Hello! This is my first time posting here and it's for guidance on a scripting problem I'm having in Pokemon Essentials v21.1.
My goal is for there to be maps with higher difficulty encounters, trainers, and puzzles - maps which I'm tentatively calling "Wilds" in my game. I want the difficulty to be something players opt into, so getting out shouldn't be easy. I'd like to disable moves like Fly, Dig, and Teleport within these maps. With my beginner understanding of Essentials, I figure the most straightforward way for me to do this is make a switch (which I've called "InWilds" and set as switch 0060), have that switch automatically turn on when a player enters the map in question, and turn it off when the player leaves. The scripts in the section Overworld_FieldMoves could then check if that switch is on, and if it is, disallow use of those field moves.
For ease of testing, I've been working with Surf.
This sounds to me like adding
to the handler that checks whether the player can use Surf, like so:
...would do the trick, but it doesn't.
I've searched high and low for how to do this properly. I found several resources:
Essentials wiki: https://essentialsengine.miraheze.org/wiki/Using_moves_outside_battle
Temporarily disable HM use?: https://www.pokecommunity.com/threads/temporarily-disable-hm-use.402228/
Disable Moves Outside Battle: https://www.pokecommunity.com/threads/disable-moves-outside-battle.400538/
Notably, that third link is exactly what I want to do, but I don't want to necro that thread.
I've tried the following script edits, but none have worked.
Any guidance would be appreciated. Thanks!
My goal is for there to be maps with higher difficulty encounters, trainers, and puzzles - maps which I'm tentatively calling "Wilds" in my game. I want the difficulty to be something players opt into, so getting out shouldn't be easy. I'd like to disable moves like Fly, Dig, and Teleport within these maps. With my beginner understanding of Essentials, I figure the most straightforward way for me to do this is make a switch (which I've called "InWilds" and set as switch 0060), have that switch automatically turn on when a player enters the map in question, and turn it off when the player leaves. The scripts in the section Overworld_FieldMoves could then check if that switch is on, and if it is, disallow use of those field moves.
For ease of testing, I've been working with Surf.
This sounds to me like adding
Ruby:
return false if $game_switches[60]
Ruby:
HiddenMoveHandlers::CanUseMove.add(:SURF, proc { |move, pkmn, showmsg|
return false if $game_switches[60]
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_SURF, showmsg)
# and so on with the normal script
I've searched high and low for how to do this properly. I found several resources:
Essentials wiki: https://essentialsengine.miraheze.org/wiki/Using_moves_outside_battle
Temporarily disable HM use?: https://www.pokecommunity.com/threads/temporarily-disable-hm-use.402228/
Disable Moves Outside Battle: https://www.pokecommunity.com/threads/disable-moves-outside-battle.400538/
Notably, that third link is exactly what I want to do, but I don't want to necro that thread.
I've tried the following script edits, but none have worked.
Ruby:
HiddenMoveHandlers::CanUseMove.add(:SURF, proc { |move, pkmn, showmsg|
return false if $game_switches[60]
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_SURF, showmsg)
Ruby:
HiddenMoveHandlers::CanUseMove.add(:SURF, proc { |move, pkmn, showmsg|
if $game_switches[60] then return false
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_SURF, showmsg)
Ruby:
HiddenMoveHandlers::CanUseMove.add(:SURF, proc { |move, pkmn, showmsg|
if $game_switches[60]
return false
end
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_SURF, showmsg)
Last edited: