• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • 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.

[Scripting Question] Let player character use HMs like in debug mode

Guest123123

Guest
  • 0
    Posts
    Until SM, a common criticism of the games was needing Pokemon with HM moves to occupy team slots in order to get past obstacles or environments.

    Some fangames have ways around this. For example, Insurgence and Touhoumon Faith and Prayer replace HMs with key items, while Reborn made HMs TMs that can be forgotten.

    I had an idea of just letting the player use the move themself instead of needing a Pokemon to do it, pretty much exactly like you can do in debug mode (I do have an explanation prepared for how the player is logically capable of using these, in case people wonder how a human can fly without wings or somesuch). Is there a way to program the HMs to do this for normal (non-debug mode) gameplay?
     
    Last edited by a moderator:
    Doesn't seem too difficult. All the HMs defined in PField_HiddenMoves have a structure something like this.
    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))
    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
    Notice that the script will enable if either $DEBUG is on or if all the conditions for a normal Cut Tree are met. By just removing most of the code, you should be able to get rid of all the if statements and make it work no matter what. For example, I'm pretty sure this should work. Haven't tested it, but give it a try.
    def Kernel.pbCut
    Kernel.pbMessage(_INTL("This tree looks like it can be cut down!\1"))
    if Kernel.pbConfirmMessage(_INTL("Would you like to cut it?"))
    Kernel.pbMessage(_INTL("{1} used Cut!",$Trainer.name))
    #pbHiddenMoveAnimation(movefinder)
    return true
    end
    return false
    end
    btw, I commented out the line that displays the animation because I'm not really sure how you want that to work with no HMs or anything. That's something you'll have to figure out yourself.

    e: ew pc butchered my formatting. tab your code, kids.
     
    Code:
    def Kernel.pbCut
      if $DEBUG ||
    (HIDDENMOVESCOUNTBADGES ? $Trainer.numbadges>=BADGEFORCUT : $Trainer.badges[BADGEFORCUT])
        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))
          pbHiddenMoveAnimation(movefinder)
          return true
        end
      else
        Kernel.pbMessage(_INTL("This tree looks like it can be cut down."))
      end
      return false
    end

    Removed only the check to see if you have a Pokemon that knows the move. This allows you to still leave Cut locked behind a Gym Badge
     
    Back
    Top