• 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] Palette Command for Sprite Animations, Dual types animation in Summary Screen, Show dual types in battle as well

3
Posts
4
Years
  • [pokeemerald] Add a Palette Command for Sprite Animations, Use it to show dual types in Summary Screen

    Extra: Show dual types in battle as well


    A Palette command can be useful so we can show sprites with different palette indexes in the same AnimCmd. We can't do this:

    Spoiler:
    Because the Pokémon Type sprites use 3 palettes (13, 14 and 15), if we do this we either get a glitching TYPE_FLYING or the game crashes. The way to fix this is to make sure they share the same palette index, by dynamically changing the palette before we switch the Sprite, which is what we gonna do.

    The only move that has a dual type in the series is Flying Press, but in-game we can only see its Fighting Type, we could take advantage of AnimCmd so we can show both types alternatively whenever the move is on-screen. This doesn't load additional palettes since all Type palettes are loaded in memory even if they aren't used. If you want to add more dual type moves to your rom, showing both types is a must and this is just a way to do so in Emerald that I figured out.

    This is how it looks:
    Spoiler:


    NOTE: Vanilla Emerald does not have any dual type moves, implementing them is outside the scope of the tutorial. I will have a small note at the end to show how you can do this with Flying Press for the pokeemerald expansion but nothing more. I assume a new u8 type2 variable for struct BattleMove during the tutorial and no flags or effects, but you may be using .effect = EFFECT_TWO_TYPED_MOVE and .argument just like Flying Press in the expansion, or whatever other method you might have devised.

    Here's a git branch, you can pull from it easily to add this to your code. Things to note when adding this:
    • Check the changes in include/pokemon.h since you might not be using a .type2 variable.
    • In src/battle_controller_player.c you probably need to edit bool8 SelectedMoveHasDoubleType(struct ChooseMoveStruct *moveInfo) for your project.
    • As an example, Torchic learns Solar Beam and Muddy Water at level 1. Remove these. You might want to keep those move types in src/data/battle_moves.h or edit them out (Grass/Fire and Water/Ground respectively, using .type2)
    • In src/pokemon_summary_screen.c at void SetMoveTypeIcons(void), there's two checks for Grass/Fire and Water/Ground. You might need to edit those for your project.

    We will be changing 8 files, I'll be referencing them by their filename alone.
    Code:
    gflib/sprite.c
    gflib/sprite.h
    include/battle_controllers.h
    include/pokemon.h
    src/battle_controller_player.c
    src/pokemon_summary_screen.c
    src/data/battle_moves.h

    First thing, the easy one. Show dual type moves in battle
    Spoiler:


    Add a Palette Command for Sprite Animations
    Spoiler:


    Show dual types in Summary Screen
    Spoiler:


    That's it. Now, I recommend to create a generalized check for double types so you dont have to manually add them into void SetMoveTypeIcons(void) every time you create a new one.
    There's other ways to show double types in the summary screen, but those probably need to adjust the space in the summary screen (or create a new one entirely) so you can show two types at the same time in one move slot. This method is useful if you don't want to do any of that. Feel free to give feedback if you find any bugs whatsoever, or just get the code from the repo as that works for both pokeemerald and the expansion. Now, talking about that...

    Thank you for checkin' out the tutorial.

    Flying Press in the expansion.
    Spoiler:
     
    Last edited:
    Back
    Top