• 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

17
Posts
3
Years
    • Seen today
    Display Mugshots/Other Images In The Overworld (Emerald / Firered)

    This modification allows you to load images onto BG0 from a script. It can only show one 16-color image at a time.
    53dUjef.png
    XVCLIMD.png


    1. Installation
    Spoiler:


    2. Adding new mugshots
    Spoiler:


    3. Using mugshots in a script
    Spoiler:

    I have an issue for some larger mugshots and text
    So my Mugshot here is 104 pixels tall, 240 wide. But when text comes up it glitches like so
    unknown.png


    Params in Mugshot.c

    Code:
    [MUGSHOT_MENUA] = {.x = 0,.y = 0,.width = 240,.height = 104,.image = sMugshotImg_MenuA,.palette = sMugshotPal_MenuA},
     
    449
    Posts
    6
    Years
    • Seen today
    I have an issue for some larger mugshots and text
    So my Mugshot here is 104 pixels tall, 240 wide. But when text comes up it glitches like so
    unknown.png


    Params in Mugshot.c

    Code:
    [MUGSHOT_MENUA] = {.x = 0,.y = 0,.width = 240,.height = 104,.image = sMugshotImg_MenuA,.palette = sMugshotPal_MenuA},

    The mugshot window's tiles are getting overwritten by the text window's tiles in vram.
    You can change where the text tiles are loaded by editing this line, setting it to 0x240 seems to work but I haven't tested it much so it might break something else.

    Also my mugshot code loads the tiles starting at tile 0x40 for some reason (I think I just copy-pasted it from somewhere). You could set the last parameter of SetWindowTemplateFields in mugshot.c to 0 to get a few extra tiles to work with, but setting the text tiles to load at 0x240 is already enough to fix the graphical issues.
     
    17
    Posts
    3
    Years
    • Seen today
    The mugshot window's tiles are getting overwritten by the text window's tiles in vram.
    You can change where the text tiles are loaded by editing this line, setting it to 0x240 seems to work but I haven't tested it much so it might break something else.

    Also my mugshot code loads the tiles starting at tile 0x40 for some reason (I think I just copy-pasted it from somewhere). You could set the last parameter of SetWindowTemplateFields in mugshot.c to 0 to get a few extra tiles to work with, but setting the text tiles to load at 0x240 is already enough to fix the graphical issues.

    Thanks, did the latter and it resolved the issue!

    I wonder if there's a way to have multiple mugshots on at once...
     
    449
    Posts
    6
    Years
    • Seen today
    I wonder if there's a way to have multiple mugshots on at once...
    An easy solution is to create a new large mugshot containing all the images you want to show, but this limits you to just 15 colors and gets tedious fast if you need multiple mugshots often in your hack.
    The code could be altered to allow for more mugshots but that would complicate the scripting interface. I might look into adding support for a second mugshot at some point.
     
    239
    Posts
    8
    Years
    • Seen Apr 15, 2024
    [Pokeemerald] UI Helper

    M8eAmkz.gif


    This branch isn't meant to be a standalone feature, but rather a tool to help users create their own menus. It is just a basic UI loading sequence with no functionality, but should help guide users through the process.

    How to Pull:

    The base UI is loaded from the start menu, but you just need to call Menu_Init from elsewhere to have it loaded from another place.
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • [Pokeemerald] Bag Sorting

    This feature adds bag sorting by the following:
    • Name (alphabetical)
    • Quantity (most -> least)
    • Type (see gItemsByType)

    G6ocszA.gif
    9OOVCOp.gif
    4SxLHHB.gif


    Here is the repo.

    How to Activate: Press the Start Button in the bag.

    How To Add:
    Credit:
    • Skeli / CFRU source
    At first I thought that I was somehow making a mistake while merging in the branch, but then I decided to just clone it straight from your repository and it turns out that currently, the branch has a couple of minor issues.

    If you select an item after the first one in a pocket, a grey arrow is created for whatever reason.
    l6Px3ij.gif

    EDIT: It seems this regression was introduced at some point after March 28, which is when I originally merged this.
    I just merged that copy of mine instead of pulling yours and it's working fine, save for the Key Items issue that I already know how to work around.
    I had to merge it again in a new branch, and since I figured you could have updated it, I pulled it anew and that's how I found out about the grey arrow.

    Also, the issue with the Key Items that I talked to you about twice or thrice is still there too.


    EDIT: Oh yeah, I also noticed that sItemsByType is missing support for the X Items from the item_expansion which were renamed, even though you are making use of the ITEM_EXPANSION constant, and it's also missing ITEM_X_SP_DEF.
     
    Last edited:
    51
    Posts
    13
    Years
  • pokeemerald: Competitive IVs for Eggs

    At "include/constants/daycare.h" delete the line "#define INHERITED_IV_COUNT" (it won't be used).

    Next, open "src/daycare.c"

    Go to "static void InheritIVs(struct Pokemon *egg, struct DayCare *daycare)" and replace it with this:

    Code:
    // Competitive IVs for most stats
    static const u8 Egg_IV_List_1[] =
    {
    	30, 
    	31
    };
    
    // Competitive IVs for ATK and Speed
    static const u8 Egg_IV_List_2[] =
    {
    	0,
    	2,
    	30, 
    	31
    };
    
    static void InheritIVs(struct Pokemon *egg, struct DayCare *daycare)
    {
        u8 iv;
    
    	// Note: If you only want perfect IVs, change each instance of "iv = etc" to this:
    	//iv = 31;
    	iv = Egg_IV_List_1[Random() % 2];
    	SetMonData(egg, MON_DATA_HP_IV, &iv);
    	iv = Egg_IV_List_2[Random() % 4];
    	SetMonData(egg, MON_DATA_ATK_IV, &iv);
    	iv = Egg_IV_List_1[Random() % 2];
    	SetMonData(egg, MON_DATA_DEF_IV, &iv);
    	iv = Egg_IV_List_2[Random() % 4];
    	SetMonData(egg, MON_DATA_SPEED_IV, &iv);
    	iv = Egg_IV_List_1[Random() % 2];
    	SetMonData(egg, MON_DATA_SPATK_IV, &iv);
    	iv = Egg_IV_List_1[Random() % 2];
    	SetMonData(egg, MON_DATA_SPDEF_IV, &iv);
    }

    With this change, the offspring's IVs will be set randomly to 30/31 for HP/Def/SP.Atk/SP.Def and 0/2/30/31 for Atk/Speed.
     
    Last edited:
    449
    Posts
    6
    Years
    • Seen today
    Wrong Save Type Error Screen (Emerald)

    Normally if you load the game without a flash chip present on the cart (=on an emulator with the wrong save type setting), the game immediately crashes on a white screen.
    This modification replaces that with an error screen.

    NYZsAcO.png


    How to:
    Spoiler:
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Restoring the Shred Split Battle Transition [Em]
    In Pret's Discord, "Dat.H A" (here known as "Sonikku A") talked some days ago about this battle transition that Game Freak didn't finish but left in the game's code.
    I looked into it as I was bored enough, and I managed to fix it.
    I didn't make a branch because there's no point; it's easy enough to do manually.
    It's just a matter of removing ShredSplit_BrokenCheck, from sShredSplit_Funcs in src/battle_transition.c.
    Optionally, you can also remove the ShredSplit_BrokenCheck function and its declaration afterward, both located in the same file.

    The effect looks like this in game:
    FwGE42S.gif


    And that's pretty much it.

    EDIT: I edited the post. GriffinR taught me a much easier way to get this working. Still left the original post at the end for archival purposes.​

    Original post:
    Spoiler:
     
    Last edited:
    449
    Posts
    6
    Years
    • Seen today
    Remove Map Popups On Maps With The Same Map Section (Emerald)

    When you walk between two maps the name popup shows up even if both maps have the same map section.
    Baj4HwZ.gif


    This is not the case in Firered and even Emerald has code for preventing this but it's only used in the battle frontier.
    We can fix this easily by removing the battle frontier check (highlighted in red) from src/overworld.c
    Code:
        if ([COLOR="Red"]gMapHeader.regionMapSectionId != MAPSEC_BATTLE_FRONTIER
         ||[/COLOR] gMapHeader.regionMapSectionId != sLastMapSectionId)
            ShowMapNamePopup();
    K5LJmti.gif
     
    Last edited:

    PSF

    fangame developer
    9
    Posts
    3
    Years
  • [Pokeemerald] No Whiteout After Player Loss


    184964171-5c1516be-d471-42e7-b872-89af2ae8ae2b.png

    184756042-67682568-822d-4941-ba59-5e35f6d5cfe0.png


    In many video games, it is common to have a foe that you simply cannot defeat. In Emerald, when your character whites out, you are normally transported back to the last heal location you used. This modification will allow the player to continue after losing and is designed primarily for use in cutscenes and special events.

    Thank you very much to Jaizu who contributed to this modification.

    Installation
    git merge (recommended)
    These instructions assume that you are able to build pokeemerald, have a basic understanding of C, and are familiar with using the ingame scripting language. If you do not, please watch the tutorial series from Team Aqua's Hideout.
    From the root directory of your project, run the following commands in your terminal program of choice:
    Code:
    git remote add psf https://github.com/PokemonSanFran/pokeemerald/ # This adds our team's pokeemerald branch as a remote repo.
    git pull psf no-whiteout #This pulls in the no-whiteout feature branch

    Manual merge
    If your project is:
    • Too far behind pokeemerald
    • Using a different base (pokeemerald-expansion or pokefirered)
    • Some other reason that I can't think of
    You can manually implement the features using the diff between this branch and vanilla pokeemerald as a guide. You will need to manually edit or create each of these files in your own project to recreate the feature properly.

    Contributors
    JaizuFangaming#2172
     
    Last edited:
    17
    Posts
    3
    Years
    • Seen Jul 8, 2022
    [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.

    1. Adding a new special
    Spoiler:


    2. Setting up the different encounters
    Spoiler:

    And there you have it, day and night encounters. Ofcourse if you also want morning and evening encounters, you would need to add more groups in porymap and also add more scripts to adjust the Var to the value corresponding with your time of day.

    Thanks again to AmbientDinosaur! Here is the OP https://www.pokecommunity.com/showpost.php?p=10315616&postcount=236
     
    Last edited:
    30
    Posts
    4
    Years
    • Seen May 4, 2024
    [pokeemerald]Remove the Low Health Beep
    This is a minor hack, but I thought it might be appreciated.
    In:
    Code:
    src\battle_gfx_sfx.c
    Spoiler:
    That's about it. After this, you'll be free from that annoying beeping. My goal would be to make it beep a couple of times only, like in the newer games, but I have no idea how to pull that off.

    I figured out how to do this for FireRed (easily ported to Emerald, etc), dunno if you or anyone else cares but I'll explain how quickly.

    You need to edit "sound\songs\midi\se_low_health.s" and change this ↓

    Spoiler:

    to this ↓

    Spoiler:

    What this essentially does is get rid of the GOTO loop and tells it to beep five times instead. I've slightly lengthed each beep with back to back ".byte W12", it sounds fine and stops after playing. Can easily change it to three beeps, seven, whatever. Once health is increased out of the red, everything loops around properly as you'd expect. FYI, I'm not a programmer or reverse-engineer or anything, so it's very possible there's a better/cleaner way to do this. Thanks for reading!
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Randomizing the Player's party's moves [Em]
    In Pret's Discord, "Mous" brought up this idea, and I was bored.
    Doesn't need much explanation, does it?
    It's a special that when triggered, randomizes the 4 moves of each Pokémon in the Player's party.

    Define the special in data/specials.inc and #include "pokemon.h" like you'd normally do, and then paste this function somewhere.
    I personally like to put every thing that I trigger from the overworld in src/field_specials.c.
    Code:
    void RandomizePartyMoves(void)
    {
        u32 i, j;
    
        for (i = 0; i < CalculatePlayerPartyCount(); i++)
        {
            for (j = 0; j < 4; j++)
            {
                u16 randomMove = Random() % MOVES_COUNT;
                if (randomMove == 0)
                    randomMove = 1;
                SetMonMoveSlot(&gPlayerParty[i], randomMove, j);
            }
        }
    }

    Showcase:
    pn_3216.gif


    And that's pretty much it.​
     

    bitKoder

    completely unreasonable
    36
    Posts
    7
    Years
    • Seen Feb 28, 2024
    [EM] Fast Surfing

    To get the player to surf at mach bike speeds:

    In src/field_player_avatar.c at line 640: replace PlayerGoSpeed2 with PlayerGoSpeed4

    Alternatively, replace with the following code to "Run" at mach bike speeds while surfing
    Code:
    if (heldKeys & B_BUTTON)
        PlayerGoSpeed4(direction);
    else
        PlayerGoSpeed2(direction);

    2N98kM4.gif

    I'm trying to implement this currently on an up-to-date pokeemerald decomp, but line 640 of src/field_player_avatar.c actually contains just a {, and as best I can tell the line closest to this is line 634, which is inside a surfing check.
    However, instead of a numeric value, line 634 uses the method PlayerWalkFast(direction), and the PlayerWalkFast method uses PlayerSetAnimId(GetWalkFastMovementAction(direction), COPY_MOVE_WALK), and try as I might, I cannot track down any kind of numeric value attributed to any of these names. Can I have some help with this? Thanks :)
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • I'm trying to implement this currently on an up-to-date pokeemerald decomp, but line 640 of src/field_player_avatar.c actually contains just a {, and as best I can tell the line closest to this is line 634, which is inside a surfing check.
    However, instead of a numeric value, line 634 uses the method PlayerWalkFast(direction), and the PlayerWalkFast method uses PlayerSetAnimId(GetWalkFastMovementAction(direction), COPY_MOVE_WALK), and try as I might, I cannot track down any kind of numeric value attributed to any of these names. Can I have some help with this? Thanks :)
    https://github.com/pret/pokeemerald/blob/master/src/field_player_avatar.c#L631-L636

    Also yeah, instead of PlayerGoSpeed4 and PlayerGoSpeed2, those functions were recently given proper names.
    PlayerGoSpeed4 is now PlayerWalkFaster and PlayerGoSpeed2 is now PlayerWalkFast.

    Basically, you'll want to do something like this:
    Code:
         if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING)
         {
    [COLOR="Red"]-        // same speed as running
    -        PlayerWalkFast(direction);[/COLOR]
    [COLOR="Green"]+        if (heldKeys & B_BUTTON)
    +            PlayerWalkFaster(direction);
    +        else
    +            PlayerWalkFast(direction); // same speed as running[/COLOR]
             return;
         }
     
    30
    Posts
    4
    Years
    • Seen May 4, 2024
    [Pokefirered] Pokeemerald Bag Sort Ported (Credit: ghoulslash)

    With ghoulslash guidance (Thanks!), I finally ported this to pokefirered.
    Same activation method: Press Start in the bag.

    giphy.gif


    Instructions: https://github.com/lioniac/pokefirered/commit/a46c37af34d913019589abe14b5ecb49c22f5484

    I've fixed most of the minor issues with this, such as the text colour, alignment, etc. I also fixed a missing BagDestroyPocketScrollArrowPair(); that causes an overflow after too many failed attempts to sort, but for the life of me I *cannot* figure out how to fix the glitch when you cancel or press B instead of choosing a sort option. The sub-menu disappears but still exists, so you have to press cancel or B again to finally get back. Any idea on how to resolve this?

    No longer necessary, Deokishisu fixed this in his FRLG+ commits.
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Shortcut to run quickly from wild battles [Em]
    I did this back in October, but I only polished it enough to post it about 5 minutes ago.
    So, Pokémon: Let's Go, Pikachu/Eevee! allow you to run away from battles quickly by pressing the B button in the battle command selection.
    Well, I implemented that in Pokeemerald.
    I added a prompt to confirm it 'cause it'd suck to press it by accident against a shiny, a legendary or w/e, but y'all can remove it if you don't like it.

    Showcase:


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

    Notes:
    -I suggest implementing it manually for those who use the battle_engine, but just in case, I made use of the BATTLE_ENGINE constant to highlight any specific changes.
    -If you don't want to have the confirmation prompt, the only changes you need are those in the HandleInputChooseAction function. That's it.

    EDIT: For an alternative, you can check what Deokishisu did in their project, Pokémon FR/LG+.
    The way in which their implementation works is that instead of either bringing up a prompt or executing the Run option automatically, it simply takes the cursor there.
    As a result, the Player would merely need to do B+A.
    EDIT2: And here's the change for safari battles, which are handled in a separate file.

    And that's pretty much it.​
     
    Last edited:

    POKéMIKE1

    AKA meejle
    85
    Posts
    14
    Years
  • [pokefirered] Upper To Lowercase Swap When Naming

    Like most things, this exists for Pokeemerald, but not Pokefirered.

    Sadly I'm already quite deep into making a FireRed hack, so I thought, heck, how hard can it be?

    In your src/naming_screen.c file, find the following function:

    Code:
    static void AddTextCharacter(u8 ch)
    {
        u8 index = GetTextCaretPosition();
    
        sNamingScreenData->textBuffer[index] = ch;
    }

    And replace it with this:

    Code:
    static void AddTextCharacter(u8 ch)
    {
        u8 index = GetTextCaretPosition();
    
        if (GetTextCaretPosition() == 0) {
            if ((sNamingScreenData->currentPage == KBPAGE_LETTERS_UPPER)) {
                MainState_StartPageSwap();
                sNamingScreenData->textBuffer[index] = ch;
            }
            else {
                sNamingScreenData->textBuffer[index] = ch;
            }
        }
        else {
            sNamingScreenData->textBuffer[index] = ch;
        }
    }

    To be honest, it was way easier than I expected it to be.

    My code probably sucks, but at least maybe it'll point people in the right direction. 😁
     
    Last edited by a moderator:
    Back
    Top