Skip to content

How to add a new trainer class

LucaBGt edited this page Mar 17, 2021 · 8 revisions

Content

Quick Summary

If you've done this before and just need a quick lookup, here's what files you need:

  1. GFX into graphics/trainers

The Graphics

We will start with a graphic that we want to use for our new trainer class. Unlike with adding Pokémon, the trainer sprites aren't sorted in individual folders, but rather in one folder: graphics/trainers/front_pics:

2. Register the sprites

Sadly, just putting the image files into the graphics folder is not enough. To use the sprites we have to register them, which is kind of tedious. First, create constants for the file paths. Edit include/graphics.h:

 extern const u8 gMonFootprint_Chimecho[];
+extern const u32 gMonFrontPic_Mewthree[];
+extern const u32 gMonPalette_Mewthree[];
+extern const u32 gMonBackPic_Mewthree[];
+extern const u32 gMonShinyPalette_Mewthree[];
+extern const u8 gMonIcon_Mewthree[];
+extern const u8 gMonFootprint_Mewthree[];
 extern const u32 gMonPic_Egg[];

Now link the graphic files. Edit src/data/graphics/pokemon.h:

const u32 gMonFrontPic_CalyrexShadowRider[] = INCBIN_U32("graphics/pokemon/calyrex/shadow_rider/front.4bpp.lz");

+const u32 gMonFrontPic_Mewthree[] = INCBIN_U32("graphics/pokemon/mewthree/anim_front.4bpp.lz");
+const u32 gMonPalette_Mewthree[] = INCBIN_U32("graphics/pokemon/mewthree/normal.gbapal.lz");
+const u32 gMonBackPic_Mewthree[] = INCBIN_U32("graphics/pokemon/mewthree/back.4bpp.lz");
+const u32 gMonShinyPalette_Mewthree[] = INCBIN_U32("graphics/pokemon/mewthree/shiny.gbapal.lz");
+const u8 gMonIcon_Mewthree[] = INCBIN_U8("graphics/pokemon/mewthree/icon.4bpp");
+const u8 gMonFootprint_Mewthree[] = INCBIN_U8("graphics/pokemon/mewthree/footprint.1bpp");

 const u32 gMonFrontPic_Egg[] = INCBIN_U32("graphics/pokemon/egg/front.4bpp.lz");

Please note that Calyrex, the Pokémon that should be above your insertion, imports front.4bpp.lz as its front pic, because he doesn't animate and therefor doesn't need two frames. If your Pokémon is supposed to be animated though, use the anim_front file and not the front file.