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

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

  • 2
    Posts
    182
    Days
    • Seen Dec 10, 2023
    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 🙏
     
  • 124
    Posts
    8
    Years
    • Seen Apr 5, 2024
    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.
     
  • 2
    Posts
    182
    Days
    • Seen Dec 10, 2023
    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:
    [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