• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.

HM-Moves as Items (complete and drag and drop)

Can I have a custom character player Sprite for these as they use The normal hm sprites?


If you want to use surf as a hidden move and an item for surfing as well but also want to use different sprites for the pokemon and the surfitem, then you can.
At first you have to add a graphic for your surfitem in the folder "/Graphics/Characters/". The graphic should be formatted similar to the graphic "base_surf.png" and must be named as "base_surf_on_item.png". By the way, if you miss to add the graphic "base_surf_on_item.png", then this script simply uses the original surfing sprite.
After that you have to do the following modifications.

#--------------------------------------------------
# Changes in class "PokemonGlobalMetadata" in script section "PField_Metadata"
#--------------------------------------------------

Add the attr-accessor for surfingOnItem to the class "PokemonGlobalMetadata" in script section PField_Metadata" by adding the code
Code:
  attr_accessor :surfingOnItem
right below
Code:
  attr_accessor :surfing

Find the method "initialize" in the class "PokemonGlobalMetadata" in script section PField_Metadata" and add the code
Code:
    @surfingOnItem        = false
right below
Code:
    @surfing              = false


#--------------------------------------------------
# Changes in script section Game_player
#--------------------------------------------------

Find the method "Kernel.pbCancelVehicles(destination=nil)" in script section "Game_Player" and add into that method the code
Code:
  $PokemonGlobal.surfingOnItem = false
right below
Code:
  $PokemonGlobal.surfing = false

#--------------------------------------------------
# Changes in class "Sprite_SurfBase" in script section "Sprite_SurfBase"
#--------------------------------------------------

Find the method "initialize(sprite,event,viewport=nil)" in the class "Sprite_SurfBase" in script section "Sprite_SurfBase" and add into that method the code
Code:
    @surfonitembitmap = (pbResolveBitmap("Graphics/Characters/base_surf_on_item")) ? AnimatedBitmap.new("Graphics/Characters/base_surf_on_item") : @surfbitmap
    @cwi = @surfonitembitmap.width/4
    @chi = @surfonitembitmap.height/4
right above
Code:
    update


Find the method "dispose" in the class "Sprite_SurfBase" in script section "Sprite_SurfBase" and add into that method the code
Code:
      @surfonitembitmap.dispose
right below
Code:
      @surfbitmap.dispose

Find the method "update" in the class "Sprite_SurfBase" in script section "Sprite_SurfBase" and replace into that method the code
Code:
        @sprite.bitmap = @surfbitmap.bitmap; cw = @cws; ch = @chs
by
Code:
        $PokemonGlobal.surfingOnItem = false if !$PokemonGlobal.surfingOnItem
        if $PokemonGlobal.surfingOnItem==true
          @sprite.bitmap = @surfonitembitmap.bitmap; cw = @cwi; ch = @chi
        else
          @sprite.bitmap = @surfbitmap.bitmap; cw = @cws; ch = @chs
        end



#--------------------------------------------------
# Changes in script section "HMs_as_items"
#--------------------------------------------------

Finally we have to modify the script in the first post, which you have allready saved under the script section "HMs_as_Items" above main
Add the new method "pbStartSurfingOnItem" in the Script "HMs_as_items". It is recommanded to add this method right above the method "Kernel.pbSurf"
Code:
def pbStartSurfingOnItem
  Kernel.pbCancelVehicles
  $PokemonEncounters.clearStepCount
  $PokemonGlobal.surfing = true
  $PokemonGlobal.surfingOnItem = true
  $PokemonTemp.surfJump = $MapFactory.getFacingCoords($game_player.x,$game_player.y,$game_player.direction)
  Kernel.pbUpdateVehicle
  Kernel.pbJumpToward
  $PokemonTemp.surfJump = nil
  Kernel.pbUpdateVehicle
  $game_player.check_event_trigger_here([1,2])
end



Find the method "Kernel.pbSurf" in the script section "HMs_as_items" and add into that method the code
Code:
      $PokemonGlobal.surfingOnItem = true
right above
Code:
      pbHiddenMoveAnimation(nil)
Moreover replace the line
Code:
    pbStartSurfing
by
Code:
    $PokemonGlobal.surfingOnItem == true ? pbStartSurfingOnItem : pbStartSurfing

Find the method "useMoveSurf" in the script section "HMs_as_items" and replace into that method the code
Code:
   pbStartSurfing
by
Code:
   pbStartSurfingOnItem



If you haven't done any changes in that script sections before, then you can compare it with the code in the following spoiler section
Spoiler:
 
The script for me doesn't work at all. I placed above main, and below Follow. I used the name you said, have the items on the PBS with icons, but any of them use. I can't use them from the bag, any of them...
 
The script for me doesn't work at all. I placed above main, and below Follow. I used the name you said, have the items on the PBS with icons, but any of them use. I can't use them from the bag, any of them...

What version of Pokemon Essentials do you use? This script is for Pokemon Essentials version 17.2 and is not tested with version 18.1.
If you want HM-Moves as Items for Pokemon Essentials, then you have to upgrade this script or create a new one. For the latter, there is this tutorial by FL:
https://www.pokecommunity.com/threads/304725
 
What version of Pokemon Essentials do you use? This script is for Pokemon Essentials version 17.2 and is not tested with version 18.1.
If you want HM-Moves as Items for Pokemon Essentials, then you have to upgrade this script or create a new one. For the latter, there is this tutorial by FL:
https://www.pokecommunity.com/threads/304725

I'm using 17.2, so that's why I'm worried about it :(
I've been testing and I was wrong about items not working, where they don't work is using them from the bag. For example, I can interact with the water, and use Surf, but I can't use the Surf item from the bag.

This is ok for Cut, Rocksmash, Strenght...But for Flash and Fly it's a big problem, do you know where I could start to search in order to fix it?
 
I'm using 17.2, so that's why I'm worried about it :(
I've been testing and I was wrong about items not working, where they don't work is using them from the bag. For example, I can interact with the water, and use Surf, but I can't use the Surf item from the bag.

This is ok for Cut, Rocksmash, Strenght...But for Flash and Fly it's a big problem, do you know where I could start to search in order to fix it?

I tested it with Fly and Surf and Flash in Pokemon Essentials v17.2. It works from the bag. Try to install it again.
 
Last edited:
I tested it with Fly and Surf and Flash in Pokemon Essentials v17.2. It works from the bag. Try to install it again.

I didn't work for me... But anyways they work outside of the bag so it's not that much of a problem. Thanks for the script and helping <3
 
Many fan game developers want to use items instead of HM-Moves in their games. Unfortunately, there is no complete script for Pokemon Essentials V19 right now.
But maybe you are the hero who wants to pleases the needs of the community, or you know the one. We would be so thankful.

This current script was the result of FL's tutorial about "Turn HM moves into items". See https://www.pokecommunity.com/threads/304725
The tutorial might be outdated since the organisation of the script sections and the scripting language changed in Pokemon Essentials but the main steps described in FL's tutorial are still valid. Maybe, this can help you.
 
Back
Top