• 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

Thought I'd share my modification of this too, as another option. I've tweaked AkimotoBubble's method a bit so that instead of pressing a different button for each set of stats, you can press A repeatedly to cycle through all of them:
[PokeCommunity.com] Simple Modifications Directory

Changes required are viewable in a commit here: link.
Make your modifications but I get a declaration error, why? the mistake is:
src/pokemon_summary_screen.c:3540: warning: implicit declaration of function `BufferStat'
 
Make your modifications but I get a declaration error, why? the mistake is:
src/pokemon_summary_screen.c:3540: warning: implicit declaration of function `BufferStat'
BufferStat is a function introduced by DizzyEgg's nature-based stat colors feature branch.
Also present in the Pokeemerald-Expansion's Upcoming branch. Eventually, it'll be merged into its Master branch as well.
 
Evolving a Pokémon from within the party screen [Em]
So, earlier, someone asked for help with a feature they were making in the community's Discord.
It seems to be a feature that I thought of implementing myself back when I played Pokémon Legends: Arceus, but never really ended up doing it because I'm just too lazy.
Today I kinda was super bored and just said "Fuck it, let's do it."
And so, here I am.

This feature branch adds a new option to the game's party screen through which you can evolve a Pokémon if their evolution conditions are met.
This naturally excludes Pokémon that evolve through the usage of items or that evolve by trading.
[PokeCommunity.com] Simple Modifications Directory

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

And that's pretty much it.
 
Make every Pokemon able to learn every HM [Emerald]

In the file src/party_menu.c, you'll want to find the function that starts with "static u8 CanMonLearnTMTutor"

To make the modification, you need to change the lines that look like the following.
C:
    if (item >= ITEM_TM01)
    {
        if (!CanMonLearnTMHM(mon, item - ITEM_TM01))
            return CANNOT_LEARN_MOVE;
        else
            move = ItemIdToBattleMoveId(item);
    }

This is what it will look like after the modification.
C:
    if (item >= ITEM_TM01)
    {
        if (item >= ITEM_HM01)
            move = ItemIdToBattleMoveId(item);
        else if (!CanMonLearnTMHM(mon, item - ITEM_TM01))
            return CANNOT_LEARN_MOVE;
        else
            move = ItemIdToBattleMoveId(item);
    }


Make every Pokemon able to learn every HM and TM [Emerald]

This is in the same post because it's a modification made to the same code block.
Again, the original looks like so.
C:
    if (item >= ITEM_TM01)
    {
        if (!CanMonLearnTMHM(mon, item - ITEM_TM01))
            return CANNOT_LEARN_MOVE;
        else
            move = ItemIdToBattleMoveId(item);
    }

We will have to modify it like so.
C:
    if (item >= ITEM_TM01)
    {
        move = ItemIdToBattleMoveId(item);
    }

This will already work, but if you care about tutor moves, keep reading.
Right after the code block we modified, we have code that looks like this.
C:
    else
    {
        if (!CanLearnTutorMove(GetMonData(mon, MON_DATA_SPECIES), tutor))
            return CANNOT_LEARN_MOVE;
        else
            move = GetTutorMove(tutor);
    }

Simply change it to.
C:
    else
    {
        move = GetTutorMove(tutor);
    }

I believed this can be also done to pokeemerald-expansion by deleting the following highlighted code in src/party_menu.c too. Making them accept only all HMs in that fork is possible but I didn't look into it, sorry.
Spoiler:
 
Last edited:
[PokeEmerald] Make Some Battle Transitions Be Similar to the FireRed.

For anyone familiar with all the GEN3 Pokemon games, there is no denying that the FireRed & LeafGreen is quite different from the RSE in many aspects. Take the battle transition as an example, anyone who had made a comparison between the FR's and the EM's would quickly find that some of the transitions in FR act & play much more quickly than the RSE's. Moreover, there are also a few of differences of the appearance in some specific transitions.
Well, since it had been proven that Emerald used the original FireRed codes as the base. It's the reality that both of these two games actually used the same codes and functions for controlling all those transitions, but with some tiny & little differences in specific vars, values, or some specific lines of the functions themselves. And now today, for any rom hacker who uses the PokeEmerald as the hacking base, but really wants to tweak & make itself more like the FireRed. The things I will provide here might be worth viewing. Anyway, it's also a reality that all things below are also nothing but just some tiny & simple modifications of vars and specific functions. But since there is no one post all these modifications anywhere till today. Therefore, I decide to post it here just to make a backup.
Here, it's time for this long & dreadful tutorial.
(Moreover, really sorry & please forgive my Poor English since I'm not a native speaker of all the Latin Languages. It's really difficult for me to write such a long article in alphabet.)

1. The Scrolling PokeBall.

For anyone familiar with the GEN3 games, it would be the most well-known battle transition just because it appears before all the trainer battle that the the level of the foe's pokemon is lower than the first pokemon's in the team.
For anyone who is still not familiar with it. Or just don't know what I'm talking about. Here is the picture of the comparison. (I use BPRJ for the example of the FireRed, it's no need to recreate a brand new save file but the same as the English Version).
Spoiler:

The picture above shows that not only the number of the pokeball lines, but also the speed of this transition is different in both of these two games. Luckily, after some research and comparison, things come clear that all of these variations was controlled just by one specific struct line.
Well it's time for the modification, to make this transition the same as that in the FireRed. The only thing we should do is to open the file named "battle_transition.c", and then search the struct lines named "sPokeballsTrail_Delays".
Spoiler:

Then, change it to:
Code:
static const s16 sPokeballsTrail_Delays[NUM_POKEBALL_TRAILS] = {0, 16, 32, 8, 24};
Here is the picture of the modification:
Spoiler:

And here is the final result.
Spoiler:


2. The Angle Wipes
Another transition which appears frequently during the gameplay. It appears when the level of the foe's pokemon is equal to (or higher than) the first pokemon's in the team. While in the original FireRed, It must be played just before the first Rival battle with Green after choosing the starter.
Also, to make things easily understood, the comparison is here.
Spoiler:

Just as the comparison shows, the FireRed one plays a little bit quicker than the RSE one, which is also due to nothing but the difference between the var controlling the speed.
Also, in the "battle_transition.c" file, search and Jump to the struct line named "sAngledWipes_EndDelays".
Spoiler:

And then changes the vars of this lines to what I provide below:
Code:
static const s16 sAngledWipes_EndDelays[NUM_ANGLED_WIPES] = {1, 1, 1, 1, 1, 1, 0};
Here is the picture of this modification.
Spoiler:

And moreover, the result is here.
Spoiler:


3. The Full Screen Wave Animation.
Well, since Hoenn is the Region that has too much water. I guess that every player travelling with the pokemon on the sea must get bored or be fed with this transition. It appears when encountering a wild pokemon by surfing, whose level is equal to (or higher) than the first pokemon's in the team.
Although it's unnecessary for me to post a image of the original transition here, for the sake that there is still someone not knowing it. Here is the picture.
Spoiler:

Also, Compared to the two transitions I had shown before, the modification of this one is also very easy.
In the "battle_transition.c", just jump to the task named Ripple_Main, and change the condition for the second if & else structure.
From:
Code:
if (++task->tTimer == 81)
To:
Code:
if (++task->tTimer == 41)
The condition above controlling the time of this whole transition, what's more, except the changes of the condition itself, we also need to make a small change to the var of the palette fade function, which also appears in this if & else structure.
From:
Code:
BeginNormalPaletteFade(PALETTES_ALL, -2, 0, 16, RGB_BLACK);
To:
Code:
BeginNormalPaletteFade(PALETTES_ALL, -8, 0, 16, RGB_BLACK);
And that's all of it, Here comes a picture of what I had said above.
Spoiler:

And here is the result of this modification.
Spoiler:


4. The ClockWise Wipe.
This transition is specific for the wild battle in the cave. It appears when encountering a wild pokemon whose level is lower than the first pokemon's in the team.
By giving a quick comparison between the Emerald and the Firered, It's the truth that the one in the Firered acts much more quickly (At about 2x speed, remember this before the modification would be helpful.)
Here is the .gif file of the comparison:
Spoiler:

Also, this is because of the difference of the vars, which controls the speed of the process of fading screen black.
Till here, things start to become a little bit harder & more difficult. Unlike the previous three transitions, the process of this function had been divided into 4 parts, which is responsible for the different part of the whole screen.
Again in the "battle_transition.c" file, Search for five bool8 tasks named "ClockwiseWipe_XXX". (The string "XXX" can refer to "Topright", "Right", "Bottom", "Left" & "Topleft").
Spoiler:

Just by taking a more careful look of these five tasks, you would probably notice that a all of them have a similar kind of string format appeared in, which reads below.
Code:
sTransitiondata->tWipeEnd"a" "b" = "c"
Anyone don't know what I'm talking about, feel free to look at the picture below.
Spoiler:

In this string format, "a" refers to X or Y, which is the horizontal and vertical coordinate of the part of black screen. "b" refers to "+" or "-". And the other but most important part is the "c", which always be 16 or 8. Just by looking at this structure directly, it's easily to make clear that it takes the control of the speed of the fading black, also, in other words, the transition itself. And till now, the modification itself has become a simple & tiny text-editing work.
Therefore, in all these 5 tasks, the only var that needs dealing with is the "c". In the case c = 16, then change it to 32.
Spoiler:

And, in the case of 8, change it to 16.
Spoiler:

And here is the result in the .gif picture.
Spoiler:


5. The Transition of a "Big-Pokeball"
Honestly speaking, this transition is not often seen in the gameplay of. It only appears before the trainer battle when the level of foe's pokemon is equal to (or higher than) the level of the first pokemon in the team. while the battle itself must take place in some specific places, like some of the caves and the trainer tower.
For anyone still doesn't know what I'm talking about, please look at the picture of comparison.
Spoiler:


OK, It comes clear that the Firered one is also much more faster than the one with the same name in the RSE. However, unlike those four transitions I had told above, this needs a few more modifications of the functions themselves. Not only in the specific vars, but also the structure of the whole functions themselves.
(NOTE: Moreover, except for this "Big-Pokeball" transition, the two transitions of the "Logo of Team Aqua & Team Magma", and the three transitions of The "Three Legend Regis" also shares the same functions that I would modify below. Therefore, if you really want to make a modification on them, remember that all those 5 transitions above would also be changed by the time you giving the changes to the code. So Please be careful to do that.)
Back to the "battle_transition.c" file, and then jump to the bool8 task named "PatternWeave_Blend1", then do the change as the picture below.
Spoiler:

Also, for the convenience, feel free to copy to use the code I provided below. But Do Not FORGOT To CHANGE & KEEP the NAME of the Function And Vars BE THE SAME AS those appearing in your file. Since PokeEmerald is a project that update frequently.
Code:
static bool8 PatternWeave_Blend1(struct Task *task)
{
    sTransitionData->VBlank_DMA = FALSE;
    if (task->tBlendDelay == 0 || --task->tBlendDelay == 0)
    {
        task->tBlendTarget2++;
        task->tBlendDelay = 1;
    }
    sTransitionData->BLDALPHA = BLDALPHA_BLEND(task->tBlendTarget2, task->tBlendTarget1);
    if (task->tBlendTarget2 > 15)
        task->tState++;
        task->tSinIndex += 12;
        task->tAmplitude -= 384;
    SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude >> 8, DISPLAY_HEIGHT);

    sTransitionData->VBlank_DMA++;
    return FALSE;
}
Then, scroll down to another bool8 task named "PatternWeave_Blend2". Make some changes of the vars I provide below.
From:
Code:
    task->tSinIndex += 8;
    task->tAmplitude -= 256;
To:
Code:
if (task->tAmplitude > 0)
    {
       task->tSinIndex += 12;                    
       task->tAmplitude -= 384;
    }
    else
    {
        task->tAmplitude = 0;
    }
Here is the picture of what I'm talking about.
Spoiler:

After that, scroll down to the last related boot8 task named "PatternWeave_FinishAppear", delete the text below in the original code:
Code:
     task->tSinIndex += 8;
     task->tAmplitude -= 256;
And add the code below at that same place. Just a similar change to the previous step.
Code:
    if (task->tAmplitude > 0)
    {
        task->tSinIndex += 12;
        task->tAmplitude -= 384;
    }
    else
    {
        task->tAmplitude = 0;
    }
Also, since My English might be not clear, Here is the picture of what I'm talking about.
Spoiler:

In the end, scroll down to the last task function named "PatternWeave_CircularMask", and then change the condition of the first if& else structure.
From:
Code:
if (task->tRadiusDelta < (4 << 8))
To:
Code:
if (task->tRadiusDelta < (8 << 8))
And also, here is the picture of this step.
Spoiler:

And the result in the .gif picture.
Spoiler:


6. The "White Bar" Fade Transition.
Unlike all those five transitions above, this transition is probably the most difficult one to modify, which is specific for the wild battle. It appears when the level of the wild pokemon is equal to (or higher than) the first pokemon's in the team.
Here is a comparison of the FireRed one and the Emerald one, It appears that the FirerRed one here also has the shorter delay and the faster speed.
Spoiler:

Just like what I had explained above, while keeping the same of animation with the one of the Firered. the speed of this transition could also be changed just by editing the values controlling the delay.
Again, go back to the "battle_transition.c" file, try to search for the defination of the var named "NUM_WHITE_BARS", and also the construct line named "sWhiteBarsFade_StartDelays".
Spoiler:

And then change the original one to the codes that I provide below.
Code:
#define NUM_WHITE_BARS 6
static const s16 sWhiteBarsFade_StartDelays[NUM_WHITE_BARS] = {0, 9, 15, 6, 12, 3};
Here is the picture of what I'm talking about.
Spoiler:

After that, since the number of the white bars has been modified. To make the transition itself plays properly. There must be some modifications in the displaying tasks themselves.
Therefore, instead of the specific values, it's time to dig up the task themselves. Just by make a comparison with the one appears in the Firered. It's made clear that not only there are some changes of the vars that controlling the display of those white bars.
Firstly, it's the task named "WhiteBarsFade_StartBars", in which that we have got to change the Y position of the all of the white bars, which appears in the condition of a circle structure. Due to the change of the total number of them.
From:
Code:
for (i = 0, posY = 0; i < NUM_WHITE_BARS; i++, posY += DISPLAY_HEIGHT / NUM_WHITE_BARS)
To:
Code:
for (i = 0, posY = 0; i < NUM_WHITE_BARS; i++, posY += 27)
Here is the picture of what I'm talking about.
Spoiler:

Secondly, scroll down to the task named "WhiteBarsFade_WaitBars". And then also make a change to the condition appearing in the if & else structure.
From:
Code:
if (sTransitionData->counter >= NUM_WHITE_BARS)
To:
Code:
if (sTransitionData->counter >= NUM_WHITE_BARS - 1)
Here is the picture of it.
Spoiler:

Thirdly, scroll down to the task named "WhiteBarsFade_BlendToBlack", and then add the definition of the var "counter" in the whole function.
The code itself is here:
Code:
sTransitionData->counter = 0;
And here is the picture for the sake.
Spoiler:

Fourthly, scroll down to the next task named "WhiteBarsFade_End", and also add some definitions of the data to it.
The code is here:
Code:
   sTransitionData->counter += 480;
   sTransitionData->BLDY = sTransitionData->counter >> 8;
Also, here is the picture.
Spoiler:

And By finishing all things above, now it's time to make changes in the specific function.
The first one is a function named "HBlankCB_WhiteBarsFade", whose structure need to be changed due to the number of the whitebar had been reduced.
Here is the picture of specific changes.
Spoiler:

Also here comes the complete codes:
Code:
static void HBlankCB_WhiteBarsFade(void)
{
    vu16 index = REG_VCOUNT;

    if (index == 227)     
      index = 0;
      REG_BLDY = gScanlineEffectRegBuffers[1][index];
}
The Next one is "SpriteCB_WhiteBarFade", which is also the callback of the sprite of whitebars. Since it's a little bit difficult to explain briefly, here is just the picture of the changes. But all in all, it's nothing just some specific changes of the vars and condition.
Spoiler:

And here is the result, feel free to take a look.
Spoiler:


7. The Anti-ClockWise Spiral (An Unused Battle Transition of FireRed)
When I checked & compared all the battle transitions of the PokeFireRed & the PokeEmerald. I found this unused transition animation, which lies & only appears in the source code of the FireRed, but become unused at last.
For anyone interested in it, the effect of this transition is like the .gif I provide below.
Spoiler:

Well, unlike some of the other codes, it contains no function that only appears in FRLG, Therefore, It's pretty easy to port it directly to the Emerald Decomp just through the direct copy & paste, and with some simple edit of a few of vars and functions.
And that's what I had done before, Here, Feel free to Copy & Use all these codes directly here. Put it directly to the "battle_transition.c", which had been mentioned several times above.
Spoiler:

When you get all these finished, and Don't forget to give specific definition of all the function in it at the head of the files. You could do it just by copy & paste all these code to your source code file directly.
Code:
static void BT_Phase2AntiClockwiseSpiral(u8 taskId);
static bool8 BT_Phase2AntiClockwiseSpiral_Init(struct Task *task);
static bool8 BT_Phase2AntiClockwiseSpiral_Update(struct Task *task);
static void VBCB_BT_Phase2AntiClockwiseBlackFade(void);
Here is a picure of what I'm talking about.
Spoiler:

What's more, since this new battle transition had made a use of two vars which is finally became unused in the original PokeEmerald game. It's we that should reuse all these two vars before finally save the transition itself. The Reuse itself could be done simply by changing the name of the vars.
Spoiler:

After that, jump to the construct line named "sTasks_Main", and then give a brand-new name or definition for this newly added transition. Just like the picture below.
Spoiler:

And the last, do not forget to open the "battle_transition.h" file, give a new declaration of the newly added transition.
Spoiler:

And from now on, you can directly use & make it appear in the game by modifying the battle transition table that lies in the "battle_setup.c" file.


12.26 Update:
Addition: Change the "fade screen" introduction of all the transition task.

Just by comparing the intro task more in detail. I had found that not only the transition itself is different. But also the fade screen introduction of all the transition itself is also different.
Jump to the task name "Task_Intro" in the file "battle_transition.c", and then change the code below. This difference will be removed immediately.
From
Code:
CreateIntroTask(0, 0, 3, 2, 2)

To:
Code:
CreateIntroTask(0, 0, 2, 2, 2)

Here is also a picture of what I'm talking about.
Spoiler:


And that's all I want to explain (And to be honest, this tutorial may be the longest tutorial that I had ever written). Furthermore, if anyone find any bug, glitch, or just wrong place of this tutorial, feel free to leave a comment below or send a message to me.
Thanks for everyone's for spend time reading this such a long & hard-understanding tutorial. And sorry for my poor English again.
 
Last edited:
[PokeEmerald] Faster HP Drain for Pokemon whose max HP is lower than 48.

So, recently I checked & tried implementing the tutorial of Faster HP Drain posted in PokeEmerald wiki, it works perfectly however with one limitation. which said that the modification itself is not used for the mon whose max HP is lower than 48.
Well, To be honest, the Reason why I decided to did this is that I found it is Pokemon Procyon that had also done it for the Pokemon in low level. Whose max HP is undoubtedly lower than 48, but also has the faster HP drain (at about 2x speed) than the original game.
It's lucky that things had become clear after I took a brief look of the source code file. And finally get through that limitation. And today, here is the probably same method.
For anyone interested in it, here is a picture of what I'm talking about.
Spoiler:

To do this is just one step, after implementing the Faster HP Drain according to that tutorial, The next thing you should do is to search & jump to the function named "CalNewBarValue", which is also in "battle_interface.c" file. And then, changes the the line in that function below.
From:
Code:
s32 toAdd = Q_24_8(maxValue) / scale;
To:
Code:
s32 toAdd = Q_24_8(maxValue) / x;  //The "x" should be the same as the number that you had put in according to the tutorial.
Here is the picture of what I'm talking about, since I wanted the function similar to Pokemon Procyon, I put the number "24" here (also in the above "MoveBattleBar" function according to the original tutorial), which makes the speed of the HP drain doubled compared to the original.
Spoiler:

And that's all of it. Moreover, this modification itself also changes the speed of the EXP bar when it comes to display the acquiration of the EXP lower than 64. Therefore, if you want the EXP bar to keep in the same speed as original. Please add a condition or just copy, rename & redefine the original whole function to a brand new one, which is separated from the original, or in other words, only for the HP bar itself.
Moreover, if anyone here found a bug or glitch of this modification. Please leave a comment below or send a message to me.
Sorry for my poor English again and thanks for reading.
 
Last edited:
Showing IVs/EVs in Summary Screen [EM]

All of the code for this belongs in src\pokemon_summary_screen.c.

Find sStatsLeftColumnLayout (line 773 for me) and paste this below it:
Code:
static const u8 sStatsLeftColumnLayoutIVEV[] = _("{DYNAMIC 0}\n{DYNAMIC 1}\n{DYNAMIC 2}");
This is pretty much just to get rid of the "/" in the HP value.

Old way, where the stats are shown based on holding L/R as the stats screen loads:
Spoiler:


New way, where pressing L/R/Start while on the stats screen changes the numbers to IVs/EVs/stats immediately (thanks to AkimotoBubble for their original code):
Spoiler:


If you'd like, you can use both the old and the new methods in tandem, as they don't conflict with each other. Thanks again to AkimotoBubble for their code.
How do I make it appear as seen in the image when you go between IVS and EVS. L Button, R Button, STAR Button, No Buttons
 
Evolving a Pokémon from within the party screen [Em]
So, earlier, someone asked for help with a feature they were making in the community's Discord.
It seems to be a feature that I thought of implementing myself back when I played Pokémon Legends: Arceus, but never really ended up doing it because I'm just too lazy.
Today I kinda was super bored and just said "Fuck it, let's do it."
And so, here I am.

This feature branch adds a new option to the game's party screen through which you can evolve a Pokémon if their evolution conditions are met.
This naturally excludes Pokémon that evolve through the usage of items or that evolve by trading.
View attachment 109163

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

And that's pretty much it.
I really like this feature u made, but I compiled it I got these errors

src/party_menu.c:77:43: error: 'EVOS_PER_MON' undeclared here (not in a function)
77 | extern struct Evolution gEvolutionTable[][EVOS_PER_MON];
| ^~~~~~~~~~~~
/usr/lib/gcc/arm-none-eabi/12.2.1/cc1 -quiet <flags> -o build/modern/src/pokedex_area_region_map.o src/pokedex_area_region_map.c
src/party_menu.c: In function 'SetPartyMonFieldSelectionActions':
src/party_menu.c:2787:25: error: too few arguments to function 'GetEvolutionTargetSpecies'
2787 | u16 targetSpecies = GetEvolutionTargetSpecies(&gPlayerParty[gPartyMenu.slotId], EVO_MODE_NORMAL, ITEM_NONE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/global.h:560,
from src/party_menu.c:1:
include/pokemon.h:634:5: note: declared here
634 | u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem, struct Pokemon *tradePartner);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/arm-none-eabi/12.2.1/cc1 -quiet <flags> -o build/modern/src/pokedex_area_screen.o src/pokedex_area_screen.c
src/party_menu.c: In function 'CursorCb_Evolution':
src/party_menu.c:7702:25: error: too few arguments to function 'GetEvolutionTargetSpecies'
7702 | u16 targetSpecies = GetEvolutionTargetSpecies(&gPlayerParty[gPartyMenu.slotId], EVO_MODE_NORMAL, ITEM_NONE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/pokemon.h:634:5: note: declared here
634 | u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem, struct Pokemon *tradePartner);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/arm-none-eabi/12.2.1/cc1 -quiet <flags> -o build/modern/src/pokedex.o src/pokedex.c
make: *** [Makefile:389: build/modern/src/party_menu.o] Error 1
/usr/lib/gcc/arm-none-eabi/12.2.1/cc1 -quiet <flags> -o build/modern/src/pokedex_cry_screen.o src/pokedex_cry_screen.c
make: *** Deleting file 'build/modern/src/party_menu.o'
make: *** Waiting for unfinished jobs....


im using the expansion 1.7.1. could that be the reason?
 
I really like this feature u made, but I compiled it I got these errors

src/party_menu.c:77:43: error: 'EVOS_PER_MON' undeclared here (not in a function)
77 | extern struct Evolution gEvolutionTable[][EVOS_PER_MON];
| ^~~~~~~~~~~~
/usr/lib/gcc/arm-none-eabi/12.2.1/cc1 -quiet <flags> -o build/modern/src/pokedex_area_region_map.o src/pokedex_area_region_map.c
src/party_menu.c: In function 'SetPartyMonFieldSelectionActions':
src/party_menu.c:2787:25: error: too few arguments to function 'GetEvolutionTargetSpecies'
2787 | u16 targetSpecies = GetEvolutionTargetSpecies(&gPlayerParty[gPartyMenu.slotId], EVO_MODE_NORMAL, ITEM_NONE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/global.h:560,
from src/party_menu.c:1:
include/pokemon.h:634:5: note: declared here
634 | u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem, struct Pokemon *tradePartner);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/arm-none-eabi/12.2.1/cc1 -quiet <flags> -o build/modern/src/pokedex_area_screen.o src/pokedex_area_screen.c
src/party_menu.c: In function 'CursorCb_Evolution':
src/party_menu.c:7702:25: error: too few arguments to function 'GetEvolutionTargetSpecies'
7702 | u16 targetSpecies = GetEvolutionTargetSpecies(&gPlayerParty[gPartyMenu.slotId], EVO_MODE_NORMAL, ITEM_NONE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/pokemon.h:634:5: note: declared here
634 | u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem, struct Pokemon *tradePartner);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/arm-none-eabi/12.2.1/cc1 -quiet <flags> -o build/modern/src/pokedex.o src/pokedex.c
make: *** [Makefile:389: build/modern/src/party_menu.o] Error 1
/usr/lib/gcc/arm-none-eabi/12.2.1/cc1 -quiet <flags> -o build/modern/src/pokedex_cry_screen.o src/pokedex_cry_screen.c
make: *** Deleting file 'build/modern/src/party_menu.o'
make: *** Waiting for unfinished jobs....


im using the expansion 1.7.1. could that be the reason?
Yeah. The Pokeemerald-expansion no longer has an evolution table at all. Evolutions were refactored to be introduced as a part of the species data present in gSpeciesInfo.
 
POKEEMERALD
PSS IN THE START MENU
First, we add a new Flag in include/constants/flags.h
Code:
FLAG_POKEMONPCMENU
(this will be used after)
Then, we go to include/pokemon_storage_system.h
There, we add anywhere:
Code:
void EnterPokeStorage(u8);
Then we go to src/pokemon_storage_system.c, and we delete
Code:
static void EnterPokeStorage(u8);
(when its definied, the first one)
and we search for "static void EnterPokeStorage(u8 boxOption)", then we erase the "static " (the second one)
Then, we search for:
Code:
static void FieldTask_ReturnToPcMenu(void)
And we replace it entirely for this:
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();
    }
}
Then, we go to src/start_menu.c, and we search for: static bool8 StartMenuBagCallback(void);, and right after, we add:
static bool8 StartMenuPCCallback(void);
Then, we go to "{gText_MenuBag, {.u8_void = StartMenuBagCallback}}," and again we add bellow:
{gText_MenuPC, {.u8_void = StartMenuPCCallback}},
Then, we go to "static bool8 StartMenuBagCallback(void)" and after the whole funcion we add:
Code:
static bool8 StartMenuPCCallback(void)
{
    u8 taskId;
    if (!gPaletteFade.active)
    {
        PlayRainStoppingSoundEffect();
        RemoveExtraStartMenuWindows();
        EnterPokeStorage(x);
        return TRUE;
    }

    return FALSE;
}
(in my case, its "0" the number for the Move Pokémon System, but I have made some changes {I changed the Move option to the first place}, and I'm sure the original number for the option is "2"...)

Then, we search for: "MENU_ACTION_BAG"
And after we add: "MENU_ACTION_PC,"

Now we go to: "if (FlagGet(FLAG_SYS_POKEMON_GET) == TRUE)" and inside there we add:
AddStartMenuAction(MENU_ACTION_PC);
Like this:
Code:
    if (FlagGet(FLAG_SYS_POKEMON_GET) == TRUE)
    {
        AddStartMenuAction(MENU_ACTION_POKEMON);
        AddStartMenuAction(MENU_ACTION_PC);
    }
Then, we go to "AddStartMenuAction(MENU_ACTION_BAG);" and right after we add:
AddStartMenuAction(MENU_ACTION_PC);

Then, we go to data/scripts/pc.inc and we add this after "playse SE_PC_ON" in "EventScript_PC:: @ 8271D92":
setflag FLAG_POKEMONPCMENU
Now, after "special DoPCTurnOffEffect", in "EventScript_TurnOffPC:: @ 8271E47" we add:
clearflag FLAG_POKEMONPCMENU

Lastly, we need to add the strings for the PC in the Start Menu, (thanks, Lunos)
We go to include/strings.h and we add this somewhere:

extern const u8 gText_MenuPC[];

And this is the last step. We go to src/strings.c and we add this somewhere:
const u8 gText_MenuPC[] = _("PC");

And we're done! this time, we are We should be able to enter the Move Pokémon PC, and the Pokécenter PC's won't be affected.

[PokeCommunity.com] Simple Modifications Directory
Thank you and Lunos for this code, I have been trying really hard to help bring the PC to the player without needing to go to the PokeCenter.
I tried to make it a registerable key item with a huge help from Lunos, but still has a side of effect of not clearing a message after getting out of it. I just tried your code on the pokeemerald-expansion 1.7.1 and it gave me some errors. Retried it with some omissions and it works fine. Although I havent tested extensively. I would like to share what I omitted:

When you wrote:

Code:
    if (FlagGet(FLAG_SYS_POKEMON_GET) == TRUE)
    {
        AddStartMenuAction(MENU_ACTION_POKEMON);
        AddStartMenuAction(MENU_ACTION_PC);
    }
Then, we go to "AddStartMenuAction(MENU_ACTION_BAG);" and right after we add:
AddStartMenuAction(MENU_ACTION_PC);


That last line made no sense, it made PC appear both over BAG and below BAG. There were 2 PC Options, I removed the bottom one so only one option was left.

When you wrote:

Code:
static bool8 StartMenuPCCallback(void)
{
    u8 taskId;
    if (!gPaletteFade.active)
    {
        PlayRainStoppingSoundEffect();
        RemoveExtraStartMenuWindows();
        EnterPokeStorage(x);
        return TRUE;
    }

The compiler didn't like that the u8 taskId; variable was not used so I commented out, it compiled normal without.

When you wrote:

Code:
else {
        ScriptContext2_Disable();
        EnableBothScriptContexts();
        SetVBlankCallback(CB2_ReturnToField);
        FadeInFromBlack();
    }

The compiler once again didnt understand ScriptContext2_Disable(); or EnableBothScriptContexts();
I just commented those two lines out and it worked. SO I just wanted to point that out, in no way am I saying anything negative, if
anything just grateful and I hope it helps someone else if they have an error. Thank you and Lunos for this!
 
Field item effect to raise a Pokémon's Sheen [FR]
So, about 19 hours ago, someone expressed interest in the community's Discord about making an item that increased a Pokémon's Sheen stat in Pokémon FireRed.
Yes, Sheen, a stat that goes unused by default and whose entire purpose in RSE is to hard cap the amount of Pokéblocks that a Pokémon can eat.
I ended up doing a very basic implementation of this idea myself as a way to teach this person how to accomplish their goal.
Thinking about it a bit now, I decided to post the diff with the code changes here to preserve it in an open platform that requires no registration like this forum is.

As implied above, the goal was to define a new fieldUseFunc for items, that is, a function executed when you use an item from the bag.
By setting an item's type field to ITEM_TYPE_PARTY_MENU and pointing this new function as the item's fieldUseFunc, the item would open the party screen to make the Player choose a Pokémon from their party, and then proceed to raise the Sheen stat of the chosen Pokémon.
The amount of Sheen that is added is determined by the secondaryId value of the item.
The stat is defined as a u8 variable, so it caps at 255 points and I added checks to the fieldUseFunc to ensure the code doesn't go beyond that.

Spoiler: Click here to see the code diff

Bonus

I made a quick function that fetched a Pokémon's Sheen via GetMonData and some script changes to a youngster near Viridian City's Pokémon Center.
I had to test that FieldUseFunc_RaiseSheen was working correctly somehow after all, and the game doesn't have a dedicated debug menu or anything.
I didn't include those changes in the diff above as everyone can see, but I imagined it'd be okay to at least drop them separately in case they can be of value to someone, somehow.
Spoiler:

I'm not going to port this to Pokeemerald, but it's a trivial matter.
The biggest difference is that FRLG have a special item use animation, which is why I had to split the functionality into that ItemUseCB_RaiseSheenStep function.

[PokeCommunity.com] Simple Modifications Directory


And that's pretty much it.​
 
Don't reset Pushable Boulders when moving around the map

When creating bigger boulder puzzles you might want the already moved boulders to stay in place when moving around the map. Usually these objects are being removed as soon as you don't see them in the player's screen bounds anymore. And when coming back they are recreated at their original position.

To handle this I added a flag to activate/deactive the regular "delete offscreen objects" behavior.
I would set this before entering the desired map/puzzle area and clear it after solving the puzzle (e.g. by leaving the map or on a trigger tile).
Also consider clearing this flag when leaving the area the way you entered it!

To implement this solution open file src/event_object_movement.c and find function RemoveObjectEventIfOutsideView.
Then add the following if-clause before the RemoveObjectEvent(objectEvent); at the bottom of it.
if (!(FlagGet(FLAG_DONT_REMOVE_OFFSCREEN_OBJECT) && objectEvent->graphicsId == OBJ_EVENT_GFX_PUSHABLE_BOULDER))
RemoveObjectEvent(objectEvent);
This will check for said flag and for the object being a boulder. If both is true the object won't be deleted.
 
Last edited:
[PokeFireRed] Fix the Glitched Drought Weather

Well, some days ago, I saw some one asked about the Glitched Drought Weather in FRLG. Since it's a tiny and simple question that involves nothing but getting some missing codes updated to the decomp file. I would conclude it here in a post for any one who would like to check it out.
Here is the final picture of what I'm talking about:
[PokeCommunity.com] Simple Modifications Directory


And here is the explanation in steps:
1. First, Open the file named "field_weathers.c", and then try to add these defination codes in the head of it:
Spoiler:
Here is the picture of what I'm talking about.
Spoiler:


2. And then, jump to the function named "LoadDroughtWeatherPalette", and then delete slash that had made the function itself become unused.
And Here is the picture of what I'm talking about.
Spoiler:


3. After that, search again and jump to the function named "ApplyGammaShift", and in the second branch of its if & else structure (where the text "Dummied out in FRLG" was written), add all the codes to it.
Here is the code:
Spoiler:
And here is the picture of what I'm talking about.
Spoiler:


4. Finally, save the file, and then copy the .bin files from PokeEmeald Decomp files, to the path "/graphics/weather/", and build your ROM.
And that's pretty much about it, Moreover, if any one found any bug, glitch, or have some advice, feel free to send a message to me or leave me reply. And sorry for my unclear English.
 
[PokeFireRed] Dynamic Overworld Palettes Port from PokeEmerald.

I made this at about a few month ago and left the link to the specific modifications to the Discord Server, but I forgot to put it to there. For anyone wants it, it might be helpful or worth checking out.
Here is the link to it for the comparision:
https://github.com/pret/pokefirered/compare/master...12014:pokefirered:dynamic_overworld_pal
However, by using this, the "Previous on your quest..." part in the original PokeFireRed has been (or must be) removed, since it is uncompatiable with the newly added system.
Hope it could be helpful to anyone interested in it. If there is any glitch or bug, please leave a comment below or send a message to me.
 
Last edited:
[pokefirered] Disable Quest Log

At src/main_menu.c:

Go to Task_ExecuteMainMenuSelection. In case MAIN_MENU_CONTINUE; find TryStartQuestLogPlayback(taskId) and replace it with these lines:
SetMainCallback2(CB2_ContinueSavedGame);
DestroyTask(taskId);


It should look like this:
C:
case MAIN_MENU_CONTINUE:
            gPlttBufferUnfaded[0] = RGB_BLACK;
            gPlttBufferFaded[0] = RGB_BLACK;
            gExitStairsMovementDisabled = FALSE;
            FreeAllWindowBuffers();
            SetMainCallback2(CB2_ContinueSavedGame);
            DestroyTask(taskId);
            break;

Now when you reload your save you will no longer see that tedious Quest Log.
 
[PokeEmerald] Custom Mail/Letter item system

I made this last year for a small little project -- apologies if it already exists in another form. The UI bit is mostly GhoulSlash's UI tutorial, but with my addition of "pages."

This implementation allows you to define new Mail items that can be opened, displaying the contents on the existing mail palettes. My specific use case was a new mysterious NPC leaving notes for the player throughout the game. The GitHub link is split into 2 commits. The first being the actual implementation of mail item UI with a single letter and the second commit being an example of how to add a new letter item.

GitHub branch: https://github.com/topher235/pokeemerald/tree/letter-item-system
First commit (implementation): https://github.com/topher235/pokeemerald/commit/2c0bf8c3e90042f538f54334f608760c210b86d0
Second commit (example): https://github.com/topher235/pokeemerald/commit/37fdb061d7b38c0a6c378f301b81d941463920fb

 
[PokeEmerald] Add Walking Animations for All NPCs

I don't know if something like this has already been done, but I made walking animations for all of the NPC object events that don't have any in the original game, including gym leaders and the elite four. These are my own custom sprites, but I tried to keep them as close to the original Emerald style as possible. Feel free to modify them as you see fit.

In the console (where you'd run your "make" command), just enter:
Code:
git remote add Bivurnum https://github.com/Bivurnum/pokeemerald
git pull Bivurnum all-npcs-walk

Or, if you want to apply the changes manually, you can find the comparison with all of my changes here: https://github.com/pret/pokeemerald/compare/master...Bivurnum:pokeemerald:all-npcs-walk

Some notes:
  • This works with pokeemerald-expansion too!
  • All of the sprites of them just standing in place have not been altered, with the exception of one: I rounded out Sidney's head shape because I noticed that the original sprite was a bit misshapen. I think it looks much better now, but I do admit that it is a personal preference.
  • I did not make a walking animation for the Gameboy Kid because I thought he didn't need one due to his unique sprites.
  • The repo can be found here: https://github.com/Bivurnum/pokeemerald/tree/all-npcs-walk
[PokeCommunity.com] Simple Modifications Directory
 
Last edited:

[pokeemerald] Wild Pokémon Drop Held Item on Fainting


This change allows for a wild Pokémon's held item to automatically be added to the bag when defeated. This avoids the tedious task of filling up PC Boxes or obtaining a Pokémon with Thief just to farm wild Pokémon hold items, and also gives a more traditional RPG experience.

[PokeCommunity.com] Simple Modifications Directory

I've tested the code myself and it seems to function properly with no issues found so far, but open to feedback of any kind - advice or improvements are appreciated!

Spoiler: Wild Pokemon Drop Held Item on Fainting

The above steps should be everything that's needed functionally, but I totally unnecessarily wanted to keep the message consistent with the base game when adding items to the bag (i.e. "[PLAYER] put away the [ITEM] in the [POCKET] POCKET."). So, for those interested, I'll add the amendments needed for that separately here:

Spoiler: Include Bag Pocket in Added to Bag Message


Ideally, I'd like to add some little flairs such as the Thief animation playing alongside the dropped item message, or the 'obtained item' fanfare playing when the item is added to the bag, but I've not got round to looking at these yet.
 
Last edited:
[Emerald] Add Choice Specs and Scarf hold item effects

By default, Pokémon Emerald only includes the Choice Band, which boosts physical type-based moves, while restricting the holder to using only the first move selected in battle. The Choice Specs and Choice Scarf items (which boost special type-based moves and speed, respectively) were not added until generation IV. I've made a tutorial that introduces their effects to the game.

Tutorial:
https://github.com/pret/pokeemerald/wiki/Add-Choice-Specs-Scarf-hold-item-effects

Please note that this tutorial will only add the hold effects, not the actual items. Additionally, this tutorial does not take into account any physical/special split alterations you may have made.
 
Back
Top