• 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!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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

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