• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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.

Pokeruby need help adding custom NPC

  • 5
    Posts
    1
    Years
    • Seen Sep 20, 2024
    I would like to add a few custom NPC to my Pokeruby rom hack but I can't manage to get this working... :( Can someone give me an advice?

    For now I'm trying to duplicate the Boy1 NPC without changing the Sprite.
    In Porymap I correctly see my custom NPC, but when I compile and start the game he is invisible.


    So far I did the following changes:

    /include/constants/event_objects.h
    Code:
    #define OBJ_EVENT_GFX_LINK_BRENDAN 216
    #define OBJ_EVENT_GFX_LINK_MAY 217
    #define OBJ_EVENT_GFX_JULIAN 218
    
    #define NUM_OBJ_EVENT_GFX 219
    -> Adding own entry + increase NUM_OBJ_EVENT_GFX to 219

    src/data/object_events/object_event_graphics_info_pointers.h
    Code:
        [OBJ_EVENT_GFX_LINK_BRENDAN] =              &gObjectEventGraphicsInfo_LinkBrendan,
        [OBJ_EVENT_GFX_LINK_MAY] =                  &gObjectEventGraphicsInfo_LinkMay,
        [OBJ_EVENT_GFX_JULIAN] =                    &gObjectEventGraphicsInfo_Julian
    };

    src/data/object_events/object_event_graphics_info.h
    Code:
    const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Julian = {
        .tileTag = 0xffff,
        .paletteTag = 0x1105,
        .bridgeReflectionPaletteTag = 0x11ff,
        .size = 256,
        .width = 16,
        .height = 32,
        .paletteSlot = 4,
        .shadowSize = SHADOW_SIZE_M,
        .inanimate = FALSE,
        .disableReflectionPaletteLoad = FALSE,
        .tracks = TRACKS_FOOT,
        .oam = &gFieldOamData_16x32,
        .subspriteTables = gObjectEventSubspriteTables_16x32,
        .anims = gObjectEventImageAnimTable_Standard,
        .images = gObjectEventPicTable_Julian,
        .affineAnims = gDummySpriteAffineAnimTable,
    };

    src/data/object_events/object_event_graphics.h
    Code:
    const u16 gObjectEventPalette12[] = INCBIN_U16("graphics/object_events/palettes/12.gbapal");
    const u16 gObjectEventPalette13[] = INCBIN_U16("graphics/object_events/palettes/13.gbapal");
    const u32 gObjectEventPic_Julian[] = INCBIN_U32("graphics/object_events/pics/people/julian.4bpp");
    #endif //POKERUBY_OBJECT_EVENT_GFX_H

    src/data/object_events/object_event_pic_tables.h
    Code:
    const struct SpriteFrameImage gObjectEventPicTable_Julian[] = {
        overworld_frame(gObjectEventPic_Julian, 2, 4, 0),
        overworld_frame(gObjectEventPic_Julian, 2, 4, 1),
        overworld_frame(gObjectEventPic_Julian, 2, 4, 2),
        overworld_frame(gObjectEventPic_Julian, 2, 4, 3),
        overworld_frame(gObjectEventPic_Julian, 2, 4, 4),
        overworld_frame(gObjectEventPic_Julian, 2, 4, 5),
        overworld_frame(gObjectEventPic_Julian, 2, 4, 6),
        overworld_frame(gObjectEventPic_Julian, 2, 4, 7),
        overworld_frame(gObjectEventPic_Julian, 2, 4, 8)
    };

    graphics/object_events/pics/people/
    Code:
    graphics/object_events/pics/people/julian.png
    -> Copy of "boy_1.png". The julian.4bpp is generated by compiling.
     
    I would like to add a few custom NPC to my Pokeruby rom hack but I can't manage to get this working... :( Can someone give me an advice?

    For now I'm trying to duplicate the Boy1 NPC without changing the Sprite.
    In Porymap I correctly see my custom NPC, but when I compile and start the game he is invisible.


    So far I did the following changes:

    /include/constants/event_objects.h
    Code:
    #define OBJ_EVENT_GFX_LINK_BRENDAN 216
    #define OBJ_EVENT_GFX_LINK_MAY 217
    #define OBJ_EVENT_GFX_JULIAN 218
    
    #define NUM_OBJ_EVENT_GFX 219
    -> Adding own entry + increase NUM_OBJ_EVENT_GFX to 219

    src/data/object_events/object_event_graphics_info_pointers.h
    Code:
        [OBJ_EVENT_GFX_LINK_BRENDAN] =              &gObjectEventGraphicsInfo_LinkBrendan,
        [OBJ_EVENT_GFX_LINK_MAY] =                  &gObjectEventGraphicsInfo_LinkMay,
        [OBJ_EVENT_GFX_JULIAN] =                    &gObjectEventGraphicsInfo_Julian
    };

    src/data/object_events/object_event_graphics_info.h
    Code:
    const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Julian = {
        .tileTag = 0xffff,
        .paletteTag = 0x1105,
        .bridgeReflectionPaletteTag = 0x11ff,
        .size = 256,
        .width = 16,
        .height = 32,
        .paletteSlot = 4,
        .shadowSize = SHADOW_SIZE_M,
        .inanimate = FALSE,
        .disableReflectionPaletteLoad = FALSE,
        .tracks = TRACKS_FOOT,
        .oam = &gFieldOamData_16x32,
        .subspriteTables = gObjectEventSubspriteTables_16x32,
        .anims = gObjectEventImageAnimTable_Standard,
        .images = gObjectEventPicTable_Julian,
        .affineAnims = gDummySpriteAffineAnimTable,
    };

    src/data/object_events/object_event_graphics.h
    Code:
    const u16 gObjectEventPalette12[] = INCBIN_U16("graphics/object_events/palettes/12.gbapal");
    const u16 gObjectEventPalette13[] = INCBIN_U16("graphics/object_events/palettes/13.gbapal");
    const u32 gObjectEventPic_Julian[] = INCBIN_U32("graphics/object_events/pics/people/julian.4bpp");
    #endif //POKERUBY_OBJECT_EVENT_GFX_H

    src/data/object_events/object_event_pic_tables.h
    Code:
    const struct SpriteFrameImage gObjectEventPicTable_Julian[] = {
        overworld_frame(gObjectEventPic_Julian, 2, 4, 0),
        overworld_frame(gObjectEventPic_Julian, 2, 4, 1),
        overworld_frame(gObjectEventPic_Julian, 2, 4, 2),
        overworld_frame(gObjectEventPic_Julian, 2, 4, 3),
        overworld_frame(gObjectEventPic_Julian, 2, 4, 4),
        overworld_frame(gObjectEventPic_Julian, 2, 4, 5),
        overworld_frame(gObjectEventPic_Julian, 2, 4, 6),
        overworld_frame(gObjectEventPic_Julian, 2, 4, 7),
        overworld_frame(gObjectEventPic_Julian, 2, 4, 8)
    };

    graphics/object_events/pics/people/
    Code:
    graphics/object_events/pics/people/julian.png
    -> Copy of "boy_1.png". The julian.4bpp is generated by compiling.
    You need to add a rule for the new graphic in spritesheet_rules.mk. You may need to run 'make clean' for it to take effect.
     
    You need to add a rule for the new graphic in spritesheet_rules.mk. You may need to run 'make clean' for it to take effect.
    Thank you so so much for helping me again!!!! :) It really was just that! ^^ It works perfectly now! :)))
     
    Back
    Top