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

An item that does the same thing as an HM

Derxwna Kapsyla

Derxwna "The Badman" Kapsyla
437
Posts
12
Years
  • Within my game there's planned to be items that act on the same function as an HM, just without requiring the badge to be obtained.

    Now, what I don't know is, how would I go about making items that work the same way? I'm pretty sure it goes into PokemonItemEffects in the script editor, and the "UseFromBag" and the "UseInField" sections within, but aside from that, I'm not sure how I would implement them. I figure it would start off something like this...

    Spoiler:

    But after that, I don't know what to put. Even after looking in the PokemonHiddenMoves script section, I wasn't sure which sections to copy and paste over and what to remove. Would someone be able to help me out here?
     

    ~JV~

    Dev of Pokémon Uranium
    684
    Posts
    16
    Years
  • Within my game there's planned to be items that act on the same function as an HM, just without requiring the badge to be obtained.

    Now, what I don't know is, how would I go about making items that work the same way? I'm pretty sure it goes into PokemonItemEffects in the script editor, and the "UseFromBag" and the "UseInField" sections within, but aside from that, I'm not sure how I would implement them. I figure it would start off something like this...

    Spoiler:

    But after that, I don't know what to put. Even after looking in the PokemonHiddenMoves script section, I wasn't sure which sections to copy and paste over and what to remove. Would someone be able to help me out here?

    I don't have time to give precise instructions on how to do this right now, but I would just create a Key Item that doesn't do anything (script wise) and then on PokemonField (where HMs effects are handled) and mess with the HM conditionals there. Shouldn't be hard adding a item condition there!
     

    Derxwna Kapsyla

    Derxwna "The Badman" Kapsyla
    437
    Posts
    12
    Years
  • I don't have time to give precise instructions on how to do this right now, but I would just create a Key Item that doesn't do anything (script wise) and then on PokemonField (where HMs effects are handled) and mess with the HM conditionals there. Shouldn't be hard adding a item condition there!

    It sounds like it would be a solid method if I knew how to do it. If you could perhaps explain later, that would be appreciated greatly.
     

    Derxwna Kapsyla

    Derxwna "The Badman" Kapsyla
    437
    Posts
    12
    Years
  • Forgive me for double posting but, when I went to check "PokemonField", there was no trace of anything for Cut in there. The only place that seems to store Cut's scripting is in PokemonHiddenMoves, and from that I have no idea what to do. I've tried copying the entire code and pasting it, editing out some things, but nothing seems to work.
     

    FL

    Pokémon Island Creator
    2,449
    Posts
    13
    Years
    • Seen today
    I done this for Surf in my game.

    In PokemonHiddenMoves delete the 'HiddenMoveHandlers::CanUseMove' proc. Change the line 'if $DEBUG || movefinder' (there one for each HM) to
    'if $DEBUG || ($PokemonBag.pbQuantity(PBItems::YOURITEMINTERNALNAME)>0'. There ways to add the effect in the "Use" item command too, but almost no player use this method.
     

    Rayd12smitty

    Shadow Maker
    645
    Posts
    12
    Years
    • Seen Feb 21, 2016
    I done this for Surf in my game.

    In PokemonHiddenMoves delete the 'HiddenMoveHandlers::CanUseMove' proc. Change the line 'if $DEBUG || movefinder' (there one for each HM) to
    'if $DEBUG || ($PokemonBag.pbQuantity(PBItems::YOURITEMINTERNALNAME)>0'. There ways to add the effect in the "Use" item command too, but almost no player use this method.

    I had no idea it could be that easy. I never intended to do this but I will remember this for future use
     

    Derxwna Kapsyla

    Derxwna "The Badman" Kapsyla
    437
    Posts
    12
    Years
  • Here's a bit of delicious irony. Earlier today, before you posted FL, my friend actually managed to figure out how to make the Items work. The method is close to what FL came up with. Not quite exact, but close to. I'll post the information if he gives me permission, along with the code, since I'm sure it'd be a highly coveted feature people would want.
     

    Mugendai

    Glitchologist
    11
    Posts
    13
    Years
    • Seen Apr 17, 2014
    I'm that friend who edited the PokemonHiddenMoves file in Pokemon Essentials v11 to accommodate items.

    I've bolded my edits in one function to show what exactly I've changed:
    Code:
    def Kernel.pbCut
    [B]  hasAxe=$PokemonBag.pbQuantity(PBItems::AXE)>0
      hasBadge=HIDDENMOVESCOUNTBADGES ? $Trainer.numbadges>=BADGEFORCUT : $Trainer.badges[BADGEFORCUT]
      movefinder=Kernel.pbCheckMove(:CUT)
    
      if $DEBUG || hasAxe || ( hasBadge && movefinder )[/B]
        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 ? $Trainer.name : movefinder.name
          [B]if hasAxe
            Kernel.pbMessage(_INTL("{1} used the Axe!",$Trainer.name))
          else[/B]
            Kernel.pbMessage(_INTL("{1} used Cut!",speciesname))
            pbHiddenMoveAnimation(movefinder)
          [B]end[/B]
          return true
        end
    
      else
        Kernel.pbMessage(_INTL("This tree looks like it can be cut down."))
      end
    
      return false
    end
    Since PokeCommunity won't let me link to a pastebin, I'll just post the entire file with my edits here:

    Spoiler:

    You're free to use the code without giving me credit, since it's mainly a small edit of Pokemon Essentials' developers' code.

    The only HMs I've handled are Surf, Dive, Waterfall, Cut, Rock Smash, and Strength. I haven't handled Fly or Flash yet, nor are the items usable from the bag, so I'll possibly post a second, more refined version here later.
     
    Back
    Top