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

[ASM & Hex] Problems with Surf

  • 87
    Posts
    9
    Years
    • Seen Feb 5, 2021
    Hi guys, I met some problems while dealing with Surf in Emerald.
    The first one is that, despite I can use it while interacting in the overworld, I can't call it from Pokèmon menu since it says that it's required a specific badge. So I'm asking if you know where that specific badge check is located in the ROM (I tried to find it on my own but I'm not good with disassembly stuff).
    Note that I've already changed the flag in 0x9c81c.

    The second one concerns the blocks which you can surf on.
    I found that surf-interaction is not possible with all blocks with 4-permission on A-Map but just with specific blocks. I guess there's a link between these blocks and this script somewhere but I'm not able to find how it works. What I need to do is to add/change the blocks which load the script.

    Hope you can help me!
     
    Ok guys looks like I solved the second problem, I'm just a moron since I set the wrong block behaviour.
     
    Point One

    You should be able to remove the badge check by nopping the cmp at 0809C7FE (put two 00 bytes). The actual flag in question is at 0809C81C. This is the badge check for the normal overworld check. The party effect is actually a bit more complicated, and requires you to repoint two tables:

    First, the field move list (08615D7E, 30 bytes, 2 bytes per entry) must be repointed. This is a list of half words of move indices which describe which moves show up in the party list, terminated with the move swords dance (0xE). Repoint this list and move surf so that appears after the HM moves (after index 7), ensuring the list still ends in swords dance. All moves before the 7th move are treated as HMs and a badge check is done for them. Next, repoint the effect table (08615D9C, 112 bytes, 8 bytes per entry) and move surf (7th entry) to the same index as in the first table.

    Alternatively, you can change the 7 at 081B54E8 to 0 zero to remove all HM badge checks (or a lower value if you want some to still be checked).

    Point Two

    Despite what amap would have you believe, the "movement permission" (which is actually a combination of some bits describing the height of a block and the bits describing whether a block is passable or not) 4 has nothing to do with surfing. All that matters is that the surfable area is a different height (not necessarily a lower height) to the surrounding land. This ensures the player can't just walk into the ocean/pond/river. The other thing that matters, as you have discovered for yourself, is that the correct block behaviour is used. This just runs the surf script when you press A after a badge and move check.
     
    Thank you Touched, I didn't expect such a precise and detailed answer, I really appreciated it!
     
    Back
    Top