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

[HG] - Adding a New Type to Heart Gold - Using Fairy as an Example

BluRose

blu rass
811
Posts
10
Years
  • Adding a New Type to HG - Using Fairy as an Example

    wDtG8t7.png


    EDIT (June 27 2021): If you used this tutorial with the precompiled binaries before June 27, then the a017 precompiled binary wasn't the correct one. The MEGA archive has been updated. The attachment from this post has been removed. The MEGA link should now be used.

    Over the past long while, I have been delving into hacking Heart Gold with a new project in mind.
    Pokeruby has spoiled me, needless to say.
    The NDS Pokémon games are also another beast that introduced a file system! This can be read by Tinke and Crystal Tile 2. EDIT: Most importantly, ndstool.

    Crystal Tile 2 specifically will be hugely necessary for this tutorial, interestingly enough. Tinke as well if you so choose.

    First thing's first though, shout-outs to MeroMero for the beginnings of what's here.
    However, one thing that never really seems to get published is the data (specifically the gfx) side of things.

    EDIT (July 30 2021): massive overhaul time

    Basically, doing this manually was very painstaking and took a very long time. There is a very simple way to do this now, and similar to projects like the follow me implementations or the mega evolution projects for the gba, this involves running a few commands in the command line. Unlike those, this doesn't require python or anything similar and all the tools required come bundled with the code. On Windows machines, the process to build literally just involves running a few batch files from the root directory.

    Covered in This Repository

    * Summary Screen Icon
    * PokéDex Icon
    * Move Highlighting in the Move Selection Screen
    * Editing Type Effectiveness
    * Adding in the Pixie Plate
    * Arceus' Fairy Form
    * Setting Judgment's Type to Fairy
    * Changing Curse to be Ghost instead of Fairy

    What needs to be done
    * PokéDex Search for Fairy Type - overlay 18?
    * Roseli Berry

    Firstly, download this branch of this repository.
    Extract the folder from the zip file.
    Place your Heart Gold ROM in the folder as "base.nds."
    Open the command line in the folder.
    In the command line, type:
    Code:
    scripts\extract
    This will extract all the files in the Heart Gold ROM you provide to a folder, named filesys.
    Then, type:
    Code:
    scripts\decompress
    From there, manually extract a decompressed arm9.bin from your ROM using CrystalTile2. You can do this by opening up your ROM, pressing Ctrl + N, right clicking on "arm9.bin" in the pop up window, and selecting "Extract." Save it over the arm9.bin in the filesys folder that was just created. The file should be a bit over 1000 kb in size.
    Finally, in the command line, type:
    Code:
    scripts\makefairytype
    scripts\compile
    patched.nds should then pop up as the ROM that you input, but with the Fairy type, the Pixie Plate, the type effectiveness table, etc.
    These instructions are also in the README of the project.

    Spoilered here is the manual way of doing it if you want to keep track of the changes exactly. Or you can poke around the repository that you downloaded and see exactly what changes are happening there as well.
    Poking around would also significantly help in editing for a new type (people have used these instructions previously to implement a Light type, for example). The instructions to do all of this manually are thus archived in this spoiler.
    Spoiler:
    Article:
    H08tZxn.gif

    disclaimer: no cyndaquil were harmed in the implementation of this type

    This concludes my tutorial for inserting the Fairy type in Heart Gold.
    Hoping to look into the Roseli Berry more, but honestly I've just been sitting on a lot of this for a long time. Just finally got around to making the whole post and going through the tutorial a number of times.

    Included in the download is actually a .xdelta patch to be applied to an English Heart Gold ROM (CRC32 C180A0E9). Will not be applicable with in progress hacks, nor will it ever be. If you're looking into Gen 4 ROM Hacking, you definitely need to start familiarizing yourself with the filesystem used for these games. EDIT: This patch is actually a little bit dysfunctional, but importing the included binaries for overlay 18 and a017 in their respective places using CrystalTile2 fixes the errors made. I do not recommend using the patch, but it is here.
    I have precompiled binaries attached as well that just inserting those will have everything functional for the Fairy type for you (and with an in-progress game too!). Check everything out.

    Hope you are staying safe amidst the pandemic and that you have a nice night.
     
    Last edited:
    4
    Posts
    10
    Years
    • Seen Jun 11, 2023
    Great job, this tutorial it's very util, I didn't know how open the overlay9, thank you.
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • Update: If you used the precompiled binaries before today, then you will have a few bugs with items above the Pixie Plate index. This is because the a017 that I provided was not compiled properly. This has been fixed in the MEGA archive provided as well as in the xdelta that comes in that link. If you did not use the precompiled binaries, then you are completely fine.
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • Update: Added the GitHub repository, which just allows this entire process to be done in a few batch scripts & an extraction using CrystalTile2. I strongly recommend doing it that way, as it's also the only way that will primarily be updated from here on out, notably including the Roseli Berry when I can finally get to it.
     
    9
    Posts
    5
    Years
    • Seen Apr 28, 2024
    I apologize for having such a noob question but once I've confirmed that the Fairy typing is successfully in the ROM, how do I go about editing existing Pokemon's types to properly go with the change? (Example - Togepi going from Normal -> Fairy)
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • I apologize for having such a noob question but once I've confirmed that the Fairy typing is successfully in the ROM, how do I go about editing existing Pokemon's types to properly go with the change? (Example - Togepi going from Normal -> Fairy)

    so, there are a few ways to go about this! there's a tool called PokEditor! from there i suggest joining this discord server to get help with the tool, as it's not inherently obvious what to do. jump into the #pokeditor-support channel and i'm sure people are willing to help you out there!
    i also, however, have another repository to do this that has all the pokemon data and builds it from scratch. while it's primary focus is on incorporating all of the gen 5 mons, the mon data for all the existing pokémon is in it too:
    this branch specifically only has victini and snivy added, while this one has all of the gen 5 mons as well.
    from there, TYPE_MYSTERY would be the fairy type in that repository.
     
    9
    Posts
    5
    Years
    • Seen Apr 28, 2024
    Really appreciate the advice. If I go about using your tool to add the Gen 5 mons as well, you mention their data is also there, what about the Gen 5 moves? (and I guess Gen 6 because of all the key Fairy moves)
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • Really appreciate the advice. If I go about using your tool to add the Gen 5 mons as well, you mention their data is also there, what about the Gen 5 moves? (and I guess Gen 6 because of all the key Fairy moves)

    so, currently the gen 5 pokémon all have their gen 5 moves just blanked out.
    that is currently under development here. i'm working on getting the move animations in the game and will program all of the effects when the animations are done!

    you can look at this issue for an idea of progress on that front. currently it stands that we are 1/3 (61/184 where each animation and effect is 1 task) of the way through gen 5, it seems.
     
    1
    Posts
    3
    Years
    • Seen Feb 2, 2022
    I don't know if this is just a me issue, but when using the GitHub version and following those instructions on a 4787 version of HeartGold, the text for items was all messed up. I was able to fix this by downloading the Mega link and inserting the a027 from there into the patched.nds the GitHub one created. But just in case this wasn't known, I figured I should bring it up.

    I have no idea if this affects the Pixie Plate integration since I couldn't figure out how to get the Pixie Plate actually into my game to test on an Arceus. I'm pretty new rom hacking so I've been testing by just using a normal HeartGold save and I couldn't figure out how to give myself a the Pixie Plate from PkHax since that's been my main way of quickly testing saves lol.

    Edit 1/22/2022: I also discovered an issue where for some reason in the GitHub version, Dragon resists Ghost. I haven't noticed other weird type chart errors, but I also haven't been explicitly testing for them. I tried to fix this by looking into overlay9_18 but I couldn't find the type chart in there so I wasn't able to edit anything.

    Another quick edit: So I think the Dragon resisting Ghost is an error due to the copy-pasted type chart you provided. There's a type so instead of Dark resisting Ghost, Dragon resists Ghost. It says 071005, when it should say 071105.

    Edit 1/25/2022: I realized the type chart was in overlay9_12, so I just exported that file from CrystalTile2, searched for 071005 and changed it to 071105, and then reinserted it through Tinke. Seems to be working fine now.
     
    Last edited:
    2
    Posts
    2
    Years
    • Seen Mar 9, 2022
    C:\Games\Pokemon\HGSS project folder\hgss-filesys-example-fairy-type\text>thenewpoketext 0<script.txt
    the NEW Poketext
    (C) 2008/2009 loadingNOW
    Romname:>Parsing Pokexml Version 1.0
    Traceback (most recent call last):
    File "thenewpoketext.py", line 140, in <module>
    File "thenewpoketext.py", line 80, in Rewrite
    File "thenewpoketext.py", line 12, in ReadMsgNarc
    IOError: [Errno 2] No such file or directory: 'tmp_base/header.bin'

    C:\Games\Pokemon\HGSS project folder\hgss-filesys-example-fairy-type\text>cd ..\

    C:\Games\Pokemon\HGSS project folder\hgss-filesys-example-fairy-type>copy "text\tmp_base\a027.narc" "filesys\data\a\0\2\7"
    The system cannot find the file specified.

    C:\Games\Pokemon\HGSS project folder\hgss-filesys-example-fairy-type>rmdir /q /s text\tmp_base

    C:\Games\Pokemon\HGSS project folder\hgss-filesys-example-fairy-type>del /f text\base.nds
    PS C:\Games\Pokemon\HGSS project folder\hgss-filesys-example-fairy-type>

    Errors I get with the tool. Seems to be a problem with thenewpoketext. Do I need python?
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • Spoiler:
    my bad for not seeing this, yeah looks like this has been a bug with my thing the whole time! fixed this in this commit



    Spoiler:
    i switched from thenewpoketext to msgenc in mid-november, try redownloading the code from the repo and rerunning the scripts?
     
    2
    Posts
    2
    Years
    • Seen Apr 21, 2022
    I apologize if this has been addressed/ my issue, this is my first foray into editing a ROM but I'm running into a dll error when I go to extract specifically "libstde++-6.dll"

    I ran into this as well for your Gen 5 mons program. So apologies if this something I'm doing incorrectly.

    Much thanks!
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • I apologize if this has been addressed/ my issue, this is my first foray into editing a ROM but I'm running into a dll error when I go to extract specifically "libstde++-6.dll"

    I ran into this as well for your Gen 5 mons program. So apologies if this something I'm doing incorrectly.

    Much thanks!

    howdy! check out this link to download it, and throw it into your tools\ folder. let me know how that goes!
     
    10
    Posts
    4
    Years
  • I keep getting the same error whenever I try to run it. I am unable to extract anything from my heartgold rom (appropriately named "base.nds"), and although the folder "filesys" is made, nothing is in it. What's the problem?
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • I keep getting the same error whenever I try to run it. I am unable to extract anything from my heartgold rom (appropriately named "base.nds"), and although the folder "filesys" is made, nothing is in it. What's the problem?

    what's the error that pops up/what does it say in the cmd window?
     
    Back
    Top