• 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!
  • It's time to vote for your favorite Pokémon Battle Revolution protagonist in our new weekly protagonist poll! Click here to cast your vote and let us know which PBR protagonist you like most.
  • 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.

[pokeemerald][Help] Trainer Sprite Stays Onscreen During Battles

  • 4
    Posts
    1
    Years
    • Seen Apr 10, 2025
    Hi.
    I'm new to everything. To hacking, to this forum, and to programming in general. I wanted to make a simple change regarding battles to both Single Trainer Battle and Random Encounter where Brendan/May is onscreen. Just standing there, looking pretty.

    I looked around the decomp and somehow managed to make the sprite position stand where I wanted them to in battle_controller_player. But the problem is:
    1. They're below the Pokemon layer.
    2. They disappear after the mon is out.
    3. And when I comment out the freetrainerspriteafterslide lines, the game froze.

    I have also looked around the forum to find a similar question/request about this matter and found nothing (at least to the extend of my understanding) close to the solution.

    Can someone give some pointers to where should I look for? Is there a tutorial/thread I needed to read? What makes the game froze?
    Spoiler: extremely shameless

    Thank you in advance 🙏
     
    Hi.
    I'm new to everything. To hacking, to this forum, and to programming in general. I wanted to make a simple change regarding battles to both Single Trainer Battle and Random Encounter where Brendan/May is onscreen. Just standing there, looking pretty.

    I looked around the decomp and somehow managed to make the sprite position stand where I wanted them to in battle_controller_player. But the problem is:
    1. They're below the Pokemon layer.
    2. They disappear after the mon is out.
    3. And when I comment out the freetrainerspriteafterslide lines, the game froze.

    I have also looked around the forum to find a similar question/request about this matter and found nothing (at least to the extend of my understanding) close to the solution.

    Can someone give some pointers to where should I look for? Is there a tutorial/thread I needed to read? What makes the game froze?
    Spoiler: extremely shameless

    Thank you in advance 🙏
    NOT REALLY sure what you are trying to make, maybe i can help if you describe with more detail what u are trying to do, and how you like it to look.
     
    NOT REALLY sure what you are trying to make, maybe i can help if you describe with more detail what u are trying to do, and how you like it to look.
    This is what I wanted them to do:
    [PokeCommunity.com] [pokeemerald][Help] Trainer Sprite Stays Onscreen During Battles
    Of course, without freezing the game right after Mudkip wiggles, and make the trainer behind the Mudkip. When I said freeze, the music is still going btw.

    The change I made is on this line:
    Code:
    static void PlayerHandleIntroTrainerBallThrow(void)
    {
        u8 paletteNum;
        u8 taskId;
    
        SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
    
        gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 50;
        gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 30;
        gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].y;
        gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation;
        gSprites[gBattlerSpriteIds[gActiveBattler]].sBattlerId = gActiveBattler;
    (data[2] from -40 to 30)

    And these lines:
    Code:
    // Free player trainer sprite
        //FreeSpriteOamMatrix(sprite);
        //FreeSpritePaletteByTag(GetSpritePaletteTagByPaletteNum(sprite->oam.paletteNum));
        //DestroySprite(sprite);
    (I commented those lines out xD)

    Both of them are in battle_controller_player.c

    I'm aware that I'm interrupting a sequence by not destroying trainer sprite/stopping them midscreen. But that sequence whereabouts is what driving me insane.

    Also, sorry for the wrong forum post.
     
    Last edited:
    Back
    Top