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

[Pokeemerald] Costume Menu

106
Posts
15
Years
    • Seen May 29, 2019
    I've always enjoyed the idea of customisation in games, so I've implemented a costume menu for Pokémon Emerald using the pokeemerald disassembly, and the best part is the source code is available for all to enjoy (src/costume_menu.c).

    Features:
    • Ability to change the character you play as via a menu.
    • Up to 255 costumes (though that can be easily expanded if required)
    • Filter costumes by male/female/unlocked.
    • Locked costumes are displayed in greyscale.
    • Ability to hide specific costumes from being displayed until they've been unlocked.
    • Dynamic overworld and reflection palette system.
    • Support for asymmetric overworlds.

    Planned features:
    • Expanded overworlds (Whilst I have started this and am fairly sure on how to do the rest, I am unable to do so until more code has been decompiled, specifically any code that references gSaveBlock1Ptr).
    • Accurate Gen IV style overworlds (Requires custom graphics, if you're interested in contributing check out the Playable Character Community Project thread).

    Known issues:
    • Due to having started the overworld expansion but being unable to complete is at present, any event object over 255 cannot be displayed.
    • As custom graphics are required there are some graphical issues with placeholder graphics that share the same palette slot (such as the player's running pose for instance) but use a different palette.

    I may provide a standalone branch with only the costume menu and dynamic palette system if it is wanted.

    Adding new costumes
    • Within "include/constants/costumes.h" Add new defines (before NUMBER_OF_COSTUMES) for your new costumes and renumber them accordingly, this will affect SaveBlock2 so any previous save will be incompatible after these changes.
    • Next add a name and description for your costume in "src/data/costume_menu/costume_descriptions.h"
    • Add an entry to gCostumes within "src/data/costume_menu/costumes.h"
    • To be able to use your costume in-game you need to create a script to unlock it:
      Code:
      UnlockCostume_ExampleScript::
      setvar VAR_0x8004 COSTUME_RED
      special UnlockCostume_Special
      end

    Although I intend to simplify it as well as adding an unlock message automatically, akin to picking up an item.

    At present pokeemerald is 68% decompiled, meaning that there are still limitations on what can be done with it and it is not in a user friendly state, but I would still recommend playing around with it as it allows for much more complex changes than a binary ROM hack.
    I will periodically be merging with the master branch until it is completely decompiled.

    FAQ:

    Is this compatible with existing hacks?
    If the hack is using the pokeemerald disassembly then yes, it should also be fairly simple to port to pokeruby. You will need to understand how to use github though.
    If you're doing a traditional binary ROM hack then no, but the benefits of learning how to use the disassemblies are significant.

    Will a patch be made?
    It could but that would defeat the point of using the disassemblies.

    I don't want it on the start menu, can I access it some other way?
    Yes, you have the source code available, you can undo the changes I made by comparing it with the master branch and going to src/start_menu.c: https://github.com/pret/pokeemerald...costume#diff-bafcaeb8ddf95aafdb833e0768944e24
    You will need to familiarise yourself with pokeemerald to understand where to insert the callback for the costume menu (CB2_CostumeMenu) if you want to access it from somewhere else.
     
    Last edited by a moderator:

    MrDollSteak

    Formerly known as 11bayerf1
    858
    Posts
    15
    Years
  • This looks incredible. Amazing work.

    I just have a few questions / suggestions.

    One suggestion I would make is documenting how to make the costume menu be accessible from a script or item, etc. In case people don't want it in the menu. For example maybe someone can make a portable wardrobe item that opens this menu, or a wardrobe in buildings with an NPC that allows you to access it. This way there can be clothing stores like in newer games where you can buy 'costumes' and then cycle through what you have in the wardrobe.

    On this note I want to ask if it currently supports changing the backsprites of the trainer for battles. That would obviously also require a ton more assets, but it certainl would make the costumes feel more real.
     
    106
    Posts
    15
    Years
    • Seen May 29, 2019
    This looks incredible. Amazing work.

    I just have a few questions / suggestions.

    One suggestion I would make is documenting how to make the costume menu be accessible from a script or item, etc. In case people don't want it in the menu. For example maybe someone can make a portable wardrobe item that opens this menu, or a wardrobe in buildings with an NPC that allows you to access it. This way there can be clothing stores like in newer games where you can buy 'costumes' and then cycle through what you have in the wardrobe.

    Thank you and thanks for the suggestions.

    To access it from elsewhere it's as simple as adding
    Code:
    SetMainCallback2(CB2_CostumeMenu);
    to whatever function gets called. The function you add it to will depend on the use case. I'm not sure how to use it via scripts as I haven't done much work with them yet.

    I may do a more thorough explanation if it's needed.

    On this note I want to ask if it currently supports changing the backsprites of the trainer for battles. That would obviously also require a ton more assets, but it certainl would make the costumes feel more real.

    Funnily enough I was so focused on getting the menu itself right that it slipped my mind to add this, but it is a planned feature and one that I don't think would take long to implement. The code that handles the trainer card still needs to be decompiled so the front sprite won't change just yet either but again that should be easy to implement.

    I agree it would be much more immersive if there were accurate trainer sprites for each costume, it is also one of the reasons I made the Playable Character Community Project and whilst the current focus is overworld sprites, trainer sprites are within the scope of the project if anyone is interested in contributing.
     

    _pheebee

    [I]Gosh! What's poppin'?[/i]
    528
    Posts
    5
    Years
  • This looks soo good.

    If I was using pokeemerald I'd def use it.~
    More hacks need a costume system!
     
    222
    Posts
    6
    Years
    • Seen Nov 18, 2023
    This looks amazing!

    One feature suggestion, though, is to add a callable routine that returns the costume id of the player, for use in scripts. This could be really useful for a lot of reasons, for example, you can't enter the factory without safety gear, or if you're wearing a team rocket disguise you can skip most fights, etc.

    I also can't wait for your OW expansion! Will this work globally or just with the costume selector?
     
    106
    Posts
    15
    Years
    • Seen May 29, 2019
    This looks amazing!

    One feature suggestion, though, is to add a callable routine that returns the costume id of the player, for use in scripts. This could be really useful for a lot of reasons, for example, you can't enter the factory without safety gear, or if you're wearing a team rocket disguise you can skip most fights, etc.

    I also can't wait for your OW expansion! Will this work globally or just with the costume selector?

    Thanks for the suggestion, that's a good idea.

    The overworld expansion will be global, pokeemerald is now roughly 87% decompiled and I expect to be able to complete the expansion at around 95-98%.
     
    222
    Posts
    6
    Years
    • Seen Nov 18, 2023
    Thanks for the suggestion, that's a good idea.

    The overworld expansion will be global, pokeemerald is now roughly 87% decompiled and I expect to be able to complete the expansion at around 95-98%.

    Oh, also, two other things:

    How do you use the dynamic pallete system? Is it automatic?
    What is an asymmetric sprite and how do you implement it?

    Edit: and how do I merge this into my fork? It says I have to use the command line to resolve conflicts wtf

    Thanks.
     
    Last edited:
    106
    Posts
    15
    Years
    • Seen May 29, 2019
    Oh, also, two other things:

    How do you use the dynamic pallete system? Is it automatic?
    What is an asymmetric sprite and how do you implement it?

    Edit: and how do I merge this into my fork? It says I have to use the command line to resolve conflicts wtf

    Thanks.

    The dynamic palette system is automatic, it just means that only the palettes being used currently are loaded, which means adding new overworlds is much easier. However, I need to update the field weather to use this system as it was previously using the players sprite palette, so changing that has caused the fog and rain to be the wrong colour.

    Asymmetric overworlds are used when a character's left and right sprite look different.

    pryce.png


    Here's a tutorial I've written for inserting new overworlds using pokeemerald:
    https://github.com/pret/pokeemerald/wiki/Adding-new-overworlds

    To add an asymmetric overworld you'll have to add extra entries to the characters PicTable as shown below. (Pryce is asymmetric whereas Clair is not.)

    Code:
    const struct SpriteFrameImage gEventObjectPicTable_Pryce[] = {
        overworld_frame(gEventObjectPic_Pryce, 4, 4, 0),
        overworld_frame(gEventObjectPic_Pryce, 4, 4, 1),
        overworld_frame(gEventObjectPic_Pryce, 4, 4, 2),
        overworld_frame(gEventObjectPic_Pryce, 4, 4, 3),
        overworld_frame(gEventObjectPic_Pryce, 4, 4, 4),
        overworld_frame(gEventObjectPic_Pryce, 4, 4, 5),
        overworld_frame(gEventObjectPic_Pryce, 4, 4, 6),
        overworld_frame(gEventObjectPic_Pryce, 4, 4, 7),
        overworld_frame(gEventObjectPic_Pryce, 4, 4, 8),
        overworld_frame(gEventObjectPic_Pryce, 4, 4, 9),
        overworld_frame(gEventObjectPic_Pryce, 4, 4, 10),
        overworld_frame(gEventObjectPic_Pryce, 4, 4, 11),
    };
    
    const struct SpriteFrameImage gEventObjectPicTable_Clair[] = {
        overworld_frame(gEventObjectPic_Clair, 4, 4, 0),
        overworld_frame(gEventObjectPic_Clair, 4, 4, 1),
        overworld_frame(gEventObjectPic_Clair, 4, 4, 2),
        overworld_frame(gEventObjectPic_Clair, 4, 4, 3),
        overworld_frame(gEventObjectPic_Clair, 4, 4, 4),
        overworld_frame(gEventObjectPic_Clair, 4, 4, 5),
        overworld_frame(gEventObjectPic_Clair, 4, 4, 6),
        overworld_frame(gEventObjectPic_Clair, 4, 4, 7),
        overworld_frame(gEventObjectPic_Clair, 4, 4, 8),
    };

    As well as using gEventObjectImageAnimTable_Standard_Asymmetric for the AnimTable in src/data/field_event_obj/event_object_graphics_info.h

    I haven't updated the branch in months so it is over 500 commits behind so there will be a lot of conflicts so I don't recommend merging it at present. I will merge and update it as soon as the remaining save block references are decompiled.

    Also as the overworld expansion is incomplete the game currently softlocks when trying to use cut or rock smash in the overworld.
     
    Last edited:
    106
    Posts
    15
    Years
    • Seen May 29, 2019
    https://github.com/pret/pokeemerald/compare/master...Slawter666:costume

    There's a list of the changes I made. If you want everything but the overworld expansion you won't need to make changes in the following files.
    Spoiler:


    Personally I would wait to introduce these changes into your project until I've merged and updated it as the costume menu adds references to the save blocks, which are not shiftable yet.
     
    1
    Posts
    5
    Years
    • Seen Sep 30, 2019
    Hi!

    Is this updated and available on your GitHub? Also, do the back sprites work? I know someone already asked but not sure if it's been updated yet or not. Awesome hack you've made.
     
    106
    Posts
    15
    Years
    • Seen May 29, 2019
    Hi!

    Is this updated and available on your GitHub? Also, do the back sprites work? I know someone already asked but not sure if it's been updated yet or not. Awesome hack you've made.

    It's not been updated yet, I'm waiting for saveblock shiftability first as that is currently preventing me from completing the overworld expansion. Though that is likely to take upwards of two months for the relevant code to be decompiled.

    At the moment only the overworld sprite changes.
     

    JK0JK

    JK is JK
    25
    Posts
    3
    Years
  • Please make a compatible version for Fire Red! That game has so much more potential than emerald and this is EXACTLY what I've been looking for since I started working on my rom hack!
     
    990
    Posts
    4
    Years
  • Please make a compatible version for Fire Red! That game has so much more potential than emerald and this is EXACTLY what I've been looking for since I started working on my rom hack!

    That's actually incorrect. Emerald is actually much more advanced in decompilation and disassembly. You'd do better by going with pokeemerald if you're using the decomps.
     

    JK0JK

    JK is JK
    25
    Posts
    3
    Years
  • Planned features:
    • Expanded overworlds (Whilst I have started this and am fairly sure on how to do the rest, I am unable to do so until more code has been decompiled, specifically any code that references gSaveBlock1Ptr).

    Known issues:
    • Due to having started the overworld expansion but being unable to complete is at present, any event object over 255 cannot be displayed.

    What do you mean by "overworld expansion"? Are you refering to this?
    Also, are there other issues? How does one go about solving them?
    I really wanna make this work
     
    4
    Posts
    5
    Years
    • Seen Apr 17, 2024
    What do you mean by "overworld expansion"? Are you refering to this?
    Also, are there other issues? How does one go about solving them?
    I really wanna make this work

    Here's another "Overworld Expansion" branch here that is probably better (link showing the changes rather than just the branch itself): https://github.com/ghoulslash/pokeemerald/compare/master...ghoulslash:overworld-expansion

    The author of the costume menu here has been inactive here, discord and github for around 2 years now, so we'll probably won't be getting any help from them any time soon unfortunately.
     
    Back
    Top