• 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

Lunos

Random Uruguayan User
3,114
Posts
15
Years
  • Special that lets the Player choose an item from the bag [Em]
    Back in November 2021, SkiDY#5130 mentioned in PokeCommunity's Discord server how the CFRU had a special to check an item from the bag.
    That same day I made an implementation of that in Pokeemerald, which I completely forgot to bring here.
    Now that I incorporated it into a new branch where I'm moving all my personal project's changes, I figured I should take the chance to put it in a branch of its own and post it.

    So, this is pretty simple.
    There's a special that reads the value of the VAR_TEMP_1 in search of a bag pocket and opens said bag pocket directly by using the GoToBagMenu function.
    The item that is chosen by the Player is stored in VAR_ITEM_ID for you to do as you please.

    Usage and Showcase:
    qeHXvT9.gif

    Using call_if_eq instead of goto_if_eq here was my bad. Don't do this at home. It's not correct even though it works.

    To implement this, you can track my GitHub repository via git remote and pull the branch chooseItem which is where I'm hosting the code:
    Code:
    git remote add lunos https://github.com/LOuroboros/pokeemerald
    git pull lunos chooseItem
    Or you can implement it manually:
    https://github.com/pret/pokeemerald/compare/master...LOuroboros:chooseItem
    Your choice.

    And that's pretty much it.​
     
    Last edited:
    7
    Posts
    2
    Years
  • Mid-battle Evolutions (Emerald)
    Hi everyone, this is my first contribution to this thread, I've had a lot of fun doing this and I hope to add some more!

    Features:
    • allows your Pokémon to evolve (if it can) in the middle of a battle when it has levelled up in battle and is currently out. If they learn any moves, they will be ready to be used in battle as well.
    • works with single battles, both left and right Pokémon in double battles and in multi battles (i.e. your partner's Pokémon). Your partner's Pokémon should not evolve in normal gameplay since the player can't normally get Steven's (the only trainer with whom you can gain experience) Pokémon (Metang is the only one who could theoretically evolve) to evolve anyway in the Multi Battle against Team Magma.
    • If you don't want either of your left or right Pokémon to evolve, the game will stop trying to evolve them in-battle if they gain any more levels.

    Preview:
    Spoiler:

    Source
    To pull the branch:
    Code:
    git remote add cfp https://github.com/CtrlFootPrint/pokeemerald
    git pull cfp MidBattleEvo
    Alternatively, here are the changes made: https://github.com/pret/pokeemerald/compare/master...CtrlFootPrint:MidBattleEvo

    I have tested these changes in a variety of different scenarios and with different teams and it seems to be working fine. If you do spot any flaws or bugs or have any questions or queries, please let me know! Any other feedback or comment is much appreciated!
     
    30
    Posts
    4
    Years
    • Seen May 4, 2024
    Mid-battle Evolutions (Emerald)
    Hi everyone, this is my first contribution to this thread, I've had a lot of fun doing this and I hope to add some more!

    Features:
    • allows your Pokémon to evolve (if it can) in the middle of a battle when it has levelled up in battle and is currently out. If they learn any moves, they will be ready to be used in battle as well.
    • works with single battles, both left and right Pokémon in double battles and in multi battles (i.e. your partner's Pokémon). Your partner's Pokémon should not evolve in normal gameplay since the player can't normally get Steven's (the only trainer with whom you can gain experience) Pokémon (Metang is the only one who could theoretically evolve) to evolve anyway in the Multi Battle against Team Magma.
    • If you don't want either of your left or right Pokémon to evolve, the game will stop trying to evolve them in-battle if they gain any more levels.

    Preview:
    Spoiler:

    Source
    To pull the branch:
    Code:
    git remote add cfp https://github.com/CtrlFootPrint/pokeemerald
    git pull cfp MidBattleEvo
    Alternatively, here are the changes made: https://github.com/pret/pokeemerald/compare/master...CtrlFootPrint:MidBattleEvo

    I have tested these changes in a variety of different scenarios and with different teams and it seems to be working fine. If you do spot any flaws or bugs or have any questions or queries, please let me know! Any other feedback or comment is much appreciated!
    Easily ported to FR as well, so thank you for this!
     
    34
    Posts
    2
    Years
    • Seen Aug 13, 2023
    [Pokeemerald] Updated debug menu!

    n4RWIxf.gif


    Now with:
    -SOUND!!!
    -easy way to run custom scripts
    -poison all party mons
    -max money & max coins
    -trigger daycare egg (no more running like crazy to test daycare changes)
    -completly fill pc with pokemon

    Also lots of small fixes!

    Credits for the additions:
    Sierraffinity
    Jaizu

    Spoiler:

    Hi there! I was able to successfully merge this, and everything is working well, except for one thing: it seems that when I "make", the debug menu is available regardless of whether I've used "make DDEBUGGING=1" or a normal "make". Strangely, the syntax "make debugging" doesn't work either.

    Once you've built in the debug menu, is there any way to prevent it from being accessible?
     
    34
    Posts
    2
    Years
    • Seen Aug 13, 2023
    [Pokeemerald] TM Case ported from FR and custom one!

    Base version (fr_tm_case_port):
    I ported the TM Case from Firered over to Emerald:
    T72HI5R.gif

    This branch is meant as a starting point and basically "only" adds the functionality to the case. The original TM/HM pocket still exits.


    Improved version (tx_ui_TmCase):
    I also created an improved version:
    EgCUNSc.gif

    This version adds the party Pokemon icons and grays them out, when the Pokemon cannot learn the currently selected move.
    Additionally it gets rid of the TM/HM pocket and makes sure the player has 1 TM Case, if they find or receive a TM.


    How to add:
    Code:
    git remote add xaman https://github.com/TheXaman/pokeemerald/
    git pull xaman fr_tm_case_port
    OR
    Code:
    git remote add xaman https://github.com/TheXaman/pokeemerald/
    git pull xaman tx_ui_TmCase


    I hope you like it and if you find any bugs please let me know!

    Special thanks to:
    Jaizu for all the feedback

    Credits:
    TheXaman

    Hi! I was experimenting with this last night, and while it's not technically a bug, I've noticed two things:

    1) If you've made TMs reusable using the wiki's tutorials that give them the same importance as an HM, it will cause the [HM] icon to overlap the name in the list and details window.
    2) If you've added in the fairy type, and made any fairy type TMs, the type icon won't appear.
    EDIT:
    Looks like the Fairy Type not appearing for TMs has more to do with the original tutorial for inserting fairy type categories, we've been able to add it for a normal TM/HM Bag, so I can add that info into the tutorial. Will be testing out how that impacts your TM case, too!
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Item field effect functions to increase/decrease Individual Values [Em]
    So, retrogba has been asking for implementations of this, and I made one because I don't particularly like how the game handles ITEM_EFFECTs by default, but also, I was bored enough to just go and do it.

    Why am I posting this? Idk. I guess it's just so the time I spent on this won't go to waste.
    I don't think I'll use it myself since I'm not particularly interested and Bottle Caps are good enough.

    Essentially, this works exactly like the vitamins/berries to increase/decrease EV.
    Use an item that has its itemFieldUseFunc set to ItemUseOutOfBattle_ReduceIV and its secondaryId to STAT_HP on a Pokémon to reduce 10 HP IV.
    Use an item that has its itemFieldUseFunc set to ItemUseOutOfBattle_IncreaseIV and its secondaryId to STAT_HP on a Pokémon to add 10 HP IV.
    And so on.

    These also modify the friendship by making use of the AdjustFriendship function, giving a purpose to the unused FRIENDSHIP_EVENT_VITAMIN and adding one for berry stand-ins.
    The EV reducing berries have not been modified, and those still adjust the friendship from within their item effect like normal though.

    Showcase:


    To implement this, you can track my GitHub repository via git remote and pull the branch ivChangingItems which is where I'm hosting the code:
    Code:
    git remote add lunos https://github.com/LOuroboros/pokeemerald
    git pull lunos ivChangingItems
    Or you can implement things manually:
    https://github.com/pret/pokeemerald/compare/master...LOuroboros:ivChangingItems

    The latter is probably ideal in this case since I added new placeholder items that are bound to produce conflicts with the item_expansion, but ultimately, the choice is yours.

    And that's pretty much it.​
     
    180
    Posts
    6
    Years
    • Seen Apr 15, 2024
    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:

    EDIT4: An alternative way to deal with that is to do what the Gen. 5 Games did with the reusable TMs.
    Those pick the smallest PP value out of the old and the new move, and make the new move use that.
    Thankfully, this is shown in the "Infinite TM usage" tutorial at the Pokeemerald wiki.
    Here's the commit from my branch, for anyone interested.

    And then, we should have this! (ignore the "nickname" addition)
    0fhBbj2.gif

    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.
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Then, we go to src/data/party_menu.h and we add:
    Code:
    MENU_MOVES,
    Under "MENU_BAG,", in the enum section.
    Just so you know, that label is not present in that file, it's in src/pokemon_storage_system.c.
    I suppose you mean to tell the user to add MENU_MOVES, in this enum.
    Thankfully, the order doesn't matter much in this case. As long as people plug it before MENU_FIELD_MOVES, they'll be fine.

    EDIT: Also, you forgot to mention the user needs to #include the move_relearner.h header file to the list in src/party_menu.c.

    EDIT2: Also, you don't really need to waste a clean flag for this when you can just use the temporary flags.

    Other than that, I tested it, and it works nicely. Thanks!

    EDIT3: Oh yeah, I just realized this doesn't track changes in PP, unlike PLA does.
    Realistically, that could be a bit broken. It's a free heal for moves' PP after all.

    I suppose there isn't a good way to handle this though?
    I'm guessing you'd need to make one of the SaveBlocks (or maybe the BoxPokemon struct) track the amount of PP for each move a Pokémon can learn by levelling up.

    EDIT4: An alternative way to deal with that is to do what the Gen. 5 Games did with the reusable TMs.
    Those pick the smallest PP value out of the old and the new move, and make the new move use that.
    Thankfully, this is shown in the "Infinite TM usage" tutorial at the Pokeemerald wiki.
    Here's the commit from my branch, for anyone interested.

    Keep in mind that what I did modifies the general move relearner behavior.
    If we wanted to apply this only when the Player accesses the feature from the party screen, we could modify the case MENU_STATE_TRY_OVERWRITE_MOVE like this instead: https://pastebin.com/dcbTzGqU
     
    Last edited:
    180
    Posts
    6
    Years
    • Seen Apr 15, 2024
    Other than that, I tested it, and it works nicely. Thanks!
    Thanks for the comments!
    EDIT: Also, you forgot to mention the user needs to #include the move_relearner.h header file to the list in src/party_menu.c.
    Yeah, you're right that i forgot to add that in the tutorial, i will now! Should keep more track on additions and deletions next time i post here
    EDIT4: An alternative way to deal with that is to do what the Gen. 5 Games did with the reusable TMs.
    Those pick the smallest PP value out of the old and the new move, and make the new move use that.
    Thankfully, this is shown in the "Infinite TM usage" tutorial at the Pokeemerald wiki.
    Here's the commit from my branch, for anyone interested.
    Adding it to the tutorial right now!
     
    180
    Posts
    6
    Years
    • Seen Apr 15, 2024
    Hello! This code worked with no errors, however I get a loud screeching sound when exiting the pc that is continuous until i join a battle screen. Any idea how i might resolve this?

    Yup! You're exactly right!
    Turns out, what happened was, i was using an old copy of the game... (my bad!)
    The new updated code is in the original post!

    But here's the new one so you dont have to go back to it
    Code:
    static void FieldTask_ReturnToPcMenu(void)
    {
        u8 taskId;
        MainCallback vblankCb = gMain.vblankCallback;
    	if (FlagGet(FLAG_POKEMONPCMENU)==TRUE)
    	{
    		SetVBlankCallback(NULL);
    		taskId = CreateTask(Task_PCMainMenu, 80);
    		gTasks[taskId].tState = 0;
    		gTasks[taskId].tSelectedOption = sPreviousBoxOption;
    		Task_PCMainMenu(taskId);
    		SetVBlankCallback(vblankCb);
    		FadeInFromBlack();
    	}
    	else {
    		ScriptContext2_Disable();
    		EnableBothScriptContexts();
    		SetVBlankCallback(CB2_ReturnToField);
    		FadeInFromBlack();
    	}
    }
     
    49
    Posts
    5
    Years
    • Seen Dec 27, 2023
    Hi there! I was able to successfully merge this, and everything is working well, except for one thing: it seems that when I "make", the debug menu is available regardless of whether I've used "make DDEBUGGING=1" or a normal "make". Strangely, the syntax "make debugging" doesn't work either.

    Once you've built in the debug menu, is there any way to prevent it from being accessible?

    Hi, I changed the method of enabling/disabling the debug menu a while back and forgot to update the "update post", sorry.
    The new way is:

    Access ingame:
    From now on if you want the menu to show up you have to define TX_DEBUGGING in debug.h and delete/uncomment the line if you don't want it to show up.
    To access ingame press R + Start.
     
    49
    Posts
    5
    Years
    • Seen Dec 27, 2023
    Hi! I was experimenting with this last night, and while it's not technically a bug, I've noticed two things:

    1) If you've made TMs reusable using the wiki's tutorials that give them the same importance as an HM, it will cause the [HM] icon to overlap the name in the list and details window.
    2) If you've added in the fairy type, and made any fairy type TMs, the type icon won't appear.
    EDIT:
    Looks like the Fairy Type not appearing for TMs has more to do with the original tutorial for inserting fairy type categories, we've been able to add it for a normal TM/HM Bag, so I can add that info into the tutorial. Will be testing out how that impacts your TM case, too!

    The only way to fix the HM icon overlapping is to add a condition/check in this function:
    Code:
    static void TMCase_ItemPrintFunc(u8 windowId, u32 itemId, u8 y)
    For example the by itemId, but thats something you have to decide. There is no "fix" I can implement due to the vast amount of different approaches people have for TMs/HMs e.g. expanding them to 100, removing HMs etc...

    And regarding the Fairy type, only implementation I used is the one from the DizzyEgg/RHH BattleEngine and as far as I can remember that worked fine.
     
    34
    Posts
    2
    Years
    • Seen Aug 13, 2023
    No worries! I don't think there's anything to worry about, just wanted to flag two weird instances I saw when working with the common tutorials! IIRC I noticed some code after posting that made it clearer it had the DizzyEgg/RHH branches in mind, but I won't be using those so unfortunately had to bail on your TM case.

    It worked great/looked great otherwise though!

    Hi, I changed the method of enabling/disabling the debug menu a while back and forgot to update the "update post", sorry.
    The new way is:

    Access ingame:
    From now on if you want the menu to show up you have to define TX_DEBUGGING in debug.h and delete/uncomment the line if you don't want it to show up.
    To access ingame press R + Start.

    Awesome, thank you! Getting this to work properly will be incredibly helpful!
     
    180
    Posts
    6
    Years
    • Seen Apr 15, 2024
    [pokeemerald] Day/Night encounters

    I'm happy I can finally contribute to this page. Major thanks to AmbientDinosaur who helped me on my way, link to that post is at the end.

    Thanks again to AmbientDinosaur! Here is the OP https://www.pokecommunity.com/showpost.php?p=10315616&postcount=236

    I've been trying to implement this, but it just doesn't seem to work, like the encounters don't change depending on the time, they just stay the same
    idk what i'm doing wrong, because i have an NPC whose dialogue changes depending on the time and that works just fine

    Ignore this, i implemented the map check wrong, the code was searching for a map that had all maps i wanted night encounters on at once, my bad!
     
    Last edited:
    91
    Posts
    14
    Years
    • Seen Feb 22, 2023
    [Pokeemerald] Simplistic Battle Intro

    Removes the scanline effect clutter and sprite sliding from the battle intro animation and replaces it with only an opening window. This makes it easier to build new battlescreens since you do not have to conform to animation constraints and also speeds up the intro sequence in general.

    Old:
    attachment.php


    New:
    attachment.php


    You can review any changes here: https://github.com/SBird1337/pokeemerald/tree/battle/simple-intro

    ~SBird

    PS: If you have issues don't @ me - get in contact on one of the RH/PC discord servers I'm in or I will probably not respond in a long time.
    E: Changed URL to the branch since the commit was force-pushed to fix a bug related to trainer sliding.
     

    Attachments

    • new.gif
      new.gif
      18.1 KB · Views: 1,589
    • old.gif
      old.gif
      129.4 KB · Views: 1,573
    Last edited:
    239
    Posts
    8
    Years
    • Seen Apr 15, 2024
    [Pokeemerald] Better Reflection System

    Normally, reflection sprites are shown on any layer except the bottom, meaning that your reflection would persist under grass if it was found at the edge of a puddle, etc. This fixes that problem:

    74FslCl.gif


    See the wiki post here

    What you sacrifice by using this
    • Your reflection tip will now be cutoff if you are one tile away from the edge of the water to the north. This is better than having a full reflection under grass though, imo
    • Your reflection tip will still appear under grass/whatever if you are at the southern edge of a reflective surface.
    • Your reflection dissapears as you start to step, so it will dissapear as you move off the southern edge of a puddle, for example.
     
    Last edited:
    34
    Posts
    2
    Years
    • Seen Aug 13, 2023
    [Pokeemerald] Ingame trade with yourself (Trade evolutions)
    Set up an ingame trade with yourself to get trade evolutions without a second player.

    There are two versions:
    Version 1 is the quicker option and directly trades your pokemon back to yourself:
    2KidbQP.gif


    Version 2 trades a predefined pokemon to the player and then trades it back for the players original one:
    EB34g0J.gif


    How to:
    Preparations: First we implement the "Dynamic Trading Names" fix.

    Open src/trade.c and find void CreateInGameTradePokemon(void). Change it to:
    Spoiler:
    Then open the script file for the map you want to change, e.g. data/maps/OldaleTown/scripts.inc and add:
    Spoiler:

    Now just add a goto SCRIPT_SelfTrade_V1 or goto SCRIPT_SelfTrade_V2 where you want the script to start. Have fun!


    CREDIT:
    TheXaman

    I know this thread isn't for asking for help, but wanted to flag that I can only get this to work in a completely vanilla build. Once any changes are made (such as merging your Debug System, or other simple mod changes) this completely breaks. V1 will fill your party with bad eggs and cause other strange errors, and V2 crashes the game completely.

    Not sure what's going on, but would love to help you look into it since it's a cool concept for a mod.
     
    180
    Posts
    6
    Years
    • Seen Apr 15, 2024
    I know this thread isn't for asking for help, but wanted to flag that I can only get this to work in a completely vanilla build. Once any changes are made (such as merging your Debug System, or other simple mod changes) this completely breaks. V1 will fill your party with bad eggs and cause other strange errors, and V2 crashes the game completely.

    Not sure what's going on, but would love to help you look into it since it's a cool concept for a mod.

    I have implemented it in a pokeemerald with the debug system and pokemon-expansion, and it hasnt broken the game once

    maybe theres something you're missing from here?
     

    paccy

    Pokeholic
    42
    Posts
    14
    Years
  • [Pokeemerald] Change the Clock Time

    This will allow you to change the time when viewing the clock.

    In wallclock.c change the function Task_ViewClock_HandleInput to:
    Code:
    static void Task_ViewClock_HandleInput(u8 taskId)
    {
        InitClockWithRtc(taskId);
        if (JOY_NEW(A_BUTTON | B_BUTTON))
            gTasks[taskId].func = Task_ViewClock_FadeOut;
        if (JOY_NEW(R_BUTTON)){
            PlaySE(SE_SELECT);
            LZ77UnCompVram(gWallClockStart_Tilemap, (u16 *)BG_SCREEN_ADDR(7));
            AddTextPrinterParameterized(1, FONT_NORMAL, gText_Confirm3, 0, 1, 0, NULL);
            PutWindowTilemap(1);
            ScheduleBgCopyTilemapToVram(2);
            gTasks[taskId].func = Task_SetClock_HandleInput;
        }
    }

    Now you can press the R button to change the time, or change R_BUTTON to any other button you want.
     
    Back
    Top