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

[ASM & Hex] Help Editing Altering Cave PKMN

45
Posts
11
Years
    • Seen Jun 26, 2023
    So, I found an easy way to recreate the Altering Cave experience: here

    And my custom script within the Map Header script for Altering Cave is something like this:
    Code:
    '-----------------
    #org @Start
    random 0x9
    copyvar 0x4024 LASTRESULT
    setworldmapflag 0x8BE
    end

    What this does is load one of the hardcoded Altering Cave PKMN already in the ROM at random into 0x4024 every time you enter Altering Cave. But with only 1 Pokemon of that type at a time. Great, we got this working. Now my question:

    Where is the table of Pokemon values for this loaded from? I've tried and with no luck in finding anything even close to this with a hex dump or raw hex searching. Any help would be appreciated. Thanks.

    EDIT: Hmm. One thing that would help is to figure out where in RAM 0x4024 variable is located. Though it is a temporary value, it must have a RAM location. If I find this, I can do a hex search and see what comes up and that might lead me to what I need. If anyone knows the RAM offset (or the ones right before, 0x4020-0x4023 the pedometer and where that's loaded might be even more help).
     
    Last edited:
    45
    Posts
    11
    Years
    • Seen Jun 26, 2023
    I found it by doing a raw hex search. It starts at 0x3C9AF8.

    The data is in this order:

    The Pokemon Data (by level, then Pokemon), the termination byte ($05), 3 bytes of $00 and a 4 byte pointer (the first Pokemon is Mareep, pointing to 0x83C9AF8, the start of the Monster's data). The Pokemon data are 56 bytes long, each.

    For example, the first Pokemon is Mareep, it is loaded as follows when the right value gets written to 0x4024:

    Mareep lv7 - lv7
    Mareep lv9 - lv9
    Mareep lv5 - lv5
    Mareep lv12 - lv12
    Mareep lv7 - lv7
    Mareep lv9 - lv9
    Mareep lv13 - lv13
    Mareep lv3 - lv3
    Mareep lv5 - lv5
    Mareep lv12 - lv12
    Mareep lv5 - lv5
    Mareep lv12 - lv12

    Then it terminates with a $05.

    The Pokemon go in this order, starting at 0x3C9AF8, 56 bytes each:

    Mareep
    Pineco
    Houndour
    Teddiursa
    Aipom
    Shuckle
    Stantler
    Smeargle

    Zubat's data isn't necessary, since it's already in the map by default. The level data is very similar in structure to the standard layout in-game seen via A-Map.

    EDIT: Hmm. There is a bunch of free space tacked on at the end of this data. It seems that you could freely add more Pokemon and then change the "Random 9" to your new number of Pokemon to adjust it. The way the free space is set up, it seems that more Pokemon were originally intended to be used within Map 8BE (Altering Cave).

    EDIT2: Interesting, Zubat's data (the one used by A-Map for Altering Cave) is actually before Mareep's (the first "altering" Pokemon) within hex = 0x3C9AC0. Really, I'm not surprised, since the routine draws the data set from pulling a random number so having them all together makes sense. You could, in theory, change the data offset for the pointer used for A-Map for each one to make it easier to edit then revert it. But I just choose to edit it in raw hex because I could.
     
    Last edited:
    Back
    Top