Advertiser Content

Pokeemerald Inserting Custom Sprites

Started by Avara December 15th, 2018 6:05 PM
  • 1937 views
  • 1 replies

Avara

Female
Izantine
Seen 5 Hours Ago
Posted 5 Hours Ago
1,099 posts
7.9 Years
Inserting Custom Sprites in Pokéemerald
-----------------------------------------------------------------------------------------------------------------------------------------------------
I'm going to assume you already have Pokéemerald set up. If you're unsure of how to do that, check out ProjectRevoTPP's tutorial. The sprite editing process is the same for Pokéruby if you'd prefer to use that but why would you.
A tool named GraphicsGale makes editing images and palettes for GBA ridiculously easy, you can get yourself a copy here.
You'll also want Notepad++ for editing files (optional).
-----------------------------------------------------------------------------------------------------------------------------------------------------
Replacing Sprites

This method can be used to replace a wide variety of sprites with your own - such as the bags, item icons, etc. Any 16 colour sprite. The method is the same for Pokémon, the only difference there is that you need an extra palette for the shiny version, so I didn't think Pokémon sprites needed their own guide. Although if there are any requests for that, I'll make an addition to this tutorial. For example purposes we'll refer to trainer sprites.

To get started, grab an indexed sprite you want to insert (should be in .png format) and rename the file to give it the same name as the sprite you'd like to replace. For tutorial purposes, I'm using my own hiker trainer sprite to update the standard one, so I'll name it “hiker_front_pic”.
I won't go through the indexing process here since I've covered that in another thread already. The trainer sprites are located in “pokeemerald\graphics\trainers\front_pics”. Open your sprite in GraphicsGale.


Click the little arrow outlined in red above and hit “Save Palette”. Navigate to “pokeemerald\graphics\trainers\palettes”. Save your new palette over the top of the one you want to replace. For me, that's “hiker.pal”. Now go back to the “front_pics” folder. Delete the original sprite (“hiker_front_pic.png” for tutorial reference) and replace it with your own. Compile, test and... yeah, you're done!
If that didn't work for you for whatever reason, click the spoiler and try this way... longer winded but foolproof.
Spoiler:
After you've replaced the .pal file, open the sprite you want to replace - “hiker_front_pic.png” for me. Click that little arrow again and hit "Load Palette". Load your new palette.


You'll get a screen that looks like the above, comparing your new palette with the current one. Click "All" and the default image will now include the new colours. All that's left to do now is Ctrl+A to "Select All" on your new sprite, then "Ctrl+V" to paste it on top of the default one. Save, compile and test.



-----------------------------------------------------------------------------------------------------------------------------------------------------
Inserting New Trainer Backsprites

The method for trainer backsprites is pretty much the same. There's just an extra little thing to be aware of: player backsprites actually use the same palette as the player front sprites. If you’re happy for your back and front hero/heroine sprites to share a palette, all you have to do is overwrite “brendan.pal” or “may.pal” with your new palette. After you've done that, overwrite the old sprite(e.g. “brendan_back_pic”) with your new one, compile, test and you're done!

But I don’t want my trainer backsprite to share a palette with its front sprite! Fear not, it’s really easy to de-link them and it’ll only take you a few minutes; it’s just a matter of editing three files. Read on or if you're viewing this as a single post click here.

Avara

Female
Izantine
Seen 5 Hours Ago
Posted 5 Hours Ago
1,099 posts
7.9 Years
De-linking Palette Sharing Between Player Back & Front Sprites

OK, so firstly you’ll want to save your new backsprite pals from the indexed image to the “palettes” folder in “graphics\trainers”. For easiness, I’ve named mine “brendan_back” and “may_back” to go with the sprite names. The next thing we have to do is define the new labels we'll use for our separate backsprite palettes. Navigate to “pokeemerald\include”. Open "graphics.h" in Notepad++ and add the following two lines:
extern const u32 gTrainerBackPicPalette_Brendan[];
extern const u32 gTrainerBackPicPalette_May[];


I’ve //commented the lines in the picture for the sake of this guide so you can see where I’ve put them.
Now go to “pokeemerald\src\data\graphics\trainers.h”. Add the following two lines:
const u32 gTrainerBackPicPalette_Brendan[] = INCBIN_U32("graphics/trainers/palettes/brendan_back.gbapal.lz");
const u32 gTrainerBackPicPalette_May[] = INCBIN_U32("graphics\trainers\palettes\may_back.gbapal.lz");


Finally, navigate to “pokeemerald\src\data\trainer_graphics\back_pic_tables.h” and add your new palette references here. For example, change this:
const struct CompressedSpritePalette gTrainerBackPicPaletteTable[] = 
{
    gTrainerPalette_Brendan, 0,
    gTrainerPalette_May, 1, 
To this:
const struct CompressedSpritePalette gTrainerBackPicPaletteTable[] = 
{
    gTrainerBackPicPalette_Brendan, 0,
    gTrainerBackPicPalette_May, 1, 
Like so:



Compile, test, and there you have it! You should now have separate palettes for your player back and front sprites, so you don't have to worry about colours between the two matching.
Advertiser Content