Your Majesty
Seen 12 Hours Ago
Posted 4 Weeks Ago
61 posts
149 Days
how to make a hm? I couldn't use the script that checks a move on the fandom wiki

I want to use a tm as a hm
so you are trying to have the tm have an overworld effect? cause if you want it to do an existing effect you can just look at "PField_FieldMoves" and find teleport and headbutt those are tms with overworld effects or are you trying to make an existing HM into a tm cause you can just make it into a tm in the pbs files should still work
Seen 57 Minutes Ago
Posted 16 Hours Ago
104 posts
3.8 Years
so you are trying to have the tm have an overworld effect? cause if you want it to do an existing effect you can just look at "PField_FieldMoves" and find teleport and headbutt those are tms with overworld effects or are you trying to make an existing HM into a tm cause you can just make it into a tm in the pbs files should still work
Yes, I want an event like Headbutt, but just to check Move, I don't want any effect.
Male
Unova
Seen 7 Hours Ago
Posted 1 Day Ago
236 posts
12.6 Years
I just modified pbCut to remove the parts of the code that actually does stuff. This will check if a Pokemon in your party knows a move. If your selected move is known nothing will happen, but if no Pokemon knows your move then a message will pop up.


def pbBlankMove
  move = getID(PBMoves,:XXX) #Replace XXX with the name of a move.
  movefinder = pbCheckMove(move)
  if !movefinder #Player does not have a Pokemon with the field move.
    pbMessage(_INTL("I am sorry your Pokemon lacks a special move."))
    return false
  else
    #Your script here.
  end
  return false
end
Developing Pokémon: World Saga
Seen 57 Minutes Ago
Posted 16 Hours Ago
104 posts
3.8 Years
I just modified pbCut to remove the parts of the code that actually does stuff. This will check if a Pokemon in your party knows a move. If your selected move is known nothing will happen, but if no Pokemon knows your move then a message will pop up.


def pbBlankMove
  move = getID(PBMoves,:XXX) #Replace XXX with the name of a move.
  movefinder = pbCheckMove(move)
  if !movefinder #Player does not have a Pokemon with the field move.
    pbMessage(_INTL("I am sorry your Pokemon lacks a special move."))
    return false
  else
    #Your script here.
  end
  return false
end
I tried to use your script with ROCKSLIDE movement as a conditional for opening a door, but I couldn't ...
Male
Unova
Seen 7 Hours Ago
Posted 1 Day Ago
236 posts
12.6 Years
I see where the confusion is. I did my best to recreate your event by just using the script.
pbRockSlide

def pbRockSlide 
  pbMessage(_INTL("Há uma rachadura entre as pedras. Um Pokémon pode ser capaz de abri-la. Para isso será necessário o movimento Rock Slide."))
  move = getID(PBMoves,:ROCKSLIDE)
  movefinder = pbCheckMove(move)
  if !movefinder
    pbMessage(_INTL("Essas pedras estão no seu caminho.")) 
    return false
  else
    pbMessage(_INTL("Há uma rachadura entre as pedras. Um Pokémon pode ser capaz de abri-la. Para isso será necessário o movimento Rock Slide."))
    if pbConfirmMessage(_INTL("Deseja usar o movimento Rock Slide?"))
      speciesname = (movefinder) ? movefinder.name : $Trainer.name
      pbMessage(_INTL("Você mandou seu Pokémon usar o ataque Rock Slide."))
      $game_map.events[38].moveto(38, 10)
      $game_screen.start_flash(Color.new(-255,-255,-255,0), 6)
      $game_map.events[38].moveto(38, 10)
      $game_screen.start_flash(Color.new(0,0,0,0), 50)
      return true
    end   
  end
  return false
end
But I think there is a better way to handle this. This exact script isn't want you need if you plan on using Rock Slide as an event more than once. Can I get a bit more info? Do you want the rocks to stay after you use Rock Slide like a Strength bolder or to disappear like Rock Smash? It might be best if we just set this up like a normal field move like rock smash.

#===============================================================================
# Rock Slide
#===============================================================================
def pbRockSlide
  move = getID(PBMoves,:ROCKSLIDE)
  movefinder = pbCheckMove(move)
  if  !movefinder
    pbMessage(_INTL("A pile of stones is in the way, you might be able to slide them."))
    return false
  end
  if pbConfirmMessage(_INTL("These rock appears to be moveable. Would you like to use Rock Slide?"))
    speciesname = (movefinder) ? movefinder.name : $Trainer.name
    pbMessage(_INTL("{1} used {2}!",speciesname,PBMoves.getName(move)))
    pbHiddenMoveAnimation(movefinder)
    return true
  end
  return false
end

HiddenMoveHandlers::CanUseMove.add(:ROCKSLIDE,proc { |move,pkmn,showmsg|
  facingEvent = $game_player.pbFacingEvent
  if !facingEvent || facingEvent.name.downcase!="stone"
    pbMessage(_INTL("Can't use that here.")) if showmsg
    next false
  end
  next true
})

HiddenMoveHandlers::UseMove.add(:ROCKSLIDE,proc { |move,pokemon|
  if !pbHiddenMoveAnimation(pokemon)
    pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
  end
  facingEvent = $game_player.pbFacingEvent
  if facingEvent
    pbSmashEvent(facingEvent)
  end
  next true
})
This will give Rock Slide the Rock Smash animation and sound effect until you can add your own.
Find this line and add what is in red.
def pbSmashEvent(event)
  return if !event
  if event.name.downcase=="tree";    pbSEPlay("Cut",80)
  elsif event.name.downcase=="rock"; pbSEPlay("Rock Smash",80)
  elsif event.name.downcase=="stone"; pbSEPlay("Rock Smash",80)
To use set up the even like this, make sure to name the event "Stone".
Developing Pokémon: World Saga
Seen 57 Minutes Ago
Posted 16 Hours Ago
104 posts
3.8 Years
I see where the confusion is. I did my best to recreate your event by just using the script.
pbRockSlide

def pbRockSlide 
  pbMessage(_INTL("Há uma rachadura entre as pedras. Um Pokémon pode ser capaz de abri-la. Para isso será necessário o movimento Rock Slide."))
  move = getID(PBMoves,:ROCKSLIDE)
  movefinder = pbCheckMove(move)
  if !movefinder
    pbMessage(_INTL("Essas pedras estão no seu caminho.")) 
    return false
  else
    pbMessage(_INTL("Há uma rachadura entre as pedras. Um Pokémon pode ser capaz de abri-la. Para isso será necessário o movimento Rock Slide."))
    if pbConfirmMessage(_INTL("Deseja usar o movimento Rock Slide?"))
      speciesname = (movefinder) ? movefinder.name : $Trainer.name
      pbMessage(_INTL("Você mandou seu Pokémon usar o ataque Rock Slide."))
      $game_map.events[38].moveto(38, 10)
      $game_screen.start_flash(Color.new(-255,-255,-255,0), 6)
      $game_map.events[38].moveto(38, 10)
      $game_screen.start_flash(Color.new(0,0,0,0), 50)
      return true
    end   
  end
  return false
end
But I think there is a better way to handle this. This exact script isn't want you need if you plan on using Rock Slide as an event more than once. Can I get a bit more info? Do you want the rocks to stay after you use Rock Slide like a Strength bolder or to disappear like Rock Smash? It might be best if we just set this up like a normal field move like rock smash.

#===============================================================================
# Rock Slide
#===============================================================================
def pbRockSlide
  move = getID(PBMoves,:ROCKSLIDE)
  movefinder = pbCheckMove(move)
  if  !movefinder
    pbMessage(_INTL("A pile of stones is in the way, you might be able to slide them."))
    return false
  end
  if pbConfirmMessage(_INTL("These rock appears to be moveable. Would you like to use Rock Slide?"))
    speciesname = (movefinder) ? movefinder.name : $Trainer.name
    pbMessage(_INTL("{1} used {2}!",speciesname,PBMoves.getName(move)))
    pbHiddenMoveAnimation(movefinder)
    return true
  end
  return false
end

HiddenMoveHandlers::CanUseMove.add(:ROCKSLIDE,proc { |move,pkmn,showmsg|
  facingEvent = $game_player.pbFacingEvent
  if !facingEvent || facingEvent.name.downcase!="stone"
    pbMessage(_INTL("Can't use that here.")) if showmsg
    next false
  end
  next true
})

HiddenMoveHandlers::UseMove.add(:ROCKSLIDE,proc { |move,pokemon|
  if !pbHiddenMoveAnimation(pokemon)
    pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
  end
  facingEvent = $game_player.pbFacingEvent
  if facingEvent
    pbSmashEvent(facingEvent)
  end
  next true
})
This will give Rock Slide the Rock Smash animation and sound effect until you can add your own.
Find this line and add what is in red.
def pbSmashEvent(event)
  return if !event
  if event.name.downcase=="tree";    pbSEPlay("Cut",80)
  elsif event.name.downcase=="rock"; pbSEPlay("Rock Smash",80)
  elsif event.name.downcase=="stone"; pbSEPlay("Rock Smash",80)
To use set up the even like this, make sure to name the event "Stone".

loved it, tomorrow I will test 😍😍😍