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

[Tool✓] Replacing Red's and Leaf's Backsprite using CFRU

Lance Koijer 2.0

Lance Koijer
105
Posts
6
Years
  • Hi Guys, I've been having issues replacing the player's backsprite using CFRU:

    Here's what happens in game every time I apply CFRU:


    I always get this error when trying to compile CFRU but it's still compiling at the end:
    Spoiler:

    I think that's the error but I don't know how and where to fix it.

    Here's the changes that I made in the C File:
    Code:
    extern const u8 gTrainerBackPic_WyattPal[];
    #define gTrainerPalette_Wyatt gTrainerBackPic_WyattPal
    extern const u8 gTrainerBackPic_CoraPal[];
    #define gTrainerPalette_Cora gTrainerBackPic_CoraPal

    const struct CompressedSpritePalette gTrainerBackPicPaletteTable[] =
    Code:
    	[TRAINER_BACK_PIC_RED] =		{gTrainerPalette_Wyatt, 	TRAINER_BACK_PIC_RED},
    	[TRAINER_BACK_PIC_LEAF] =		{gTrainerPalette_Cora, 	TRAINER_BACK_PIC_LEAF},

    Code:
    #define gTrainerBackAnims_Wyatt (const union AnimCmd* const*) 0x8239F54
    #define gTrainerBackAnims_Cora (const union AnimCmd* const*) 0x8239F54

    const union AnimCmd* const* const gTrainerBackAnimsPtrTable[] =
    Code:
    	[TRAINER_BACK_PIC_RED] = gTrainerBackAnims_Wyatt,
    	[TRAINER_BACK_PIC_LEAF] = gTrainerBackAnims_Cora,

    Code:
    extern const u8 gTrainerBackPic_WyattTiles[];
    extern const u8 gTrainerBackPic_CoraTiles[];

    I think this is what's making me get the compilation error but I don't really know what's wrong with it:
    Code:
    static const struct SpriteFrameImage sTrainerBackPicTable_Wyatt[] =
    {
    	{gTrainerBackPic_WyattTiles, 			0x800, 0},
    	{gTrainerBackPic_WyattTiles, + 0x0800, 0x800, 0},
    	{gTrainerBackPic_WyattTiles, + 0x1000, 0x800, 0},
    	{gTrainerBackPic_WyattTiles, + 0x1800, 0x800, 0},
    };
    
    static const struct SpriteFrameImage sTrainerBackPicTable_Cora[] =
    {
    	{gTrainerBackPic_CoraTiles, 				0x800, 0},
    	{gTrainerBackPic_CoraTiles, + 0x0800, 	0x800, 0},
    	{gTrainerBackPic_CoraTiles, + 0x1000, 	0x800, 0},
    	{gTrainerBackPic_CoraTiles, + 0x1800, 	0x800, 0},
    };

    const struct SpriteTemplate gSpriteTemplateTable_TrainerBackSprites[] =
    Code:
    	[TRAINER_BACK_PIC_RED] =
    	{
    		.tileTag = 0xFFFF,
    		.paletteTag = 0,
    		.oam = gOamData_TrainerBacksprite,
    		.anims = NULL,
    		.images = sTrainerBackPicTable_Wyatt,
    		.affineAnims = gAffineAnims_TrainerBacksprite,
    		.callback = gSpriteCB_TrainerBacksprite,
    	},
    	[TRAINER_BACK_PIC_LEAF] =
    	{
    		.tileTag = 0xFFFF,
    		.paletteTag = 0,
    		.oam = gOamData_TrainerBacksprite,
    		.anims = NULL,
    		.images = sTrainerBackPicTable_Cora,
    		.affineAnims = gAffineAnims_TrainerBacksprite,
    		.callback = gSpriteCB_TrainerBacksprite,
    	},

    If anyone here can point out what I did wrong, that'd much appreciated
     
    Last edited:

    Lance Koijer 2.0

    Lance Koijer
    105
    Posts
    6
    Years
  • Fixed it.

    It should be:
    Code:
    static const struct SpriteFrameImage sTrainerBackPicTable_Wyatt[] =
    {
    	{gTrainerBackPic_WyattTiles, 			0x800, 0},
    	{gTrainerBackPic_WyattTiles + 0x0800, 0x800, 0},
    	{gTrainerBackPic_WyattTiles + 0x1000, 0x800, 0},
    	{gTrainerBackPic_WyattTiles + 0x1800, 0x800, 0},
    };
    
    static const struct SpriteFrameImage sTrainerBackPicTable_Cora[] =
    {
    	{gTrainerBackPic_CoraTiles, 				0x800, 0},
    	{gTrainerBackPic_CoraTiles + 0x0800, 	0x800, 0},
    	{gTrainerBackPic_CoraTiles + 0x1000, 	0x800, 0},
    	{gTrainerBackPic_CoraTiles + 0x1800, 	0x800, 0},
    };

    {gTrainerBackPic_WyattTiles + 0x0800, 0x800, 0}, shouldn't have a comma after "Tiles"
     
    Back
    Top