• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] how to make a hm? I want to use a tm as a hm

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
 
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.
 
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.


Code:
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
 
Last edited:
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.


Code:
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 ...
 
That script isn't meant to be used as a check for a conditional branch, it is the conditional branch. Can you post a image of how your using the script?

[PokeCommunity.com] how to make a hm?  I want to use a tm as a hm

https://ibb.co/CnjjBT0

[PokeCommunity.com] how to make a hm?  I want to use a tm as a hm

https://ibb.co/4S6GvZr
 
I see where the confusion is. I did my best to recreate your event by just using the script.
Code:
pbRockSlide


Code:
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.

Code:
#===============================================================================
# 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.
Code:
def pbSmashEvent(event)
  return if !event
  if event.name.downcase=="tree";    pbSEPlay("Cut",80)
  elsif event.name.downcase=="rock"; pbSEPlay("Rock Smash",80)
  [COLOR="Red"]elsif event.name.downcase=="stone"; pbSEPlay("Rock Smash",80)[/COLOR]

To use set up the even like this, make sure to name the event "Stone".
 

Attachments

  • [PokeCommunity.com] how to make a hm?  I want to use a tm as a hm
    RockSlide.png
    31.1 KB · Views: 6
I see where the confusion is. I did my best to recreate your event by just using the script.
Code:
pbRockSlide


Code:
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.

Code:
#===============================================================================
# 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.
Code:
def pbSmashEvent(event)
  return if !event
  if event.name.downcase=="tree";    pbSEPlay("Cut",80)
  elsif event.name.downcase=="rock"; pbSEPlay("Rock Smash",80)
  [COLOR="Red"]elsif event.name.downcase=="stone"; pbSEPlay("Rock Smash",80)[/COLOR]

To use set up the even like this, make sure to name the event "Stone".


loved it, tomorrow I will test 😍😍😍
 
Back
Top