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

Emerald: Showing A Pokemon Using The Pokemon Menu [special 0xA2]

Bladecraft

It's written "Bladecraft" on my forehead.
83
Posts
7
Years
    • Seen Jun 18, 2020
    Introduction

    Eyyyrybody!!
    Lately I have been creating a sidequest for my rom hack. In this sidequest you are helping the Professor research a cave, and therefore you must catch and show him every Pokemon that appears in the cave.

    He tells you which Pokemon he wants you to show him, you go and catch it, then, when talking to him again, the Pokemon menu opens and you show him the Pokemon.

    Since I had a difficult [and tilting] time overcoming this problem, I decided to create this Resource/Tutorial thread to improve the information we have about rom hacking and now everyone can use this.​


    Example

    Here's a gif demonstrating the final result:

    Spoiler:


    How It's Done

    Alright, I'm going to take you step by step about how to do this.
    I'm going to assume that you already know how to insert an ASM routine into your game and how to use it.

    In case you don't, I learned how to using this thread by HackMew:
    https://www.pokecommunity.com/showthread.php?t=117917

    Simply go to the "Having Fun With ASM" section and finish his tutorial first, as it is very comfortable and beginner friendly.

    The ASM Routine
    The base ASM routine that we're using is this routine written by kleenexfeu, so credits to him.
    However, his routine is is incorrect though, so we have the extremely talented and handsome BreadCrumbs to rewrite and fix it for us.

    Here is the post that kleenexfeu made for this routine - I feel obliged to put it in because he's the original author:
    https://www.pokecommunity.com/showpost.php?p=8925169&postcount=724

    Here is the original routine by kleenexfeu in case you're lazy to check the post:
    Spoiler:

    And here is the modified routine by BreadCrumbs
    Spoiler:


    How To Use The Routine
    Alright so the routine works like so. First, you set the variable 8005 to the hex ID of the Pokemon you want to be shown. So if I want the player to show a Tochic, my first line is "setvar 0x8005 0x118"

    Afterwards, call the special 0xA2, which opens the Pokemon menu.
    Put a waitstate so the game keeps waiting, and afterwards call the ASM routine using the line "callasm 0x08ROUTINE+1"

    If you've done all this, the variable 8005 is now set to 0x1 if the player picked the correct Pokemon, and 0x0 if he picked the wrong one.

    Example Scripts
    I'll assume that there's a sprite you want the player to talk to and show it the Pokemon.

    So here's the most basic script, this is ONLY the Pokemon Menu opening and the correct Pokemon has to be picked. If it's correct it will go to @yep and if it's incorrect it will continue to the msgbox stating it is incorrect.

    Spoiler:

    Here's the biggest example I can show you - it's the sidequest script from my hack.
    You show 7 different Pokemon in a specific order, and the reward is included, too.
    This script is over 450 lines long though, so you can only use it if you have the will to read and understand it.

    Spoiler:

    Final Words

    So I explained only the basics in this one and gave a couple of examples. The thing to remember is to think and be original with the things that this routine can accomplish, as it is very flexible. Another rom hacker that I keep in touch is already making a daily quest using this routine, so you can go very far using this, you only need to think of the great idea.

    Big thanks to everyone that made this possible, the original author of the routine and others in the Discord channel by helping me out while I was struggling:
    kleenexfeu, Lunos, Ryusaki and BreadCrumbs​
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Damn, it's been 3 years already?
    Anyway, I'm bringing the thread back from the dead to clarify that no ASM Routine is needed in order to check for a species in Pokémon Emerald.
    Alongside the special 0xA2 which lets you choose a party Pokémon, there's also a special to check the species of the Pokémon that was selected through it.
    Here's a quick script I wrote to help someone in the Discord server: https://pastebin.com/FHBUn8f8
    Code:
    #dynamic 0x71BBA0
    
    #org @start
    lock
    msgbox @1 0x5
    compare LASTRESULT 0x1
    if 0x0 goto @end
    special 0xA2 // Pick a Pokémon
    waitstate
    compare 0x8004 0x6
    if 0x4 goto @end
    special2 0x800d 0x149
    compare 0x800d 280 // Checks if the Pokémon selected was a Torchic
    if 0x1 goto @youhaveone
    msgbox @2 0x6
    release
    end
    
    #org @end
    release
    end
    
    #org @youhaveone
    msgbox @3 0x6
    release
    end
    
    #org @1
    = Do you have a TORCHIC?
    
    #org @2
    = Aww[.] you don't[.]
    
    #org @3
    = You do! You do!

    Result:
    Untitled3660.gif


    Bless the decompilation project. It's an excellent source of information.

    EDIT: 3 months later I decided to also drop the equivalent for FireRed because why not.
    Spoiler:
     
    Last edited:
    Back
    Top