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

[Graphics] [pokeemerald] Edit sprite that doesn't have an associated .pal file without messing up the palette

13
Posts
308
Days
    • Seen Mar 29, 2024
    I have an issue modifying the colors of the sprites that do not have a .pal file associated to them (for exemple sprites in ./pokeemerald/graphics/object_events/pics/people/). If I understood well, I don't need any .pal file for them, and the .png files just generates a .4bpp file when compiling. But when I modify the color palette with GraphicsGale and when I compile (even after make clean), the color palette is still the same as before in the game. What's happening here ? How can I modify the color palette for those sprites ?

    This thread is actually a follow up of the thread "Editing .gbapal files":
    https://www.pokecommunity.com/showthread.php?p=10672152#post10672152
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • I have an issue modifying the colors of the sprites that do not have a .pal file associated to them (for exemple sprites in ./pokeemerald/graphics/object_events/pics/people/). If I understood well, I don't need any .pal file for them, and the .png files just generates a .4bpp file when compiling. But when I modify the color palette with GraphicsGale and when I compile (even after make clean), the color palette is still the same as before in the game. What's happening here ? How can I modify the color palette for those sprites ?

    This thread is actually a follow up of the thread "Editing .gbapal files":
    https://www.pokecommunity.com/showthread.php?p=10672152#post10672152
    It's hard to give you concrete answers when you haven't shown the sprite you're using or the code associated to it, but let me give you a valuable piece of info.
    When it comes to event object sprites you have to be careful about the palette slot that you assign to them in src/data/object_events/object_event_graphics_info.h.
    You can't have 2 sprites that use different palette slots loaded at the same time InGame, because only one palette or the other will be loaded, and the event object sprite whose palette isn't loaded will look bad.

    People normally merge a dynamic overworld palettes system in their projects to avoid dealing with this.
    There's a few different feature branches to choose from.
    There's ExpoSeed's, there's Grunt Lucas' and there's also Merp's (which comes with a bunch of other features, check its README for more info.)

    What this system does is to dynamically load an event object sprite's palette in the first palette slot available to use, until that sprite is no longer on screen. Effectively, this means that as long as you don't try to have 17 different event object palettes loaded in the overworld all at once and as long as you have the code related to your event object sprite set up correrctly, you won't have to deal with event object sprite palette related issues much.
     
    448
    Posts
    6
    Years
    • Seen today
    I have an issue modifying the colors of the sprites that do not have a .pal file associated to them (for exemple sprites in ./pokeemerald/graphics/object_events/pics/people/). If I understood well, I don't need any .pal file for them, and the .png files just generates a .4bpp file when compiling. But when I modify the color palette with GraphicsGale and when I compile (even after make clean), the color palette is still the same as before in the game. What's happening here ? How can I modify the color palette for those sprites ?

    This thread is actually a follow up of the thread "Editing .gbapal files":
    https://www.pokecommunity.com/showthread.php?p=10672152#post10672152

    You have not understood well. The previous thread was about locating the source of the palette data given that you know where the gbapal file is.
    If you're just looking at a random png file, its palette can come from a palette file with a completely different name, and the lack of a gbapal file should tell you that it's not generated from the png.

    The palettes for object events are found in graphics/object_events/palettes. The src/data/object_events/object_event_graphics_info.h file assigns those palettes to different object events.

    There's a tutorial on the wiki that covers how you can add an object event with a new palette, and it also explains the limitations Lunos is talking about.
     
    13
    Posts
    308
    Days
    • Seen Mar 29, 2024
    Ooooh ok, thanks for the link for the tutorial, I completely missed it, that's exactly what I needed. And thanks also for the tips, I might have missed a thing or two but now I think that I have a better understanding of what's going on. There is actually a good and short explanation on the palette slots on "include/event_object_movement.h", which help me know what to do:

    // Palette slots for overworld NPCs.
    // The same standard set of palettes for overworld objects are normally always loaded at the same
    // time while walking around the overworld. The only exceptions are the palettes for the player and
    // the "special" NPC, which can be swapped out. This also means that e.g. two "special" NPCs
    // with competing palettes cannot be properly loaded at the same time.
    enum {
    PALSLOT_PLAYER,
    PALSLOT_PLAYER_REFLECTION,
    PALSLOT_NPC_1,
    PALSLOT_NPC_2,
    PALSLOT_NPC_3,
    PALSLOT_NPC_4,
    PALSLOT_NPC_1_REFLECTION,
    PALSLOT_NPC_2_REFLECTION,
    PALSLOT_NPC_3_REFLECTION,
    PALSLOT_NPC_4_REFLECTION,
    PALSLOT_NPC_SPECIAL,
    PALSLOT_NPC_SPECIAL_REFLECTION,
    OBJ_PALSLOT_COUNT
    // the remaining sprite palette slots (12-15) are used by field effects, the interface, etc.
    };

    So basically, if I don't want to dive too deeply into the palette issues, I just have to use colors that are either in PALSLOT_NPC_1, 2, 3, or 4 for my overworld new characters. This way I'm sure that I don't have problems with the special NPC palette if I load multiple "special characters" at the same time.
     
    Back
    Top