Advertiser Content

Ego13

hollow_ego

Male
Larua Region
Seen 10 Hours Ago
Posted 6 Days Ago
296 posts
2.1 Years
Hey there,

for my game I want the player to be able to use multiple moves to cut trees, smash rocks and move boulders. I managed to make the game recognize the added moves as legit moves for the given obstacle.
However, I also want the player to be able to use these moves from the party screen. Now here's the problem: All additional moves for Strength are shown in the party screen, but all moves for Cut and Rock Smash aren't shown. For all three I used the same method, adding these lines.
HiddenMoveHandlers::CanUseMove.copy(:X)
HiddenMoveHandlers::UseMove.copy(:X)
I know there's no typo.
Here's what my Cut Script and my Strength script look like

Cut
Spoiler:
def Kernel.pbCut
  possiblemoves=[:FIRESPIN,:THUNDER,:TOXIC,:SMOG,:SLUDGE,:FIREBLAST,:POISONGAS,:BLASTBURN,:FLAREBLITZ,:EMBER,:FLAMETHROWER,:ICEBEAM,:GUILLOTINE,:RAZORWIND,:AERIALACE,:BITE,:PECK,:RAZORLEAF,:WILLOWISP,:FURYSWIPES,:SUPERFANG,:SLASH,:FLAMEWHEEL,:SLUDGEBOMB,:FURYCUTTER,:DRAGONBREATH,:HEATWAVE,:POISONFANG,:AIRCUTTER,:ICICLESPEAR,:DRAGONCLAW,:SHADOWCLAW,:PSYCHOCUT,:CUT]
  for i in possiblemoves
  move = getID(PBMoves,i)
  movefinder = Kernel.pbCheckMove(move)
  if !pbCheckHiddenMoveBadge(BADGEFORCUT,false) || (!$DEBUG && !movefinder)
    Kernel.pbMessage(_INTL("This tree looks like it can be cut down.")) 
    return false
  end
 if movefinder
  Kernel.pbMessage(_INTL("This tree looks like it can be cut down!\1"))
  if Kernel.pbConfirmMessage(_INTL("Would you like to cut it?"))
    speciesname = (movefinder) ? movefinder.name : $Trainer.name
    Kernel.pbMessage(_INTL("{1} used {2}!",speciesname,PBMoves.getName(move)))
    pbHiddenMoveAnimation(movefinder)
     $cutmove=PBMoves.getName(move)
    return true
  end
  return false
  end
end
end

HiddenMoveHandlers::CanUseMove.add(:CUT,proc{|move,pkmn,showmsg|
   return false if !pbCheckHiddenMoveBadge(BADGEFORCUT,showmsg)
   facingEvent = $game_player.pbFacingEvent
   if !facingEvent || facingEvent.name!="Tree"
     Kernel.pbMessage(_INTL("Can't use that here.")) if showmsg
     return false
   end
   return true
})


HiddenMoveHandlers::UseMove.add(:CUT,proc{|move,pokemon|
   if !pbHiddenMoveAnimation(pokemon)
     Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
      $cutmove=PBMoves.getName(move)
   end
   facingEvent = $game_player.pbFacingEvent
   if facingEvent
     pbSmashEvent(facingEvent)
   end
   return true

   })

HiddenMoveHandlers::CanUseMove.copy(:FIRESPIN,:THUNDER,:TOXIC,:SMOG,:SLUDGE,:FIREBLAST,:POISONGAS,:BLASTBURN,:FLAREBLITZ,:EMBER,:FLAMETHROWER,:ICEBEAM,:GUILLOTINE,:RAZORWIND,:AERIALACE,:BITE,:PECK,:RAZORLEAF,:WILLOWISP,:FURYSWIPES,:SUPERFANG,:SLASH,:FLAMEWHEEL,:SLUDGEBOMB,:FURYCUTTER,:DRAGONBREATH,:HEATWAVE,:POISONFANG,:AIRCUTTER,:ICICLESPEAR,:DRAGONCLAW,:SHADOWCLAW,:PSYCHOCUT,:CUT)
HiddenMoveHandlers::UseMove.copy(:FIRESPIN,:THUNDER,:TOXIC,:SMOG,:SLUDGE,:FIREBLAST,:POISONGAS,:BLASTBURN,:FLAREBLITZ,:EMBER,:FLAMETHROWER,:ICEBEAM,:GUILLOTINE,:RAZORWIND,:AERIALACE,:BITE,:PECK,:RAZORLEAF,:WILLOWISP,:FURYSWIPES,:SUPERFANG,:SLASH,:FLAMEWHEEL,:SLUDGEBOMB,:FURYCUTTER,:DRAGONBREATH,:HEATWAVE,:POISONFANG,:AIRCUTTER,:ICICLESPEAR,:DRAGONCLAW,:SHADOWCLAW,:PSYCHOCUT,:CUT)


Strength
Spoiler:
def Kernel.pbStrength
possiblemoves=[:STRENGTH,:WHIRLWIND,:TACKLE,:BODYSLAM,:HYDROPUMP,:PSYBEAM,:ROCKTHROW,:PSYWAVE,:ROCKSLIDE,:HIDDENPOWER,:ANCIENTPOWER,:NATUREPOWER,:KNOCKOFF,:ARMTHRUST,:HYDROCANON,:WATERPULSE,:TAILWIND,:VACUUMWAVE]																																																				  
  if $PokemonMap.strengthUsed
    Kernel.pbMessage(_INTL("Your Pokemon made it possible to move boulders around."))
    return false
  end
for i in possiblemoves					  
  move = getID(PBMoves,i)
  movefinder = Kernel.pbCheckMove(move)
  if !pbCheckHiddenMoveBadge(BADGEFORSTRENGTH,false) || (!$DEBUG && !movefinder)
    Kernel.pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside."))
    return false
  end
  Kernel.pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside.\1"))
  if Kernel.pbConfirmMessage(_INTL("Would you like to use Strength?"))
    speciesname = (movefinder) ? movefinder.name : $Trainer.name
    Kernel.pbMessage(_INTL("{1} used {2}!",speciesname,PBMoves.getName(move)))
    pbHiddenMoveAnimation(movefinder)
    Kernel.pbMessage(_INTL("{1}'s Strength made it possible to move boulders around!",speciesname))
    $PokemonMap.strengthUsed = true
    return true
  end
  return false
end
end
Events.onAction+=proc{|sender,e|
   facingEvent = $game_player.pbFacingEvent
   if facingEvent && facingEvent.name=="Boulder"
     Kernel.pbStrength
   end
}

HiddenMoveHandlers::CanUseMove.add(:STRENGTH,proc{|move,pkmn,showmsg|
   return false if !pbCheckHiddenMoveBadge(BADGEFORSTRENGTH,showmsg)
   if $PokemonMap.strengthUsed
     Kernel.pbMessage(_INTL("Strength is already being used.")) if showmsg
     return false
   end
   return true
})

HiddenMoveHandlers::UseMove.add(:STRENGTH,proc{|move,pokemon|
   if !pbHiddenMoveAnimation(pokemon)
     Kernel.pbMessage(_INTL("{1} used {2}!\1",pokemon.name,PBMoves.getName(move)))
   end
   Kernel.pbMessage(_INTL("{1}'s Strength made it possible to move boulders around!",pokemon.name))
   $PokemonMap.strengthUsed = true
   return true
})

HiddenMoveHandlers::CanUseMove.copy(:STRENGTH,:WHIRLWIND,:TACKLE,:BODYSLAM,:HYDROPUMP,:PSYBEAM,:ROCKTHROW,:PSYWAVE,:ROCKSLIDE,:HIDDENPOWER,:ANCIENTPOWER,:NATUREPOWER,:KNOCKOFF,:ARMTHRUST,:HYDROCANON,:WATERPULSE,:TAILWIND,:VACUUMWAVE)
HiddenMoveHandlers::UseMove.copy(:STRENGTH,:WHIRLWIND,:TACKLE,:BODYSLAM,:HYDROPUMP,:PSYBEAM,:ROCKTHROW,:PSYWAVE,:ROCKSLIDE,:HIDDENPOWER,:ANCIENTPOWER,:NATUREPOWER,:KNOCKOFF,:ARMTHRUST,:HYDROCANON,:WATERPULSE,:TAILWIND,:VACUUMWAVE)


I really have no clue, why some handlers are recognized and some aren't. If add handlers for the other moves by using
HiddenMoveHandlers::UseMove.add
and everything below it it wors just fine, but given the amount of possible moves I don't really want to do this for every move.
Also the same problem occurs in Essentials v16.2
Looking for spriters to help with

Pokemon Hollow on pokecommunity.com

Vendily

Female
Seen 1 Hour Ago
Posted 2 Days Ago
916 posts
4 Years
HiddenMoveHandlers::CanUseMove.copy(:X,:Y,:Z) would copy the proc from :X to :Y and :Z.
:FIRESPIN does not have a defined proc, so it can't copy it to the rest.
:CUT must be the the first argument, not the last.
HiddenMoveHandlers::CanUseMove.copy(:CUT,:FIRESPIN,:THUNDER,:TOXIC,:SMOG,:SLUDGE,:FIREBLAST,:POISONGAS,:BLASTBURN,:FLAREBLITZ,:EMBER,:FLAMETHROWER,:ICEBEAM,:GUILLOTINE,:RAZORWIND,:AERIALACE,:BITE,:PECK,:RAZORLEAF,:WILLOWISP,:FURYSWIPES,:SUPERFANG,:SLASH,:FLAMEWHEEL,:SLUDGEBOMB,:FURYCUTTER,:DRAGONBREATH,:HEATWAVE,:POISONFANG,:AIRCUTTER,:ICICLESPEAR,:DRAGONCLAW,:SHADOWCLAW,:PSYCHOCUT)

Ego13

hollow_ego

Male
Larua Region
Seen 10 Hours Ago
Posted 6 Days Ago
296 posts
2.1 Years
HiddenMoveHandlers::CanUseMove.copy(:X,:Y,:Z) would copy the proc from :X to :Y and :Z.
:FIRESPIN does not have a defined proc, so it can't copy it to the rest.
:CUT must be the the first argument, not the last.
HiddenMoveHandlers::CanUseMove.copy(:CUT,:FIRESPIN,:THUNDER,:TOXIC,:SMOG,:SLUDGE,:FIREBLAST,:POISONGAS,:BLASTBURN,:FLAREBLITZ,:EMBER,:FLAMETHROWER,:ICEBEAM,:GUILLOTINE,:RAZORWIND,:AERIALACE,:BITE,:PECK,:RAZORLEAF,:WILLOWISP,:FURYSWIPES,:SUPERFANG,:SLASH,:FLAMEWHEEL,:SLUDGEBOMB,:FURYCUTTER,:DRAGONBREATH,:HEATWAVE,:POISONFANG,:AIRCUTTER,:ICICLESPEAR,:DRAGONCLAW,:SHADOWCLAW,:PSYCHOCUT)
Ah man, that was so obvious, I should have guessed that :D
But now I actually understand how the .copy works! Thanks a lot!
Looking for spriters to help with

Pokemon Hollow on pokecommunity.com
Advertiser Content