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

Player sprite flipped? What causes that

39
Posts
4
Years
    • Seen Apr 15, 2024
    I'm talking about in emerald battle frontier - battle tower multi battles

    Before the fight starts, it shows your player character and the partner you chose standing next to each other,
    but the player character front sprite is horizontal flipped for some reason. Anyone know what line of code causes that?
     
    37
    Posts
    13
    Years
    • Seen May 8, 2024
    I'm assuming you're using a custom trainer sprite that's after all of the vanilla ones?

    EDIT: there is a chance I've misread. If it's not during the send out anim, that's normal behaviour as it's to indicate they're facing the opponent
     
    Last edited:
    39
    Posts
    4
    Years
    • Seen Apr 15, 2024
    Right, It's not during the send out animation. Battle tower Multi-battles display your front sprite and also your partner of choice's where send out animations would otherwise be.

    I have a reason to keep mine the same orientation and not flip it. Do you have any suggestions for me?
     
    7
    Posts
    2
    Years
  • In the file battle_controller_player.c in the function PlayerHandleDrawTrainerPic, this block is what sets the player's sprite for Multi Battles when your partner isn't Steven:
    C:
    // Use front pic table for any tag battles unless your partner is Steven.
        if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && gPartnerTrainerId != TRAINER_STEVEN_PARTNER)
        {
            trainerPicId = PlayerGenderToFrontTrainerPicId(gSaveBlock2Ptr->playerGender);
            DecompressTrainerFrontPic(trainerPicId, gActiveBattler);
            SetMultiuseSpriteTemplateToTrainerFront(trainerPicId, GetBattlerPosition(gActiveBattler));
            gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSpriteSubpriority(gActiveBattler));
    
            gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag);
            gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = DISPLAY_WIDTH;
            gSprites[gBattlerSpriteIds[gActiveBattler]].y2 = 48;
            gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = -2;
            gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn;
            gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineMode = ST_OAM_AFFINE_OFF;
            gSprites[gBattlerSpriteIds[gActiveBattler]].hFlip = 1;
        }
    Basically you need to remove or comment out the line with hFlip, which is what horizontally flips the sprite.
    Here is a before and after:
    Player sprite flipped? What causes thatPlayer sprite flipped? What causes that
     
    Back
    Top