• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

Pokemon Natural HM

  • 423
    Posts
    13
    Years
    • Seen Aug 31, 2023
    is there a way to give an hm ability (not battle move) to a pokemon based on there species (eg scyther naturally being able to use cut outside battle, machamp being able to use strength outside battle)
     
  • 824
    Posts
    9
    Years
    PSystem_Utilities, around line 2845, add in the red lines.

    Code:
    # Checks whether any Pokémon in the party knows the given move, and returns
    # the index of that Pokémon, or nil if no Pokémon has that move.
    def pbCheckMove(move)
      move=getID(PBMoves,move)
      return nil if !move || move<=0
      for i in $Trainer.party
        next if i.isEgg?[COLOR="Red"]
        return i if isConst?(i.species,PBSpecies,:SCYTHER) && isConst?(move,PBMoves,:CUT)
        return i if isConst?(i.species,PBSpecies,:MACHAMP) && isConst?(move,PBMoves,:STRENGTH)[/COLOR]
        for j in i.moves
          return i if j.id==move
        end
      end
      return nil
    end

    Note that this will make it so that you can talk to HM triggers (trees for Cut, boulders for Strength), and the HM moves will work. This will not make them appear in the list of moves that you can use from the Party screen.
     

    Flowerchild

    fleeting assembly
  • 8,709
    Posts
    14
    Years
    Is it possible to do something similar to this but instead have it use an item (ie an ax or something)?

    A quick google search and you would've found this tutorial on the Pokémon Essentials Wiki.

    PSystem_Utilities, around line 2845, add in the red lines.

    Code:
    # Checks whether any Pokémon in the party knows the given move, and returns
    # the index of that Pokémon, or nil if no Pokémon has that move.
    def pbCheckMove(move)
      move=getID(PBMoves,move)
      return nil if !move || move<=0
      for i in $Trainer.party
        next if i.isEgg?[COLOR="Red"]
        return i if isConst?(i.species,PBSpecies,:SCYTHER) && isConst?(move,PBMoves,:CUT)
        return i if isConst?(i.species,PBSpecies,:MACHAMP) && isConst?(move,PBMoves,:STRENGTH)[/COLOR]
        for j in i.moves
          return i if j.id==move
        end
      end
      return nil
    end

    Note that this will make it so that you can talk to HM triggers (trees for Cut, boulders for Strength), and the HM moves will work. This will not make them appear in the list of moves that you can use from the Party screen.
    I'd like to add this to my game as well, but this seems like a slow way to code it when there are dozens/hundreds of Pokémon that can learn a particular HM. Is there a way to modify this code so it'll check if the given Pokémon is in a text file (say, one that lists the internal names of all Pokémon that can use Cut)?
     

    Maruno

    Lead Dev of Pokémon Essentials
  • 5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    I'd like to add this to my game as well, but this seems like a slow way to code it when there are dozens/hundreds of Pokémon that can learn a particular HM. Is there a way to modify this code so it'll check if the given Pokémon is in a text file (say, one that lists the internal names of all Pokémon that can use Cut)?
    Such a list already exists: tm.txt. From there, it's simple to use def pbSpeciesCompatible?.
     
  • 9
    Posts
    8
    Years
    Oh, thank you for the link. I tried looking it up but I guess I wasn't using the right wording. (I know I'm supposed to quote who I'm replying to but I'm really new to forums and I'm not sure how to)
     
    Back
    Top