• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Simple Modifications Directory

Adding the Fairy Type (Em)
I was bored, so I inserted the Fairy Type in a clean copy of Pokeemerald. Do I need to say anything else?
Hopefully, this can work as a template to learn how to insert entirely new types from.

The changes can be checked in this diff:
https://github.com/pret/pokeemerald/compare/master...LOuroboros:pokeemerald:fairy_type

To quickly incorporate it into a project, you just have to track my repository via git remote and pull the branch where I did the modifications using git pull, like so:
Code:
git remote add lunos https://github.com/LOuroboros/pokeemerald
git pull lunos fairy_type

Pics:
[PokeCommunity.com] Simple Modifications Directory

Note: I only changed the type of Pound locally. It's not like that in the commit, though that's something everyone can see.

And that's pretty much it.​
 
Last edited:
It's been a while since I've posted anything, so here's a small feature from fire red:

[Pokeemerald] Auto-read signposts

This feature allows the player to read a signpost by walking up to it, rather than needing to press A. The player is also able to walk away while the script is running.

[PokeCommunity.com] Simple Modifications Directory


How to add more signposts:
  • Currently, your tile must have behavior "MB_SIGNPOST" in order for this feature to work. Keep reading if you want to add new behaviors that the player can auto-read from
  • You can add a new signpost type based on these defines
  • Add your metatile behavior check here
  • Add your custom script in the switch statement here

How to add this feature:
 
[Pokéfirered] Remove FRLG item use animation screen

[PokeCommunity.com] Simple Modifications Directory


The little animation screen that plays when you use an item on a Pokémon in the field (medicine, TM/HM, Rare Candy, evolution stone, berry) may have looked cute when it came out, but right around your 340th time seeing it you'll be reaching for the fast-forward button.

These changes remove the screen entirely, so item use looks identical to RSE: https://github.com/pret/pokefirered/commit/b5cc9eb7bc167be1ee300e74bee0a49abf452fae
(Handy if you plan on also adding "repeated medicine use".)
 
[EM] ADDING EVs TO TRAINERS

This tutorial will allow you to add EV values to any trainers you wish.
Spoiler:
Spoiler:


I'd just like to add on to this a little bit if I can. Adding abilities for trainers is very similar.

In include/data.h, you'll need to add u8 ability; to the trainer structs of your choice (I only did it in this one)
Code:
struct TrainerMonItemCustomMoves
{
    u16 iv;
    u8 lvl;
    u8 evs[NUM_STATS];
    u16 species;
    u16 heldItem;
    [B][COLOR="Red"]u8 ability;[/COLOR][/B]
    u16 moves[MAX_MON_MOVES];
};

Then in src/battle_main.c, you'll need to add this line
Code:
            case F_TRAINER_PARTY_CUSTOM_MOVESET | F_TRAINER_PARTY_HELD_ITEM:
            {
                const struct TrainerMonItemCustomMoves *partyData = gTrainers[trainerNum].party.ItemCustomMoves;

                for (j = 0; gSpeciesNames[partyData[i].species][j] != EOS; j++)
                    nameHash += gSpeciesNames[partyData[i].species][j];

                personalityValue += nameHash << 8;
                fixedIV = partyData[i].iv * 31 / 255;
                CreateMon(&party[i], partyData[i].species, partyData[i].lvl, fixedIV, TRUE, personalityValue, OT_ID_RANDOM_NO_SHINY, 0);

                SetMonData(&party[i], MON_DATA_HELD_ITEM, &partyData[i].heldItem);

                [B][COLOR="Red"]SetMonData(&party[i], MON_DATA_ABILITY_NUM, &partyData[i].ability);[/COLOR][/B]

                for (j = 0; j < MAX_MON_MOVES; j++)
                {
                    SetMonData(&party[i], MON_DATA_MOVE1 + j, &partyData[i].moves[j]);
                    SetMonData(&party[i], MON_DATA_PP1 + j, &gBattleMoves[partyData[i].moves[j]].pp);
                }
                for (j = 0; j < NUM_STATS; j++)
                {
                    SetMonData(&party[i], MON_DATA_HP_EV + j, &partyData[i].evs[j]);
                }
                CalculateMonStats(&party[i]);
                break;
            }

You have to add it to all the applicable trainer parties now....yay~
0 will be it's first ability, 1 it's second (or hidden if it doesn't have a second), and 2 hidden (if it has two other abilities).
Code:
static const struct TrainerMonItemCustomMoves sParty_WallyMauville[] = {
    {
    .iv = 0,
    .lvl = 5,
    .evs = {0, 0, 0, 0, 0, 0},
    .species = SPECIES_RALTS,
    .heldItem = ITEM_NONE,
    [B][COLOR="Red"].ability = 1;[/COLOR][/B] // gives Ralts the ability Trace
    .moves = {MOVE_GROWL, MOVE_CONFUSION, MOVE_NONE, MOVE_NONE}
    } 
};

I hope this helps for people who want to add extra challenge in their games.
 
Last edited:
Custom Battle Music Via Scripting (Emerald / Firered)

This modification allows you to set any song to play during the next battle from a script.
Spoiler:
 
Implement a metatile behavior for Feebas encounters (Emerald)

A very simple little tweak.

https://github.com/surskitty/pokeemerald/commit/fea41dbc7a8620782b1c1a67f60db6aaddca46c1

You can then use Porymap to edit Route 119, make a new tile with the behavior MB_FEEBAS, and use that tile to set that as the location for Feebas.

In ORAS, Feebas are found under the bridge next to the Weather Institute during the daytime, and by the rock in the water at the southern end of Route 119 during the night.

Code:
git remote add surskitty https://github.com/surskitty/pokeemerald
git cherry-pick fea41dbc7a8620782b1c1a67f60db6aaddca46c1
 
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.
[PokeCommunity.com] Simple Modifications Directory
[PokeCommunity.com] Simple Modifications Directory


1. Installation
Spoiler:


2. Adding new mugshots
Spoiler:


3. Using mugshots in a script
Spoiler:
 
Last edited:
Code:
void DrawMugshot();
void DrawMugshotAtPos();
void ClearMugshot();
Hiya, I guess you're a C++ programmer. Unlike C++ where empty parens mean "no parameters", in C what you've written is prototypes that can take any arguments at all (think something like how ... is used by printf). You'd want to write, e.g. void DrawMugshot(void);. (It's not going to break anything if you don't, but it's pretty bad style and can mask errors when you get it wrong in header files!)
 
Locktarget Overworld scripting command (Em)
About an hour ago, SBird in Pret's Discord server brought up how the lock scripting command locks the movement of all the event objects on screen instead of just locking the event object that the Player is interacting with.
I decided to take a stab at it since it sounded like a fairly easy thing to address.

The changes can be checked in this commit:
https://github.com/LOuroboros/pokeemerald/commit/05f57351a0cf8a97134d7ef5067d4e68aab5bb1c

To quickly incorporate it into a project, you just have to track my repository via git remote and pull the branch where I did the modifications using git pull, like so:
Code:
git remote add lunos https://github.com/LOuroboros/pokeemerald
git pull lunos locktarget

Note: Depending on the feature branches you use in your project, you may need to adjust some of these values.
For example, if you added other new scripting commands to your project you'll need to change the internal ID of locktarget from 0xe3 to something else.


Pic:
[PokeCommunity.com] Simple Modifications Directory


And that's pretty much it.​
 
Making Pokémon with Poison Heal be unaffected by poison in the overworld (Em)
Note: Poison Heal is an ability introduced in Gen. 4 and it's naturally not present in Pokemon Emerald by default.
This is mainly an optional thing you can add to projects that make use of DizzyEgg's battle_engine.


Earlier, Meister_anon from this forums' Discord server asked some tips because they wanted to make Pokémon with the Poison Heal ability not be affected by poison in the overworld, an effect that should have been implemented in the official games since its introduction, imo.
I decided to take a stab at it since it sounded like a fairly easy thing to do.

There are no commits this time. I won't make a branch because it's so utterly simple it doesn't warrant making one.
All you need to do is to go to the DoPoisonFieldEffect function in src/field_poison.c, and add the following check to the first if statement inside the for loop:
Code:
&& GetMonAbility(&gPlayerParty[i]) != ABILITY_POISON_HEAL

Don't forget to throw in a #include "pokemon.h" and a #include "constants/abilities.h" at the end of the header files list at the top of the file.
src/field_poison.c can't recognize constant labels for species abilities nor the GetMonAbility function by default.

Video:


And that's pretty much it.

EDIT (28/08/2023): I updated the post. I forgot to mention that include/pokemon.h has to be #included too.​
 
Last edited:
Excluding pokemon with Ability POISON_HEAL from overworld poison damage.

I started it, but most credit goes to Lunos, for the fix.

This works for all decomps far as I can tell, I've checked poke-emerald and poke-firered
this change goes in the field_poison.c file

[PokeCommunity.com] Simple Modifications Directory
 
Remove the need to water berries on rainy Routes (Emerald)

Ever watered berry trees in the thunderstorm on Route 119 and thought "this makes no sense"?

This little tweak will make any berry trees on specified routes give out their maximum number of berries all the time, as if the weather watered them for you!

Go to src\berry.c and find the function named GetBerryCountByBerryTreeId().
Replace it with the following:
Code:
static u8 GetBerryCountByBerryTreeId(u8 id)
{
    struct BerryTree *tree = GetBerryTreeInfo(id);
    const struct Berry *berry = GetBerryInfo(tree->berry);
    u16 currentMap = gMapHeader.regionMapSectionId;

    if (currentMap == MAPSEC_ROUTE_119 || currentMap == MAPSEC_ROUTE_120 || currentMap == MAPSEC_ROUTE_123)
        return berry->maxYield;
    else
        return gSaveBlock1Ptr->berryTrees[id].berryYield;
}
Then you'll probably need to add #include constants/map_groups.h at the top of src\berry.c so the compiler recognizes the map names.

The maps used here are just examples, so you can change them to whatever condition you want.
 
Last edited:
Prevent Map Fade With A Flag (Emerald)

This modification allows you to stop the screen from fading after loading a map - useful for cutscenes.

[PokeCommunity.com] Simple Modifications Directory


Spoiler:
 
Moderator notice:
We highly recommend reviewing the pokeemerald tutorials at the pokeemerald wiki, viewable here, as they are much more regularly maintained:
https://github.com/pret/pokeemerald/wiki/Tutorials

––––
Original post follows:

I noticed that despite being updated recently, the starting post is missing quite a few older modifications.
Here is a list of them:

Spoiler:


Update: Now contains modifications up to page 17
 
Last edited by a moderator:
Greetings everyone, I've got a pretty desirable fix I think, with credit and thanks to Buffel Saft, for helping me understand the function, I was able to figure a simple way of adding fairy type to hidden power.

It's just a simple C trick but this should work for firered and leaf green. Emerald doesn't seem to have mystery type so unfortunately this wouldn't work for it.

in pokefirered there's a line of code that essentially says, if hidden power type is greater or equal to type mystery add 1. (this is to remove mystery type from pool of possible results.

Code:
if (gBattleStruct->dynamicMoveType >= TYPE_MYSTERY)
  gBattleStruct->dynamicMoveType++;
the ++ is the plus 1.

now from messing around with effect spore I learned a trick of replacing an effect by setting it equal to another field. And that's what I did to get fairy in.
I replaced the above with this...

Code:
if (gBattleStruct->dynamicMoveType == TYPE_MYSTERY)
  gBattleStruct->dynamicMoveType = TYPE_FAIRY;
 
Greetings everyone, I've got a pretty desirable fix I think, with credit and thanks to Buffel Saft, for helping me understand the function, I was able to figure a simple way of adding fairy type to hidden power.

It's just a simple C trick but this should work for firered and leaf green. Emerald doesn't seem to have mystery type so unfortunately this wouldn't work for it.

in pokefirered there's a line of code that essentially says, if hidden power type is greater or equal to type mystery add 1. (this is to remove mystery type from pool of possible results.

Code:
if (gBattleStruct->dynamicMoveType >= TYPE_MYSTERY)
  gBattleStruct->dynamicMoveType++;
the ++ is the plus 1.

now from messing around with effect spore I learned a trick of replacing an effect by setting it equal to another field. And that's what I did to get fairy in.
I replaced the above with this...

Code:
if (gBattleStruct->dynamicMoveType == TYPE_MYSTERY)
  gBattleStruct->dynamicMoveType = TYPE_FAIRY;
Emerald does have the Mystery Type. Every game up to HeartGold and SoulSilver have it, in fact, as it was removed in Black and White (1).
It's highly likely your modification will work on a clean copy of Pokeemerald normally, assuming Hidden Power's type can be set to Type Mystery normally.
 
Last edited:
Code:
if (gBattleStruct->dynamicMoveType == TYPE_MYSTERY)
  gBattleStruct->dynamicMoveType = TYPE_FAIRY;

I might be mistaken, but won't this basically replace Hidden Power Dark with Fairy?

My thinking is that before the numbers worked like this:
Code:
 i | i + 1
 9 | TYPE_FIRE (10)
10 | TYPE_WATER (11)
11 | TYPE_GRASS (12)
12 | TYPE_ELECTRIC (13)
13 | TYPE_PSYCHIC (14)
14 | TYPE_ICE (15)
15 | TYPE_DRAGON (16)
16 | TYPE_DARK (17)
But now that you've replaced ++ (i.e. + 1) with turning TYPE_MYSTERY (8) into TYPE_FAIRY (18) you get this:
Code:
 i | i == 8 ? 18 : i
 9 | TYPE_FAIRY (18)
10 | TYPE_FIRE (10)
11 | TYPE_WATER (11)
12 | TYPE_GRASS (12)
13 | TYPE_ELECTRIC (13)
14 | TYPE_PSYCHIC (14)
15 | TYPE_ICE (15)
16 | TYPE_DRAGON (16)

I think you both need to generate a number that's 1 bigger and remap TYPE_MYSTERY to TYPE_FAIRY to have all the types. This might actually be working on your thread? I saw you and Buffel Saft made some changes to how dynamicMoveType was calculated.
 
Back
Top