• 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 Trading Card Game 2 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.

[Other] [Pokeemerald] Adding ONLY Hidden Abilities from Pokemon Expansion

Kobazco

A Too Many Productions Lead
  • 52
    Posts
    13
    Years
    • she/they
    • Seen Apr 29, 2025
    As the title says, the project I'm currently working on doesn't need the Pokemon expansion, but I want to be able to use hidden abilities. Would someone be able to point me in the right directions either for what files in the Pokemon expansion add in hidden ability support, or a separate method of adding them in? For Pokeemerald btw.

    I have the Battle engine upgrade v2 and item expansion in this decomp project if that information helps in anyway.
     
    As the title says, the project I'm currently working on doesn't need the Pokemon expansion, but I want to be able to use hidden abilities. Would someone be able to point me in the right directions either for what files in the Pokemon expansion add in hidden ability support, or a separate method of adding them in? For Pokeemerald btw.

    I have the Battle engine upgrade v2 and item expansion in this decomp project if that information helps in anyway.
    This is about all you need.
    https://github.com/rh-hideout/pokeemerald-expansion/pull/1464/files
     

    Unfortunately, it seems like I need additional assistance. It seems like I've managed to get it all working (hidden abilities are appearing in my dev menu implying they are properly being assigned), but attempts to use SetMonData to alter the ability to be the Hidden one don't work and default to Ability 00 for some reason.

    As an example, this is the command I have been trying to use: SetMonData(&gPlayerParty[tMonId], MON_DATA_ABILITY_NUM, &tAbilityNum); with tAbilityNum being set to 2
     
    Unfortunately, it seems like I need additional assistance. It seems like I've managed to get it all working (hidden abilities are appearing in my dev menu implying they are properly being assigned), but attempts to use SetMonData to alter the ability to be the Hidden one don't work and default to Ability 00 for some reason.

    As an example, this is the command I have been trying to use: SetMonData(&gPlayerParty[tMonId], MON_DATA_ABILITY_NUM, &tAbilityNum); with tAbilityNum being set to 2
    For your information, that's not a command, it's a function call. You're calling the function SetMonData and passing specific parameters through it.

    Anyway, where exactly did you do this?
    Ideally, hidden abilities should be set in the function where all the basic data of a Pokémon is created, CreateBoxMon.

    As you can see right here, in CreateBoxMon a Pokémon is given its 1st or 2nd ability based on their personality, if they do have a 2nd ability at all.
    There's many ways you can make hidden abilities (that is 3rd abilities) usable and it solely depends on your own tastes.

    Here's a quick example. I slightly modified the if statement I linked above.
    This would make it so there's a 50% chance that a Pokémon is generated with its hidden ability if they have one:
    Code:
        if (gBaseStats[species].abilities[2] && (Random() % 100) <= 50)
        {
            value = 2;
            SetBoxMonData(boxMon, MON_DATA_ABILITY_NUM, &value);
        }
        else if (gBaseStats[species].abilities[1])
        {
            value = personality & 1;
            SetBoxMonData(boxMon, MON_DATA_ABILITY_NUM, &value);
        }
    EDIT (05/05/2023): It's actually 51% because Random() starts to count from 0 and I used <= instead of <, lel.
     
    Last edited:
    For your information, that's not a command, it's a function call. You're calling the function SetMonData and passing specific parameters through it.

    Anyway, where exactly did you do this?
    Ideally, hidden abilities should be set in the function where all the basic data of a Pokémon is created, CreateBoxMon.

    As you can see right here, in CreateBoxMon a Pokémon is given its 1st or 2nd ability based on their personality, if they do have a 2nd ability at all.
    There's many ways you can make hidden abilities (that is 3rd abilities) usable and it solely depends on your own tastes.

    Here's a quick example. I slightly modified the if statement I linked above.
    This would make it so there's a 50% chance that a Pokémon is generated with its hidden ability if they have one:
    Code:
        if (gBaseStats[species].abilities[2] && (Random() % 100) <= 50)
        {
            value = 2;
            SetBoxMonData(boxMon, MON_DATA_ABILITY_NUM, &value);
        }
        else if (gBaseStats[species].abilities[1])
        {
            value = personality & 1;
            SetBoxMonData(boxMon, MON_DATA_ABILITY_NUM, &value);
        }

    The function SetMonData is being used in the debug menu I got from here: https://github.com/TheXaman/pokeemerald/tree/tx_debug_system

    It just feels a little odd, since it recognizes it as ability 02 but still gives ability 00 after the mon is given
    Spoiler:


    Code:
    //Ability
        if (abilityNum == 0xFF || GetAbilityBySpecies(species, abilityNum) == 0)
        {
            do {
                abilityNum = Random() % 3;  // includes hidden abilities
            } while (GetAbilityBySpecies(species, abilityNum) == 0);
        }
    
        SetMonData(&mon, MON_DATA_ABILITY_NUM, &abilityNum);

    So can I just not use SetMonData to set the hidden ability? I was going to try and make an item to change the pokemon's ability to (hidden) but the method I was going to try was also using SetMonData
     
    For your information, that's not a command, it's a function call. You're calling the function SetMonData and passing specific parameters through it.

    Here's a quick example. I slightly modified the if statement I linked above.
    This would make it so there's a 50% chance that a Pokémon is generated with its hidden ability if they have one:
    Code:
        if (gBaseStats[species].abilities[2] && (Random() % 100) <= 50)
        {
            value = 2;
            SetBoxMonData(boxMon, MON_DATA_ABILITY_NUM, &value);
        }
        else if (gBaseStats[species].abilities[1])
        {
            value = personality & 1;
            SetBoxMonData(boxMon, MON_DATA_ABILITY_NUM, &value);
        }

    Thanks for this, I got it working in my own version.

    Is there a way to give a visual effect of some kind when a Pokemon with a Hidden Ability appears?
     
    Back
    Top