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

FBI's HM type-check hack

Uncommon

Oozma Kappa
192
Posts
8
Years
  • Announcements

    7/23/18

    • Bugs section added to OP (there's only 1 tiny one, I promise!)


    Previous updates

    Spoiler:





    Uncommon's FBI HM system patch

    Hi everyone! This is my first public contribution to the world of ROM hacking. What I've got for you today is a patch for FireRed (English 1.0 BPRE) that changes the behavior of HMs in the overworld. This is heavily based on FBI's research on HM checks. All the credit for that research goes to FBI (along with knizz and touched), and I'll be referring to his thread throughout this post.

    What is this?

    What this patch does is change all the HM overworld use checks. Instead of needing certain badges and moves to use HM moves in the overworld, you need to have certain types in your party. The needed type is easily changeable, but the types I've chosen to start with are:

    Code:
    Surf - Water
    Waterfall - Water
    Cut - Grass
    Rock Smash - Fighting
    Strength - Fighting
    Flash - Fire
    Fly - Flying

    As described in FBI's post, the original inspiration was to match the show, in which Trainers can effectively Surf with any Water-type Pokemon, Fly with (almost) any Flying-type, etc. This also eliminates the need to carry around an HM slave, or overwrite good moves for useless ones like Flash.

    How does it work?

    I've hijacked the internal script for each HM and redirected it to a new script that checks the new condition - whether or not you have a Pokemon of the appropriate type in your party - and, if so, activates the HM's overworld effect. This check is accomplished with FBI's modified version of special 0x12b, also explained in his post. I've tested all the scripts thoroughly and I'm confident their text and sequence of events match their vanilla FR counterparts (if applicable). If you want to get a deeper understanding of how this works, read FBI's thread on changing the HM checks, and check out the script posted in the Advanced Usage section.

    Usage

    After patching, all of these are passive and don't require any editing to start using them right away, except for Flash. To apply the Flash hack, you need to add it as a level script to each Flash-able map in A-Map. Its offset is 0x760024. I recommend following diego's level script tutorial (starting at step 5, because the script is already done). For the flag variable in A-Map, use 4000. As FBI explained to me, this is a temporary variable that's reset whenever the map reloads, meaning it'll be ready to activate again each time you enter the map.

    In the game

    With the exception of now needing a type instead of a move and a badge, Surf, Waterfall, Cut, Rock Smash, and Strength work exactly how they normally do - press A to interact with an obstacle and follow the prompts.

    qGwnsbG.gif


    If you have a Pokemon of the correct type (Fire by default), Flash will activate as soon as you enter a map with the level script applied.

    tcvMWHe.gif


    To activate Fly, a new option has been added to the START menu: MAP. It shows you the town map, and if you have a Flying-type, lets you choose a location to Fly to. The MAP option shows up when you activate the POKEMON menu option (ie, when you get your first Pokemon).

    TYD4lbT.gif


    Advanced Usage (optional)

    Spoiler:


    Compatibility

    Now, you'll notice I have used free space for these new scripts (from 760000-760704), which means this patch MIGHT NOT be compatible with hacks in progress. Since most people start at 800000, there's a good chance it IS compatible (for instance, this patch is 100% compatible with MrDollsteak's Attack and Decap Rombase!) but it's not guaranteed. If you really want to add this to a hack in progress, below are instructions for doing so.

    Spoiler:


    Bugs

    Spoiler:


    Credits

    I intend to use this in my upcoming hack, and now you can, too! With permission from FBI, this patch is for public use. Feel free to use it as long as you credit the following people:

    FBI - for the research and ASM development, plus help with fixing a bug with Fly
    knizz - for helping in FBI's research on Fly
    touched - for helping create FBI's modified special 0x12b
    mbcn10ww - for discovering and fixing a bug with the wrong Pokemon being displayed
    Uncommon - for writing the scripts, testing, and creating this patch

    Downloads

    and finally... the patch!

    Version 1.1 - .zip file that includes both the full patch and a patch to upgrade from version 1.0 to 1.1, plus instructions in the ReadMe

    Changelog

    Spoiler:
     
    Last edited:

    PokemonBen

    Kanto Champion
    60
    Posts
    8
    Years
    • Seen Apr 27, 2020
    This is brilliant. Now I can have an easier time making gym leaders and make my hack go the way I want it to. Question: can we disable some of them? For example maybe I want people to need a gym badge to use surf, but I want to keep all the others. Sorry if you have explained but I am my phone.
     
    27
    Posts
    10
    Years
    • Seen Jan 5, 2017
    It's pretty cool.
    Quick question: can other Pokémon types still learn HMs and be able to use it?
     

    Uncommon

    Oozma Kappa
    192
    Posts
    8
    Years
  • This is brilliant. Now I can have an easier time making gym leaders and make my hack go the way I want it to. Question: can we disable some of them? For example maybe I want people to need a gym badge to use surf, but I want to keep all the others. Sorry if you have explained but I am my phone.

    Thanks! There isn't (yet) a way to disable the type-check system for a single HM, but it's easy to add in a Gym badge requirement for any HM (on top of the type requirement) - check the Advanced Usage section, under Enable/Disable Flags. Let me know if that accomplishes what you want. If not, I could add that ability in, or help you do it.

    It's pretty cool.
    Quick question: can other Pokémon types still learn HMs and be able to use it?

    Good question. Not directly by interacting with an obstacle, but you can still use them from the Pokemon menu. Maybe I should disable those...
     
    Last edited:

    PokemonBen

    Kanto Champion
    60
    Posts
    8
    Years
    • Seen Apr 27, 2020
    So we can't use Surf in battle? Or do you just mean we can't manually activate Flash?
     
    137
    Posts
    10
    Years
    • Age 35
    • Seen May 1, 2024
    In-battle there's nothing special about "an HM move". What Uncommon just said was nothing in this thread prevents you from activating HM moves like Flash by teaching a Pokémon Flash and then using it from the Pokémon menu.
     

    Uncommon

    Oozma Kappa
    192
    Posts
    8
    Years
  • So we can't use Surf in battle? Or do you just mean we can't manually activate Flash?
    In-battle there's nothing special about "an HM move". What Uncommon just said was nothing in this thread prevents you from activating HM moves like Flash by teaching a Pokémon Flash and then using it from the Pokémon menu.

    ThomasWinwood is exactly correct. There have been no changes to the HM moves themselves, only to the conditions that allow you to use their effects in the overworld.
     

    Uncommon

    Oozma Kappa
    192
    Posts
    8
    Years
  • What do you mean by disable?

    I mean eliminating the ability to use HMs from the Pokemon menu, so you can only activate them from interacting with obstacles in the overworld (and the special "MAP" option for Fly). I'm sure I saw a thread explaining how to do this, but now I can't seem to find it... For now I'll just leave it as-is, so you can continue to use HMs from the Pokemon menu if you have a Pokemon who knows the move, in addition to the new overworld type checks.
     

    Uncommon

    Oozma Kappa
    192
    Posts
    8
    Years
  • Is it really compatible with Mr Dollstreak's base?

    As of the time of writing (December '15), it was 100% compatible. I've been pretty much inactive since February, though, so I don't know if Dollsteak's had any updates that break compatibility. I've listed all the free offsets I used in the thread, so you can compare to Dollsteak's thread and check for any overlaps.
     

    FIQ

    251
    Posts
    11
    Years
    • Seen Sep 15, 2022
    How easy would it be to change the routine to check for whether or not a pokémon can learn the given HM move, rather than typing?
     

    Uncommon

    Oozma Kappa
    192
    Posts
    8
    Years
  • How easy would it be to change the routine to check for whether or not a pokémon can learn the given HM move, rather than typing?

    I thought about doing this too, and I actually think it's probably a better idea. In theory, it should be pretty easy. All you'd have to do is edit my scripts and change the lines where I used FBI's special 0x12b to check types to instead check the move table. I just never got familiar enough with the move table do it.
     
    534
    Posts
    11
    Years
    • Age 26
    • Seen Jul 24, 2023
    How easy would it be to change the routine to check for whether or not a pokémon can learn the given HM move, rather than typing?

    I thought about doing this too, and I actually think it's probably a better idea. In theory, it should be pretty easy. All you'd have to do is edit my scripts and change the lines where I used FBI's special 0x12b to check types to instead check the move table. I just never got familiar enough with the move table do it.

    I think this is what you're looking for. http://www.pokecommunity.com/showpost.php?p=8927083&postcount=726
     
    50
    Posts
    9
    Years
    • Seen Jan 18, 2017
    Bug Fix:



    The code to do this is simple, first compile this into free space:
    Spoiler:


    Code:
    .text .align 2 .thumb .thumb_func main: push {r4-r5} mov r4, r1 @save r1 contents ldr r0, = 0x828 ldr r1, = (0x806E6D0 +1) @checkflag bl linkerOne lsl r0, r0, #0x18 lsr r0, r0, #0x18 cmp r0, #0x1 bne end mov r0, #0x1 @load rest of menu manually ldr r1, = (0x806ED94 +1) bl linkerOne mov r0, #0x2 ldr r1, = (0x806ED94 +1) bl linkerOne mov r0, #0x3 ldr r1, = (0x806ED94 +1) bl linkerOne mov r0, #0x4 ldr r1, = (0x806ED94 +1) bl linkerOne mov r0, #0x5 ldr r1, = (0x806ED94 +1) bl linkerOne mov r0, #0x6 ldr r1, = (0x806ED94 +1) bl linkerOne pop {r4-r5} pop {r0} @put separately for readability bx r0 end: pop {r4-r5} ldr r0, =(0x806EDDA +1) @if no party bx r0 linkerOne: bx r1 .align 2





    Now go to 0x6EDC6 and overwrite the bytes there with:
    01 48 00 47 00 00
    The next 4 bytes after these 6 is the pointer to the above assembled code + 1 in reverse hex.
    What the above does is creates a branch from the initial flagcheck into our routine.

    Finally we need to modify the order that the other menus come up pre-map availablity.
    Go to 0x6EDD0 and ctrl+b this:
    Code:
    01 28 02 D1 01 20 FF F7 DD FF 02 20 FF F7 DA FF 04 20 FF F7 D7 FF 05 20 FF F7 D4 FF 06 20 FF F7 D1 FF 06 20 00 00 00 00 01 BC 00 47 29 08 00 00
     
    Back
    Top