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

Simple Modifications Directory

3
Posts
2
Years
    • Seen Nov 22, 2023
    [pokeemerald] Increase Text Speed Beyond Fast

    compared to newer games, text speed is a large part of what makes gen 3 feel slow. the game already prints 1 character per frame when the text speed is set to fast, so we are going to alter it to print more than one character per frame. we can also set the original "fast" speed to be our slowest speed. you can fine-tune the exact speed at each setting to your liking.

    part 1: multiple characters per frame

    Spoiler:


    part 2: changing slow and mid

    Spoiler:


    i hope you find this modification useful! i've only just added it to my hack today, and i've fixed a couple of bugs with it already. if any more pop up, i'll edit this post to fix them. if anyone else finds bugs with it, please let me know and i'll see what i can do.


    Hi,

    There are a few things that need to be defined from the rhh expansion in the vanilla code for Show Type Effectiveness In-Battle to work.
    I was able to get it to work and the changes can be found in a commit on my repo's fork.
     
    5
    Posts
    5
    Years
    • Seen Oct 24, 2023
    Move Relearner as an option in the Pokémon Party Screen (Emerald)

    In Pokémon Legends Arceus, a new addition was made to change a Pokémon's moveset from the Party Menu. This adds this feature to Pokeemerald.

    First, we define some stuff:

    We go to include/flags.h and we replace any flag with the _UNUSED nametag with this:
    Code:
    FLAG_PARTY_MOVES
    Then, we go to include/strings.h, and we add this after the last one:
    Code:
    extern const u8 gText_Moves_Menu[];
    After that, we go to src/strings.c, and we add afer the last one:
    Code:
    const u8 gText_Moves_Menu[] = _("Change Moves");


    Then, we go to include/party_menu.h and we add:
    Code:
    void CB2_ReturnToPartyMenuFromSummaryScreen(void);

    Then, we go to src/data/party_menu.h and we add:
    Code:
    MENU_MOVES,
    Anywhere in the the enum section with the menus. It's the one with "MENU_SUMMARY".

    After that, we search for "[MENU_SUMMARY] = {gText_Summary5, CursorCb_Summary}," and we add underneath:
    Code:
    [MENU_MOVES] = {gText_Moves_Menu, CursorCb_Moves},

    Then, we go to src/party_menu.c:
    We add on the top "#include move_relearner.h" where all the other includes are
    We search for "u8 actions[8];" and we change it with "u8 actions[10];"
    We search for "static void CB2_ReturnToPartyMenuFromSummaryScreen(void);" and we delete the line entirely
    We search for "static void CursorCb_Summary(u8);" and we add right after:
    Code:
    static void CursorCb_Moves(u8);
    Then, we search for "static void CB2_ReturnToPartyMenuFromSummaryScreen" and we delete de "static" part
    then, we search for CursorCb_Summary(u8 taskId) and right after we add:
    Code:
    static void CursorCb_Moves(u8 taskId)
    {
        PlaySE(SE_SELECT);
    	FlagSet(FLAG_PARTY_MOVES);
        gSpecialVar_0x8004 = gPartyMenu.slotId;
    	gSpecialVar_0x8005 = GetNumberOfRelearnableMoves(&gPlayerParty[gSpecialVar_0x8004]);
    	DisplayPartyPokemonDataForRelearner(gSpecialVar_0x8004);
    	TeachMoveRelearnerMove();
        sPartyMenuInternal->exitCallback = TeachMoveRelearnerMove;
        Task_ClosePartyMenu(taskId);
    }

    Then, we search "AppendToList(sPartyMenuInternal->actions, &sPartyMenuInternal->numActions, MENU_SWITCH);" and right under, but outside de "if" declaration, we add:
    Code:
    		if (GetNumberOfRelearnableMoves(&mons[slotId]) != 0) {
    			AppendToList(sPartyMenuInternal->actions, &sPartyMenuInternal->numActions, MENU_MOVES);
    		}
    (It should look like this:)
    Spoiler:

    Then, we go to scr/move_relearner.c, and we add an include like this at the start:
    #include "party_menu.h"
    Lastly, we search for "SetMainCallback2(CB2_ReturnToField);" and we replace the line for:

    Code:
    			if (FlagGet(FLAG_PARTY_MOVES))
    			{
    				CB2_ReturnToPartyMenuFromSummaryScreen();
    				FlagClear(FLAG_PARTY_MOVES);
    			}
    			else
    			{
    				SetMainCallback2(CB2_ReturnToField);
    			}
    If we want to add PLA's PP tracking system, so we can´t infinetly restore our PP's later on, we have to do this:



    And then, we should have this! (ignore the "nickname" addition)
    Simple Modifications Directory

    This gif shows that the option only appears if the Pokémon has any moves to relearn.
    This addition does not add the option to make pokemon relearn moves they've been taught via TMs, only level-up moves are avaible.

    Hi, I'd like to implement this but there's no include/flag.h file. Has it been moved to a different folder or something?

    I'd also like to implement Lunos' Synchronize modification but there's no src/data/wild_encounter.c either. Should I modify another file instead? Sorry if these are noob questions, I literally discovered this yesterday
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Hi, I'd like to implement this but there's no include/flag.h file. Has it been moved to a different folder or something?
    That was likely a typo. They were referring to the include/constants/flags.h file where constant labels for event flags are defined.
    I'd also like to implement Lunos' Synchronize modification but there's no src/data/wild_encounter.c either. Should I modify another file instead? Sorry if these are noob questions, I literally discovered this yesterday
    And that was a typo too. The file in question is src/wild_encounter.c. I'll edit the post right away.
     
    5
    Posts
    5
    Years
    • Seen Oct 24, 2023
    That was likely a typo. They were referring to the include/constants/flags.h file where constant labels for event flags are defined.

    And that was a typo too. The file in question is src/wild_encounter.c. I'll edit the post right away.

    Oh ok thanks! I'll try them out that way instead. In the meantime, I was able to build pokeemerald with msys2 without any modification (as a test). However, trying to implement this mid battle evo tutorial gave errors saying gPlayerDoesNotWantToEvolveLeft and gPlayerDoesNotWantToEvolveRight in lines 652 & 654 weren't declared (because it was the first time they were used in a function):
    https://github.com/pret/pokeemerald/compare/master...CtrlFootPrint:MidBattleEvo
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Oh ok thanks! I'll try them out that way instead. In the meantime, I was able to build pokeemerald with msys2 without any modification (as a test). However, trying to implement this mid battle evo tutorial gave errors saying gPlayerDoesNotWantToEvolveLeft and gPlayerDoesNotWantToEvolveRight in lines 652 & 654 weren't declared (because it was the first time they were used in a function):
    https://github.com/pret/pokeemerald/compare/master...CtrlFootPrint:MidBattleEvo
    Make sure you declared those variables, just like it was done on that branch inside the include/battle.h file.
    https://github.com/pret/pokeemerald...ba6705371cf3714a9e6b534c2891a5379984058cc963c
     
    12
    Posts
    1
    Years
  • [PokeEmerald] Enable the Opponent Trainers to throw Pokeball instead of dropping it directly to the battlefield.

    From the GEN3 pokemon games, it is the player himself (or the trainers in the player's side such as double-battle partners or catching tutors) that had been added the feature enabling him or her to throw their pokeball to the battlefield, which also took place of that simple & massively used "drop & out" animation presented in GEN1 & 2. However, for the trainers in the opposite side, it's a shame that they still simply drop & leave their pokeball behind themselves and then slide away, which is nothing but the old & only method for pokeball's presenting in trainer battle.
    Well, after some shallow & easy research of the decomp files, I finally succeeded in enabling the opponent trainers to throw their pokeball to the battlefield, just like what the player could.
    For anyone not clear with what I said above, please take a look at the picture below.

    Spoiler:

    And here, it's time for the explanation in detail.
    1. First of all, open the "pokeball.c" lying under the src folder, here you will clearly see all the codes & functions that controlling all kinds of performances of the Pokeballs during the battle.

    2. Second, jump to the strings of this file's declarations, add "_1" the declaration of the function named "SpriteCB_OpponentMonSendOut". And then add a totally new declaration of a new function named "SpriteCB_OpponentMonSendOut_2" just below it.

    Spoiler:

    3. By finishing the former step, scorlling down to the function named "Task_DoPokeballSendOutAnim", finding the switch structure of the throw case itself, and make some modifications of the case named "POKEBALL_OPPONENT_SENDOUT" just as the picture below.

    Spoiler:

    4. After that, scorlling down to the strings for the original function "SpriteCB_OpponentMonSendOut", select & delete it completely, and insert the codes I presents below.

    Spoiler:

    And here come the complete codes:
    Code:
    static void SpriteCB_OpponentMonSendOut_1(struct Sprite *sprite)
    {
        sprite->data[0] = 25;
        sprite->data[2] = GetBattlerSpriteCoord(sprite->sBattler, BATTLER_COORD_X);
        sprite->data[4] = GetBattlerSpriteCoord(sprite->sBattler, BATTLER_COORD_Y) + 24;
        sprite->data[5] = -30;
        sprite->oam.affineParam = sprite->sBattler;
        InitAnimArcTranslation(sprite);
        sprite->callback = SpriteCB_OpponentMonSendOut_2;
    }
    
    static void SpriteCB_OpponentMonSendOut_2(struct Sprite *sprite)
    {
        u32 r6;
        u32 r7;
    
        if (HIBYTE(sprite->data[7]) >= 35 && HIBYTE(sprite->data[7]) < 80)
        {
            s16 r4;
    
            if ((sprite->oam.affineParam & 0xFF00) == 0)
            {
                r6 = sprite->data[1] & 1;
                r7 = sprite->data[2] & 1;
                sprite->data[1] = ((sprite->data[1] / 3) & ~1) | r6;
                sprite->data[2] = ((sprite->data[2] / 3) & ~1) | r7;
                StartSpriteAffineAnim(sprite, 4);
            }
            r4 = sprite->data[0];
            AnimTranslateLinear(sprite);
            sprite->data[7] += sprite->sBattler / 3;
            sprite->y2 += Sin(HIBYTE(sprite->data[7]), sprite->data[5]);
            sprite->oam.affineParam += 0x100;
            if ((sprite->oam.affineParam >> 8) % 3 != 0)
                sprite->data[0] = r4;
            else
                sprite->data[0] = r4 - 1;
            if (HIBYTE(sprite->data[7]) >= 80)
            {
                r6 = sprite->data[1] & 1;
                r7 = sprite->data[2] & 1;
                sprite->data[1] = ((sprite->data[1] * 3) & ~1) | r6;
                sprite->data[2] = ((sprite->data[2] * 3) & ~1) | r7;
            }
        }
        else
        {
            if (TranslateAnimHorizontalArc(sprite))
            {
                sprite->x += sprite->x2;
                sprite->y += sprite->y2;
                sprite->y2 = 0;
                sprite->x2 = 0;
                sprite->sBattler = sprite->oam.affineParam & 0xFF;
                sprite->data[0] = 0;
    
                if (IsDoubleBattle() && gBattleSpritesDataPtr->animationData->introAnimActive
                 && sprite->sBattler == GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT))
                    sprite->callback = SpriteCB_ReleaseMon2FromBall;
                else
                    sprite->callback = SpriteCB_ReleaseMonFromBall;
    
                StartSpriteAffineAnim(sprite, 0);
            }
        }
    }

    5. Finally, save & test.

    I haven't found any bug yet. Moreover, for anyone who wants this ball-throwing animation vivider. There is an option that he or she could also add a sound effect to it. Just by scrolling back to the "Task_DoPokeballSendOutAnim" function, and adding a line of the "PlaySE" command simply in that switch structure mentioned above, like the picture presented here.

    Spoiler:

    Also, If anyone reading this post find any error, bug or glitch of my codes & tutorial itself. Please at least leave a comment below or give a respond for me.
    Very appreciated for anyone's reading.

    When I attempt to compile the rom I get the following error:

    Src/pokeball.c in function 'Opponent_SendMonOut_2'
    Warning: implicit decleration of function
     

    セケツ

    ポケハック初心者
    61
    Posts
    7
    Years
    • Seen yesterday
    When I attempt to compile the rom I get the following error:

    Src/pokeball.c in function 'Opponent_SendMonOut_2'
    Warning: implicit decleration of function

    Sorry for my late reply.
    Just as what your text saying, the reason leading to this error is nothing but mistaking the name of the function in declaration.
    There is one basic & fundamental rule of programming in C is that the name of one function presented in declaration must keep the SAME with the one of that function itself. Even if there is such a tiny & small difference between them, the compeller would still think they're written for TWO different functions, and that's why the error word "implicit declaration" occurs.
    If you're willing to take a more careful & detailed look of the codes in my tutorial, you would find that the name I used for is "OpponentSendMonOut_2", which is a little bit different from that "Opponent_SendMonOut_2" presented in your respond.
    To make everything goes well again, the only thing you need to do is only fix the different name in the declaration just by changing it to "OpponentSendMonOut_2" (Simply By deleting the first underline presented after the word "Opponent")
     
    12
    Posts
    1
    Years
  • Sorry for my late reply.
    Just as what your text saying, the reason leading to this error is nothing but mistaking the name of the function in declaration.
    There is one basic & fundamental rule of programming in C is that the name of one function presented in declaration must keep the SAME with the one of that function itself. Even if there is such a tiny & small difference between them, the compeller would still think they're written for TWO different functions, and that's why the error word "implicit declaration" occurs.
    If you're willing to take a more careful & detailed look of the codes in my tutorial, you would find that the name I used for is "OpponentSendMonOut_2", which is a little bit different from that "Opponent_SendMonOut_2" presented in your respond.
    To make everything goes well again, the only thing you need to do is only fix the different name in the declaration just by changing it to "OpponentSendMonOut_2" (Simply By deleting the first underline presented after the word "Opponent")

    I removed the underline after the word " opponent" I still getting the same error
     

    セケツ

    ポケハック初心者
    61
    Posts
    7
    Years
    • Seen yesterday
    I removed the underline after the word " opponent" I still getting the same error
    Sorry for my late reply. But there is no doubt that the reason why it came to this error is that there must be something wrong with the function's name. Either in the declaration, or in the function itself.
    I want to apologize for my previous ignorance. However, Just as what I talked about before, the KEY to get away from this error is to confirm MERELY ONE THING: the name of one function MUST BE THE SAME as the name presented in its declaration.
    In the second step of my tutorial, I gave two declarations of two functions at the head of the file:
    Code:
    static void SpriteCB_OpponentMonSendOut_1(struct Sprite *sprite);
    And this:
    Code:
    static void SpriteCB_OpponentMonSendOut_2(struct Sprite *sprite);
    Both of them share the same name with those functions themselves. The only thing needs doing is to check them out & confirm again.
    Moreover, since I didn't see the complete code making you encounter this error. I guess may be there is something mistaken by yourself when you copy it? What's more, I also noticed that the function presented in your error message only have the name "OppoentSendMonOut_2", which is certainly not the complete name "SpriteCB_OpponentMonSendOut_2" that I used in the code.("MonSendOut", NOT that "SendMonOut", here is another error that I didn't notice before, I think).
    It's nothing but just a tiny & little error due to the carelessness. Please check all the things I mentioned again and make sure that the declaration of one function shares THE COMPLETELY SAME NAME with that function itself.
     
    Last edited:
    12
    Posts
    1
    Years
  • Sorry for my late reply. But there is no doubt that the reason why it came to this error is that there must be something wrong with the function's name. Either in the declaration, or in the function itself.
    I want to apologize for my previous ignorance. However, Just as what I talked about before, the KEY to get away from this error is to confirm MERELY ONE THING: the name of one function MUST BE THE SAME as the name presented in its declaration.
    In the second step of my tutorial, I gave two declarations of two functions at the head of the file:
    Code:
    static void SpriteCB_OpponentMonSendOut_1(struct Sprite *sprite);
    And this:
    Code:
    static void SpriteCB_OpponentMonSendOut_2(struct Sprite *sprite);
    Both of them share the same name with those functions themselves. The only thing needs doing is to check them out & confirm again.
    Moreover, since I didn't see the complete code making you encounter this error. I guess may be there is something mistaken by yourself when you copy it? What's more, I also noticed that the function presented in your error message only have the name "OppoentSendMonOut_2", which is certainly not the complete name "SpriteCB_OpponentMonSendOut_2" that I used in the code.("MonSendOut", NOT that "SendMonOut", here is another error that I didn't notice before, I think).
    It's nothing but just a tiny & little error due to the carelessness. Please check all the things I mentioned again and make sure that the declaration of one function shares THE COMPLETELY SAME NAME with that function itself.

    Here's the complete error message I always get.
    Please Check if i did a small mistake.

    Thank you!
     

    Attachments

    • Simple Modifications Directory
      20221222_194925.jpg
      1.3 MB · Views: 17
    • Simple Modifications Directory
      20221222_195006.jpg
      1.8 MB · Views: 12

    セケツ

    ポケハック初心者
    61
    Posts
    7
    Years
    • Seen yesterday
    Here's the complete error message I always get.
    Please Check if i did a small mistake.

    Well, it isn't the previous error you mentioned anymore, just because the lack of definition of the var named "HIBYTE" there.
    The Key to solve it is also very simple, which needs you only to add that definition & undefining codes back to the original file.
    The definition code, which should be written before the place where it finally comes to be used, it should be placed just before the function "SpriteCB_OpponentMonSendOut_2".
    Code:
    #define HIBYTE(x) (((x) >> 8) & 0xFF)
    And second, the undefining code, should be placed where this var itself finally becomes unused. The place you should add it in is Just below that "SpriteCB_OpponentMonSendOut_2" function , which I had mentioned before.
    Code:
    #undef HIBYTE
    It's not your fault because I originally took a use of the original definition of that HIBYTE var directly from the previous function, which could be done easily & merely by moving the undefining code just after that function named "SpriteCB_OpponentMonSendOut_2", But I forgot telling that the undefining code should be moved to the place below. Therefore, to make it much more easier for anyone reading or using this tutorial later, I decided to add all these defining & undefining codes to the tutorial itself for anyone to copy & paste it directly without making any unnecessary changes.
     
    Last edited:
    3
    Posts
    1
    Years
    • Seen Jan 31, 2023

    Move Item [EM]


    Adds a MOVE option to the ITEM menu which allows you to move held items directly between Pokémon in your party, instead of having to use the bag as a middle man.

    I've had this up in my pokeemerald fork for a while, but I never got around to writing it up here. Since I originally made it, the relevant functions got actual names in pokeemerald, so I'm taking this as an opportunity to update it and post it here.

    There's going to be multiple changes required across multiple files, so I'm going to try to keep them in a logical order that minimizes jumping between files. Also, at the end of each step, pokeemerald will still be in a compilable state if done properly.

    In the code blocks throughout this post, new lines of code are highlighted with the color green. Red highlights denote deleted lines of code. If a line of code isn't highlighted either color, it is only included for context.

    Adding the strings


    In include/strings.h, add the following to the end of the file:

    Spoiler:

    In src/strings.c, add the following to the end of the file:

    Spoiler:

    Adding the code


    You'll need to add a forward declaration for CursorCb_MoveItem in src/party_menu.c, like so:

    Spoiler:

    At the end of src/party_menu.c, add the following:

    Spoiler:

    Open include/constants/party_menu.h, and look for #defines of the form PARTY_MSG_WHATEVER. We need to add a #define for PARTY_MSG_MOVE_ITEM_WHERE like so:

    Spoiler:

    Updating relevant data


    Everything from here on will be in src/data/party_menu.h.

    Look for an unnamed enum with values such as MENU_SUMMARY. Add MENU_MOVE_ITEM to the enum's list of values, like so:

    Spoiler:

    Now, we need to add an entry to the sCursorOptions array. Add an entry for MENU_MOVE_ITEM like so:

    Spoiler:

    Next, find the definition of sActionStringTable. Add an entry to the end like so:

    Spoiler:

    And finally, we need to adjust the ITEM menu so that it actually includes our new menu option.

    Find the definition of sPartyMenuAction_GiveTakeItemCancel, and modify it:

    Spoiler:

    Find the definition of sItemGiveTakeWindowTemplate and modify it:

    Spoiler:

    And that's it. Let me know if you have problems.

    Edit: Oh, since I forgot to mention, my code here is licensed under the 0BSD license. In short, use it for whatever. Attribution is appreciated, but not required.

    Forgive me if this is not the place to ask for help troubleshooting, as I am new to all this, but after implementing these changes I get an error when I try to compile the rom. Note, I am using the Pokeemerald Expansion. I also found that your directions to update the "enum" were not in "src/data/party_menu.h" as indicated, but rather, in "src/party_menu.c".

    Here are the errors returned to me in the terminal:
    src/party_menu.c: In function `CursorCb_MoveItemCallback':
    src/party_menu.c:6839: warning: implicit declaration of function `sub_81221EC'
    src/party_menu.c:6912: warning: implicit declaration of function `schedule_bg_copy_tilemap_to_vram'

    The option to move items does not appear in the game.
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Here are the errors returned to me in the terminal:
    src/party_menu.c: In function `CursorCb_MoveItemCallback':
    src/party_menu.c:6839: warning: implicit declaration of function `sub_81221EC'
    src/party_menu.c:6912: warning: implicit declaration of function `schedule_bg_copy_tilemap_to_vram'
    Those labels have been renamed since Zeturic wrote their post.
    sub_81221EC is now MenuHelpers_CallLinkSomething and schedule_bg_copy_tilemap_to_vram is ScheduleBgCopyTilemapToVram.

    Also, for future reference, you can use git log to get the commit in which a label has been last used.
    Ex: git log -n 1 -S schedule_bg_copy_tilemap_to_vram
    Replace that 1 with 5, 10, etc to show more than 1 commit, although more often than not, the latest will be the one in which that label was renamed.
    The option to move items does not appear in the game.
    Because with the errors above you weren't able to build a new ROM.
     
    3
    Posts
    1
    Years
    • Seen Jan 31, 2023
    Those labels have been renamed since Zeturic wrote their post.
    sub_81221EC is now MenuHelpers_CallLinkSomething and schedule_bg_copy_tilemap_to_vram is ScheduleBgCopyTilemapToVram.

    Also, for future reference, you can use git log to get the commit in which a label has been last used.
    Ex: git log -n 1 -S schedule_bg_copy_tilemap_to_vram
    Replace that 1 with 5, 10, etc to show more than 1 commit, although more often than not, the latest will be the one in which that label was renamed.

    Because with the errors above you weren't able to build a new ROM.

    Thank you so much for the help. I am completely new to this (minor experience in C++), so bear with me. While implementing these changes, I've looked in the Menu Helpers header, and there are no MenuHelpers_CallLink functions. If I use the git log for it, it returns:

    warning: inexact rename detection was skipped due to too many files.
    warning: you may want to set your diff.renameLimit variable to at least 719 and retry the command.

    If I use the git log command on the original function sub_812211EC, I get:

    Author: Sierraffinity <[email protected]>
    Date: Thu May 14 01:37:09 2020 -0700

    Begin item_menu.c cleanup
    warning: inexact rename detection was skipped due to too many files.
    warning: you may want to set your diff.renameLimit variable to at least 719 and retry the command.

    I am not sure what "Begin item_menu.c cleanup" means. Looking in the Item_menu.c file, I do not see the needed function either. Perhaps I simply cannot search far enough because of the rename limit?
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • I've looked in the Menu Helpers header, and there are no MenuHelpers_CallLink functions. If I use the git log for it, it returns:

    warning: inexact rename detection was skipped due to too many files.
    warning: you may want to set your diff.renameLimit variable to at least 719 and retry the command.
    Nothing that a nice git config --global diff.renameLimit 999999 can't fix.
    If I use the git log command on the original function sub_812211EC, I get:

    Author: Sierraffinity <[email protected]>
    Date: Thu May 14 01:37:09 2020 -0700

    Begin item_menu.c cleanup
    warning: inexact rename detection was skipped due to too many files.
    warning: you may want to set your diff.renameLimit variable to at least 719 and retry the command.

    I am not sure what "Begin item_menu.c cleanup" means.
    It's the title of that particular commit. It was an effort to clean up the code present in that file.
    "Clean up" as in the action of renaming the labels in the file and editing the syntax to improve the file's readability.
    You can check the changes in that commit using git show or by opening any commit of Pret's Pokeemerald repository on GitHub and then replacing the commit hash in the URL with that commit's if you want to know more.
    Looking in the Item_menu.c file, I do not see the needed function either. Perhaps I simply cannot search far enough because of the rename limit?
    Which one, sub_812211EC or MenuHelpers_CallLinkSomething?
    You won't see the former because it was renamed to the latter.
    If you check with git log -n 1 -S MenuHelpers_CallLinkSomething you'll notice that function was re-renamed after the first time, in the commit afb9ff3a40dcfb2681ef274752bceb726d14b783.
    In other words, sub_812211EC was renamed to MenuHelpers_CallLinkSomething which was then renamed to MenuHelpers_ShouldWaitForLinkRecv.
    That's the current name of the function, as you can see by yourself.

    Now, if your project doesn't have a MenuHelpers_ShouldWaitForLinkRecv function, you may be using a super old copy of Pokeemerald, which I wouldn't suggest you to do.
     
    3
    Posts
    3
    Years
    • Seen Nov 26, 2023
    [PokeEmerald] Print the Icons of the Player's Party Pokemon on the Back Side of the Trainer Card.

    In PokeFirered, there is one special event that enables players to print the icons of their party pokemon on their trainer cards' backside, triggered by "taking one photo" on the machine in the rocket game corner. As far as I know, this special event is not completely deleted or removed in the Pokeemerald and still can be seen when the players try to connect with the save files of the Firered in the cable club (By checking the opponent's card). What's more, the complete codes of itself still remains unchanged in the emerald decomp files, which can be easily enabled just by re-adding the deleted vars back. However, since it's a special event controlled & stored by the vars, it's a shame that it CAN ONLY BE triggered by the players, means when the party team was changed (put a new pokemon into/away from the party) it can't be updated automatically, or print the changes properly and timely.
    Luckily, after breifly looking through how the icons become printed in the party menu, I finally figured out one alternate way of solving this problem. And succeed in making the icon of the player's team printed & update properly. Here is it.
    For anyone still doesn't get what I'm talking about, please take a look at the picture below.
    Spoiler:

    And then, it's time for the explanation in detail.
    First, open the file "trainer-card.c", which lies in the src folder of the decomp files. The initial thing is to include "pokemon.h" at the beginning. And then go into the declaration parts then add the declarations of 2 completely new function. Here, I used "UpdateTrainerCardMonIcons" & "DestoryTrainerCardMonIcons" for instance. And you can give them names freely just as what you want.
    Spoiler:

    Next, jump to the part where stores the declaration of the ewram data. And there need to be added 2 new declaration for the sprite data & palettes of the pokemon icons.
    Spoiler:

    Then, it's time to add all of these codes provided below. For this tutorial, I just chose to place all of the codes to the bottom of this file itself.
    Spoiler:

    Codes:
    Spoiler:

    After adding the codes, scorll up to the function "Task_TrainerCard", which controls the display & the filp of the trainer card itself. Here you must do several changes to the codes in order to make the mon icons appear/disappear properly & timely.
    For case STATE_WAIT_FLIP_TO_BACK, you need to add "UpdateTrainerCardMonIcon();" in the second line. And for case STATE_HANDLE_INPUT_BACK, you need to add "DestoryTrainerCardMonIcons" in the first if & else branch, just like the picture presented below.
    Spoiler:

    Then it comes to the last step, since the newly added function has conflicted with the original print function of the tranier card. It is necessary to scroll down to the original display function "PrintAllOnCardBack" and then delete the original "PrintPokemonIconsOnCard" function, which is presented in case 6.Moreover, since the place where mon icons displayed is conflicted with the text of the battle points, it's also necessary to remove it from the whole process of displaying.
    Spoiler:

    That's all, finally, save the files, build your ROM & test.
    There is only one affair I noticed later that it may break the function of displaying the original icon photos on trainer card properly when being connected to the Firered save files. But I haven't tested it yet since I didn't have the save files that had completed through the seven islands plots.
    Also, if anyone find any bug, error or glitch of my tutorial, please leave a comment below or at least send a message to me.
    Very appreciated for anyone reading it.

    I coppied the code for UpdateTrainerCardMonIcons that was given but I get an error when trying to build it any idea what I did wrong?
     

    Attachments

    • Simple Modifications Directory
      eror.png
      11.7 KB · Views: 8
    3
    Posts
    1
    Years
    • Seen Jan 31, 2023
    Nothing that a nice git config --global diff.renameLimit 999999 can't fix.

    It's the title of that particular commit. It was an effort to clean up the code present in that file.
    "Clean up" as in the action of renaming the labels in the file and editing the syntax to improve the file's readability.
    You can check the changes in that commit using git show or by opening any commit of Pret's Pokeemerald repository on GitHub and then replacing the commit hash in the URL with that commit's if you want to know more.

    Which one, sub_812211EC or MenuHelpers_CallLinkSomething?
    You won't see the former because it was renamed to the latter.
    If you check with git log -n 1 -S MenuHelpers_CallLinkSomething you'll notice that function was re-renamed after the first time, in the commit afb9ff3a40dcfb2681ef274752bceb726d14b783.
    In other words, sub_812211EC was renamed to MenuHelpers_CallLinkSomething which was then renamed to MenuHelpers_ShouldWaitForLinkRecv.
    That's the current name of the function, as you can see by yourself.

    Now, if your project doesn't have a MenuHelpers_ShouldWaitForLinkRecv function, you may be using a super old copy of Pokeemerald, which I wouldn't suggest you to do.

    Thanks again! That fixed it.

    On another note, I found a bug and fixed it in "Nicknaming as an option in the Pokémon Party Screen". In particular, the added functionality to return you to the party screen rather than exiting the menu completely.

    In it's current implementation, if you nickname a pokemon on the party screen, it will return you to the party screen highlighting the pokemon slot that was last viewed in the summary screen via the value stored in gLastViewedMonIndex, with the menu options open. If you haven't used the summary screen yet, it will return you selecting the first pokemon in the party.

    It does this because the fuction for CB2_ReturnToPartyMenuFromSummaryScreen is used to return to the party screen from nicknaming from the party menu.

    To fix it, I initialized a new function and modified the code from CB2_ReturnToPartyMenuFromSummaryScreen so that it does not use gLastViewedMonIndex:

    static void CB2_ReturnToPartyMenuFromNickname(void)
    {
    gPaletteFade.bufferTransferDisabled = TRUE;
    InitPartyMenu(gPartyMenu.menuType, KEEP_PARTY_LAYOUT, gPartyMenu.action, TRUE, PARTY_MSG_DO_WHAT_WITH_MON, Task_TryCreateSelectionWindow, gPartyMenu.exitCallback);
    }

    Using this function, you will be returned to the party screen selecting the same pokemon you nicknamed as seems more appropriate to me.
     
    13
    Posts
    2
    Years
  • Rotom Form Change - Overworld (Emerald)​
    Simple Modifications Directory
    This is a script, a few new specials and a multi-choice box that allows the player to change Rotom's forms. It's based on Dizzy Egg's Pokemon Expansion and Battle Engine V2, so if you're not using those you might need to modify the "IsSelectedMonRotom" and "CountRotomInParty" functions added to field_specials.c to recognize your Rotom forms.

    Code changes can be viewed as a single commit here. Note that you can ignore the changes above line 5386 in field_specials.c, as those are unrelated and shouldn't have been in this commit (oops!).

    If you want to change the moves Rotom learns in each form, they're in field_specials.c in the function "RotomFormToMove". Note that I've changed Frost and Fan's moves to Freeze-Dry and Hurricane, so you may want to tweak those!


    unfortunately I couldn't make it work even though I have all the requirements and compile it doesn't change the shape of the Rotom and doesn't even teach him the new move.

    Currently, when I make the modifications, it does not compile, it says about an error in the location of other files, honestly, I have no idea how to implement it in a slightly simpler way, not even forcing a Git Pull managed to pull the information
     
    1,591
    Posts
    10
    Years
    • Seen Mar 20, 2024
    unfortunately I couldn't make it work even though I have all the requirements and compile it doesn't change the shape of the Rotom and doesn't even teach him the new move.

    Currently, when I make the modifications, it does not compile, it says about an error in the location of other files, honestly, I have no idea how to implement it in a slightly simpler way, not even forcing a Git Pull managed to pull the information
    Can you share the full error you get when compiling? Not enough information to help you without that.
     
    Back
    Top