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

[pokefirered] Problem with ability popups

  • 1
    Posts
    1
    Years
    • Seen Jun 3, 2024
    [PokeCommunity.com] [pokefirered] Problem with ability popups[PokeCommunity.com] [pokefirered] Problem with ability popups
    So I added the ability popup feature in my fire red decomp. It works, the ability effect also procs. The problem is that it ALWAYS shows on player's side with their pokémon's name on it. I'm guessing it's some sort of problem with how the battler id is passed to the function, but I can't figure out how to solve it. Any ideas?

    EDIT: I've also tested with self-buffing abilities like speed boost and it's the same.
     
    View attachment 157602View attachment 157603
    So I added the ability popup feature in my fire red decomp. It works, the ability effect also procs. The problem is that it ALWAYS shows on player's side with their pokémon's name on it. I'm guessing it's some sort of problem with how the battler id is passed to the function, but I can't figure out how to solve it. Any ideas?

    EDIT: I've also tested with self-buffing abilities like speed boost and it's the same.
    Check Intimidate's text string in src/battle_message.c and fill whatever buffer it uses appropriately.

    Keep in mind it's gonna be hard for anyone to give you more specific or precise instructions without being able to look at the code of this ability popup of yours.
     
    So I haven't figured out the fix yet, but I can say that the problem lies in this section:

    src/battle_script_command.c

    C#:
        case VARIOUS_ABILITY_POPUP:
            CreateAbilityPopUp(gActiveBattler, gBattleMons[gActiveBattler].ability, (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) != 0);
            break;

    If you change the gActiveBattler in both points here to gBattlerTarget then it will display the correct ability for the wild or opposing pokémon depending on the ability type, for example:

    I added Cursed Body, and when that triggers with the change I mentioned above it shows for the correct pokémon:

    [PokeCommunity.com] [pokefirered] Problem with ability popups [PokeCommunity.com] [pokefirered] Problem with ability popups

    However an ability like Intimidate still shows for the wrong pokémon:

    [PokeCommunity.com] [pokefirered] Problem with ability popups

    I'll keep looking into it, but my hypothesis is how the ability is triggered passes in the pokémon data in different ways.

    If I figure it out I'll reply back but I thought I'd share my findings to see if this helps.
     
    So I haven't figured out the fix yet, but I can say that the problem lies in this section:

    src/battle_script_command.c

    C#:
        case VARIOUS_ABILITY_POPUP:
            CreateAbilityPopUp(gActiveBattler, gBattleMons[gActiveBattler].ability, (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) != 0);
            break;

    If you change the gActiveBattler in both points here to gBattlerTarget then it will display the correct ability for the wild or opposing pokémon depending on the ability type, for example:

    I added Cursed Body, and when that triggers with the change I mentioned above it shows for the correct pokémon:

    View attachment 166189 View attachment 166191

    However an ability like Intimidate still shows for the wrong pokémon:

    View attachment 166190

    I'll keep looking into it, but my hypothesis is how the ability is triggered passes in the pokémon data in different ways.

    If I figure it out I'll reply back but I thought I'd share my findings to see if this helps.
    You can probably look into CFRU or pokeemerald expansion and correct it by comparing
     
    Back
    Top