• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • 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.

Complete FireRed Upgrade: Adding New Types

  • 15
    Posts
    4
    Years
    Adding new types isn't easy. You have to look up the type chart image, hex edit some offsets and update pointers, as well as edit the actual type effectiveness chart itself. Fortunately, the CFRU exists, and thanks to Lord Skeli and his team, we can add new types easily with way less effort than before, and with equal effectiveness, if not more. Hence, I present to you a short tutorial on how to actually go about adding new types using the CFRU. Even though most tutorials cover only one instance, I'll add 2 new types to showcase the flexibility of this amazing build system.

    Defining The Types

    Head to include/pokemon.h and include/constants/pokemon.h . In both files, add your new types to the bottom and update the value of NUMBER_OF_MON_TYPES :
    C:
    #define TYPE_BLANK    0x14
    #define TYPE_FAIRY    0x17
    
    // Custom Types
    #define TYPE_SOUND    0x18
    #define TYPE_LIGHT    0x19
    
    #define NUMBER_OF_MON_TYPES (TYPE_LIGHT + 1)

    You could also add these defines in asm_defines.s and xse_defines.s if you want to script using the CFRU:
    Code:
    .equ TYPE_FAIRY, 0x17
    
    @ Custom Types
    .equ TYPE_SOUND, 0x18
    .equ TYPE_LIGHT, 0x19

    Head to strings/type_names.string and add your own entries like so:
    Code:
    #org @FAIRY_TYPE_ALIGNMENT_5
    -
    
    #org @NAME_FAIRY
    Fairy
    
    #org @NAME_SOUND
    Sound
    
    #org @NAME_LIGHT
    Light


    Editing The Type Effectiveness Chart

    Crack open src/Tables/type_tables.h . Here, you'll see the existing type chart, and this is where you'll edit your new type's effectiveness. I believe the syntax is self-explanatory, but let me explain it for further clarity. TYPE_MUL_SUPER_EFFECTIVE means your type deals 2x damage to that type. TYPE_MUL_NOT_EFFECTIVE means your type deals 0.5x damage to that type. Lastly, you have TYPE_MUL_NO_EFFECT which means your type deals no damage against that type. For instance, here are my type charts:
    C:
        [TYPE_FAIRY]=
        {
            [TYPE_POISON] = TYPE_MUL_NOT_EFFECTIVE,
            [TYPE_STEEL] = TYPE_MUL_NOT_EFFECTIVE,
            [TYPE_FIRE] = TYPE_MUL_NOT_EFFECTIVE,
            [TYPE_FIGHTING] = TYPE_MUL_SUPER_EFFECTIVE,
            [TYPE_DRAGON] = TYPE_MUL_SUPER_EFFECTIVE,
            [TYPE_DARK] = TYPE_MUL_SUPER_EFFECTIVE,
        },
    
        // Custom Types
        [TYPE_SOUND] =
        {
            [TYPE_ROCK] = TYPE_MUL_NOT_EFFECTIVE, // Rocks block/disrupt sound waves
            [TYPE_ELECTRIC] = TYPE_MUL_NOT_EFFECTIVE, // Electric waves intervene sound waves and can make it change direction
            [TYPE_WATER] = TYPE_MUL_SUPER_EFFECTIVE, // Water is a good propagation medium for sound
            [TYPE_PSYCHIC] = TYPE_MUL_SUPER_EFFECTIVE, // Cacophony disrupts the mind
            [TYPE_FLYING] = TYPE_MUL_SUPER_EFFECTIVE, // Birds can be disrupted by launching sound waves into the air
            [TYPE_STEEL] = TYPE_MUL_SUPER_EFFECTIVE, // Sound travels through metals the fastest
        },
        [TYPE_LIGHT] =
        {
            [TYPE_FIRE] = TYPE_MUL_NOT_EFFECTIVE, // Fire will just absorb light
            [TYPE_LIGHT] = TYPE_MUL_NOT_EFFECTIVE, // Light blocks light
            [TYPE_BUG] = TYPE_MUL_NOT_EFFECTIVE, // Insects swarm around light sources
            [TYPE_DARK] = TYPE_MUL_SUPER_EFFECTIVE, // Light illuminates the darkness
            [TYPE_GHOST] = TYPE_MUL_SUPER_EFFECTIVE, // Spirits become visible in light
        },

    Note that these are only for OFFENSE. To make your type weak against/resist another type, you must edit THAT type's effectiveness table. For example, I want Bug to be strong against Light. Then I'll look up Bug and edit it like so:
    C:
    [TYPE_BUG]=
        {
            [TYPE_FIRE] = TYPE_MUL_NOT_EFFECTIVE,
            [TYPE_GRASS] = TYPE_MUL_SUPER_EFFECTIVE,
            [TYPE_FIGHTING] = TYPE_MUL_NOT_EFFECTIVE,
            [TYPE_POISON] = TYPE_MUL_NOT_EFFECTIVE,
            [TYPE_FLYING] = TYPE_MUL_NOT_EFFECTIVE,
            [TYPE_SOUND] = TYPE_MUL_NOT_EFFECTIVE,
            [TYPE_PSYCHIC] = TYPE_MUL_SUPER_EFFECTIVE,
            [TYPE_GHOST] = TYPE_MUL_NOT_EFFECTIVE,
            [TYPE_DARK] = TYPE_MUL_SUPER_EFFECTIVE,
            [TYPE_STEEL] = TYPE_MUL_NOT_EFFECTIVE,
            [TYPE_FAIRY] = TYPE_MUL_NOT_EFFECTIVE,
            [TYPE_LIGHT] = TYPE_MUL_SUPER_EFFECTIVE, // Bug now deals super effective damage to Light
        },


    Editing The Type Icon Image

    Head to graphics/Other/Type_Icons/Type_Icons.bmp. This is where you'll add your new type's image. The dimensions of each type icon is 32x12. Add your type(s) next to the Fairy-type for easier alignment. Reminder that this is a .bmp image, and so you'll have to be real careful of the palettes and indexing. If for some reason, you're adding more than 3 types, you'll need to add your next type(s) to the next row, and hence extend the vertical dimensions by 16 pixels. Here is how mine looks like:

    [PokeCommunity.com] Complete FireRed Upgrade: Adding New Types

    Crack open assembly/data/type_tables.s. Here, you define the offsets for the new type you entered in the image. For each adjacent type, add 0x4 to the offset. If you're adding one in the next row, add 0x14. For example, Dragon and Dark have a difference of 0x14, meanwhile Dark and Steel, 0x4:
    Code:
    typeicon 32, 12, 0x100      @ Fairy icon
    typeicon 32, 12, 0x104      @ Sound icon
    typeicon 32, 12, 0x108      @ Light icon

    Final Touches

    We're technically done with inserting our own types! What's left now is assigning them to moves, Pokemon, etc. If you've read through all this, and even better, inserted your own type, then congrats!

    [PokeCommunity.com] Complete FireRed Upgrade: Adding New Types

    [PokeCommunity.com] Complete FireRed Upgrade: Adding New Types
     
    Last edited:
    Back
    Top