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

HM Player Animation Help?

39Gamer

39Games
  • 55
    Posts
    10
    Years
    I have started to work on a code for the player to animate (hold pokeball in the air like in gen 4 & 5) when he/she uses a HM, i've started on cut and I get a syntax error.. i figured this code would work.. what am i doing wrong? sorry i am new to scripting.. i will also need a script to use a different image for the female character.
    heres the code:
    Code:
    #===============================================================================
    # Cut
    #===============================================================================
    def Kernel.pbCut
      if $DEBUG ||
         (HIDDENMOVESCOUNTBADGES ? $Trainer.numbadges>=BADGEFORCUT : $Trainer.badges[BADGEFORCUT])
        movefinder=Kernel.pbCheckMove(:CUT)
        if $DEBUG || movefinder
          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
            Kernel.pbMessage(_INTL("{1} used Cut!",speciesname))
            pbMoveRoute($game_player,[
              PBMoveRoute::Graphic - "trchar000cut', 0, 2, 0
              pbWait(4)
              PBMoveRoute::Graphic - "trchar000cut', 0, 2, 1
              pbWait(4)
              PBMoveRoute::Graphic - "trchar000cut', 0, 2, 2
              pbWait(4)        
              PBMoveRoute::Graphic - "trchar000cut', 0, 2, 3
              pbWait(20)         
            ])        
            pbHiddenMoveAnimation(movefinder)
            return true
          end
        else
          Kernel.pbMessage(_INTL("This tree looks like it can be cut down."))
        end
      else
        Kernel.pbMessage(_INTL("This tree looks like it can be cut down."))
      end
      return false
    end
    
    HiddenMoveHandlers::CanUseMove.add(:CUT,proc{|move,pkmn|
       if !$DEBUG &&
          !(HIDDENMOVESCOUNTBADGES ? $Trainer.numbadges>=BADGEFORCUT : $Trainer.badges[BADGEFORCUT])
         Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
         return false
       end
       facingEvent=$game_player.pbFacingEvent
       if !facingEvent || facingEvent.name!="Tree"
         Kernel.pbMessage(_INTL("Can't use that here."))
         return false
       end
       return true
    })
    
    HiddenMoveHandlers::UseMove.add(:CUT,proc{|move,pokemon|
       if !pbHiddenMoveAnimation(pokemon)
         Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
       end
       facingEvent=$game_player.pbFacingEvent
       if facingEvent
         facingEvent.erase
         $PokemonMap.addErasedEvent(facingEvent.id)
       end
       return true
    })
    Cheers.
     
    Last edited:

    FL

    Pokémon Island Creator
  • 2,454
    Posts
    13
    Years
    • Seen yesterday
    PBMoveRoute::Graphic - "trchar000cut', 0, 2, 0
    What is this? Are you trying to subtract from a number (PBMoveRoute::Graphic=41) a string that start with double quotes and ends at single quotes? This array declaration is totally wrong!
     

    Jojirius

    Jacuzzi Ant
  • 20
    Posts
    10
    Years
    I'm confused about what the script is trying to do. Are you trying to edit the TM/HM animation by having the player be involved somehow?
     
  • 1,224
    Posts
    10
    Years
    One possible method is to do something like what Surf does. It doesn't change the graphic in that definition, it calls pbStartSurfing. Doing something like this might work. You'll have to edit def Kernel.pbUpdateVehicle to include your charset and for you to be able to call it.

    It might be a bit complicated, but I think something like that might be easier than the way you're trying to do it
     
    Back
    Top