• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Other Pokeemerald and Pokeruby quick modifications and additions!

Compatible Base ROMs
PKMN Ruby, PKMN Emerald

Gamer2020

Well-known member
#1
#3
Pokeemerald - Level 1 Eggs!

In the file "daycare.h" edit the following line.
C:
#define EGG_HATCH_LEVEL 5
Also at the time of this writing you will need to edit the following line in "pokemon_summary_screen.c"
C:
level = 5;
In the future I'm guessing this will be changed to the following.
C:
level = EGG_HATCH_LEVEL;
Glad you pointed that up. I've made a PR to fix that here https://github.com/pret/pokeemerald/pull/229. In the future though, I'd like you or anyone else to make those PRs.
 

Lunos

Well-known member
#4
Pokeruby/Pokeemerald - Changing a route's tall grass wild pokémon
Open the file \pokeruby\src\wild_encounter.c with a text editor.

Using Ctrl+F, try searching the name of the map that has the wild encounters that you want to modify.
In this case, I'll be changing Route 101's encounters, so I tried to look for "101" and my text editor led me to the Line 1563., which is..
Code:
const struct WildPokemon Route101_LandMons [] =
The section that starts with the Line 1563 looks like this:
Code:
const struct WildPokemon Route101_LandMons [] =
{
    {2, 2, SPECIES_WURMPLE},
    {2, 2, SPECIES_ZIGZAGOON},
    {2, 2, SPECIES_WURMPLE},
    {3, 3, SPECIES_WURMPLE},
    {3, 3, SPECIES_ZIGZAGOON},
    {3, 3, SPECIES_ZIGZAGOON},
    {3, 3, SPECIES_WURMPLE},
    {3, 3, SPECIES_ZIGZAGOON},
    {2, 2, SPECIES_POOCHYENA},
    {2, 2, SPECIES_POOCHYENA},
    {3, 3, SPECIES_POOCHYENA},
    {3, 3, SPECIES_POOCHYENA},
};
What we're seeing here is Minimun and Maximun levels, followed by the species.
So, by simply replacing numbers and pokémon names, we can change in no time a route's wild encounters.

For testing's sake, I did the following modifications:
-All the pokémon appear at Lv1.
-You can find Pidgey, Rattata and Mankey instead of Wurmple, Zigzagoon and Poochyena.

This was the outcome:
Code:
const struct WildPokemon Route101_LandMons [] =
{
    {1, 1, SPECIES_PIDGEY},
    {1, 1, SPECIES_RATTATA},
    {1, 1, SPECIES_PIDGEY},
    {1, 1, SPECIES_PIDGEY},
    {1, 1, SPECIES_RATTATA},
    {1, 1, SPECIES_RATTATA},
    {1, 1, SPECIES_PIDGEY},
    {1, 1, SPECIES_RATTATA},
    {1, 1, SPECIES_MANKEY},
    {1, 1, SPECIES_MANKEY},
    {1, 1, SPECIES_MANKEY},
    {1, 1, SPECIES_MANKEY},
};
The modification that I did is certainly working correctly.

And that's it.

Pokeruby/Pokeemerald - Changing the starter pokémon
Pokeruby

Open the file \pokeruby\src\starter_choose.c with a text editor.

Using Ctrl+F, try searching one of the names of Pokémon Ruby's starter pokémon.
In this case, I searched "Torchic" and my text editor led me to the Line 50, which is..
Code:
static const u16 sStarterMons[] = {SPECIES_TREECKO, SPECIES_TORCHIC, SPECIES_MUDKIP};
As you might have guessed, we simply need to change the different species names, compile and that's it.
For this test I replaced Treecko, Torchic and Mudkip with Bulbasaur, Charmander and Squirle.

The modification that I did is certainly working correctly.

And that's it.

Pokeemerald
Open the file \pokeemerald\data\starter_choose.s with a text editor.

Using Ctrl+F, try searching one of the names of Pokémon Emerald's starter pokémon.
In this case, I searched "Torchic" and my text editor led me to the Line 61, which is a part of this piece of code:
Code:
sStarterMon:: @ 85B1DF8
	.2byte SPECIES_TREECKO
	.2byte SPECIES_TORCHIC
	.2byte SPECIES_MUDKIP
As you might have guessed, we simply need to change the different species names, compile and that's it.
For this test I replaced Treecko, Torchic and Mudkip with Chikorita, Cyndaquil and Totodile.

The modification that I did is certainly working correctly.

And that's it.

Pokeruby - Changing a trainer's pokémon
Open the file \pokeruby\src\data\trainer_parties.h with a text editor.

Using Ctrl+F, try searching the name of the trainer you want to edit.
In this case, I'll search for "calvin" as in Youngster Calvin, the first trainer that we have to fight against after our rival.
This time, my text editor led me to the Line 4265, which is...
Code:
const struct TrainerPartyMember0 gTrainerParty_Calvin1[] = {
The section of code this line belongs to is this:
const struct TrainerPartyMember0 gTrainerParty_Calvin1[] = {
{
.iv = 0,
.level = 5,
.species = SPECIES_ZIGZAGOON
}
};

Just like before, all we have to do is change the species name and if we want to, the level too.
Then we have the IV Parameter. If I'm understanding this correctly, the value ranges from 0 to 255, where 0 is 0 IVs and 255 is 31 IVs in all of Calvin's pokémon's stats. If every 8 points equals 1 IV, I suppose that to make Calvin's Feebas' have 15 IVs across its 6 stats, I'll have to write 127.
After modifying to my heart's content, this was the outcome:
const struct TrainerPartyMember0 gTrainerParty_Calvin1[] = {
{
.iv = 127,
.level = 3,
.species = SPECIES_FEEBAS
}
};

The modification that I did certainly seems to be working correctly.

And that's it.

Pokeruby - Changing a trainer completely
Open the file \pokeruby\src\data\trainers_en.h with a text editor.

Using Ctrl+F, try searching the name of the trainer you want to edit.
In this case, I'll search for Youngster Calvin, the first trainer that we have to fight against after our rival.
This time, my text editor led me to the Line 4454, which is..
Code:
    [OPPONENT_CALVIN_1] =
That line belongs to the following piece of code:
[OPPONENT_CALVIN_1] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_YOUNGSTER,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_YOUNGSTER,
.trainerName = _("CALVIN"),
.items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE},
.doubleBattle = FALSE,
.aiFlags = 0x1,
.partySize = 1,
.party = gTrainerParty_Calvin1
},

So, I'll try to explain the lines that I succesfully understood.
Line 4: The trainer class. In this case, Calvin is a youngster. I will make it a Gentleman instead.
Line 5: The music that will play once you enter in Calvin's field of view.
Line 6: The sprite that Calvin will have.
Line 7: Calvin's name during the battle.
Line 8: The 4 items that a trainer can normally have.
Line 9: A flag that if it's set to "TRUE", will make the battle be a double one.
Line 10: The AI Level.
Line 11: The amount of pokémon that Calvin has.
Line 12: The party inside \pokeruby\src\data\trainer_parties.h that this trainer will have.

With that being said, I decided to change Calvin In-Battle completely. This was the outcome.
[OPPONENT_CALVIN_1] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_FISHERMAN,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER,
.trainerPic = TRAINER_PIC_FISHERMAN,
.trainerName = _("RALPH"),
.items = {ITEM_POTION, ITEM_POTION, ITEM_X_ATTACK, ITEM_X_DEFEND},
.doubleBattle = FALSE,
.aiFlags = 0x1,
.partySize = 2,
.party = gTrainerParty_Calvin1
},

Now, if y'all followed my previous guide, Calvin only has one single pokémon by default so we'll have to give him another one.
How, do you ask? Well first of all, make sure to set the .partySize parameter to the number of pokémon you want the trainer to have.
Then select the already existing pokémon that they have, Ctrl+C, Ctrl+V, modify as you see fit and that's literally it.
As I mentioned before, this is what Calvin's party looks like by default, in the \pokeruby\src\data\trainer_parties.h file.
const struct TrainerPartyMember0 gTrainerParty_Calvin1[] = {
{
.iv = 0,
.level = 5,
.species = SPECIES_ZIGZAGOON
}
};

What am I going to do? This.
const struct TrainerPartyMember0 gTrainerParty_Calvin1[] = {
{
.iv = 120,
.level = 6,
.species = SPECIES_FEEBAS
},
{
.iv = 120,
.level = 4,
.species = SPECIES_MAGIKARP
}
};

As you all will be able to see, the changes are working correctly.

And that's it.

Pokeruby - Changing the content of a poké ball in the overworld
Open the file \pokeruby\data\item_ball_scripts.inc with a text editor.

Using Ctrl+F, try searching the name of the map that has the poke ball that you want to modify.
In this case I didn't need to bother because I wanted to change the poké ball at Route 102 (the first one that the Player finds during a playthrough of Pokémon Ruby) which is literally the first line of the document.

This poké ball carries the following script:
Code:
	giveitem_std ITEM_POTION, 1, 1
	end
As y'all can see, the script looks almost the same as if we opened it with Advance Map and XSE.
giveitem_std is the command that gives an item to the player, ITEM_POTION is the item itself, the first 1 is the amount you'll get of that particular item and the last 1 is the kind of message that will appear when you interact with the poké ball in the overworld (1=PLAYER found [item];0=PLAYER obtained [item])

Following the pattern of the previous modifications, I replaced the potion with 2 Master Balls like this:
Code:
Route102_EventScript_1B1439:: @ 81B1439
	giveitem_std ITEM_MASTER_BALL, 2, 1
	end
I tried using the Type of Message 0 but the result that I got and some testing along @Sagiri makes me think that it is meant to be used in a complete script, maybe followed by a msgbox.

The modification presented up there is working correctly, however, I would also like to change the msgbox's string accordingly.
Unfortunately, I couldn't find it anywhere.


And that's it.
 
Last edited:
#7
Pokeruby/Pokeemerald - Allow running shoes indoors

In src/bike.c, remove the indoors check in the IsRunningDisallowed() function. For pokeemerald, make sure to modify IsRunningDisallowed() instead of RS_IsRunningDisallowed(). An unused copy of the function from pokeruby was leftover in the pokeemerald code.

Before:
C:
bool8 IsRunningDisallowed(u8 tile)
{
    if (IsRunningDisallowedByMetatile(tile) != FALSE || gMapHeader.mapType == MAP_TYPE_INDOOR)
        return TRUE;
    else
        return FALSE;
}
After:
C:
bool8 IsRunningDisallowed(u8 tile)
{
    if (IsRunningDisallowedByMetatile(tile) != FALSE)
        return TRUE;
    else
        return FALSE;
}
 

Delta231

Well-known member
#8
Pokeruby - Increase/Decrease the step counts and no. of balls in Safari Zone

In src/safari_zone.c From Line 57

Code:
void EnterSafariMode(void)
{
    IncrementGameStat(GAME_STAT_ENTERED_SAFARI_ZONE);
    SetSafariZoneFlag();
    ClearAllPokeblockFeeders();
    gNumSafariBalls = 30;
    gSafariZoneStepCounter = 500;
}

Change gNumSafariBalls for changing the no. of Safari Balls and gSafariZoneStepCounter for changing the amount of steps in Safari Zone.


Pokeruby - Changing the amount of teams in Hall of Frame

In src/hall_of_frame.c Change this line

Code:
#define HALL_OF_FAME_MAX_TEAMS 50

Pokeruby - Removing the Truck Animation

In src/overworld.c Remove the following line.

Code:
gFieldCallback = ExecuteTruckSequence;
 
Last edited:

Lunos

Well-known member
#10
Pokeruby - Editing the goods of a PokéMart
In \pokeruby\data\scripts\maps we're going to open the file of a map that contains the PokéMart that we want to edit, in this case, I'll edit Oldale's.
Then we use Ctrl+F to search the name of an item that said mart sells, if the list of that mart's content doesn't show up right away.
After that, we just modify the list to our heart's content following the pattern.

For this example, I'll add Quick Claws, Exp. Share, Macho Braces, Lucky Eggs, Master Balls and Rare Candies to Oldale Town's PokéMart.
Protip: You can find a list of items in the \pokeruby\include\constants\items.h file.

Now, Oldale Town's PokéMart is special. As y'all probably know, the first mart in the GBA Games always have 2 sets of items: One that is loaded if the Player didn't complete the first events of the game until he receives the pokédex and another set that is loaded everytime after the Player gets it. In this case, I'll modify the 2nd list

So, from this:
Code:
OldaleTown_Mart_Items2:: @ 8152FB8
    .2byte ITEM_POKE_BALL
    .2byte ITEM_POTION
    .2byte ITEM_ANTIDOTE
    .2byte ITEM_PARALYZE_HEAL
    .2byte ITEM_AWAKENING
    .2byte ITEM_NONE
    release
    end
It'll go to this:
Code:
OldaleTown_Mart_Items2:: @ 8152FB8
    .2byte ITEM_POKE_BALL
    .2byte ITEM_POTION
    .2byte ITEM_ANTIDOTE
    .2byte ITEM_PARALYZE_HEAL
    .2byte ITEM_AWAKENING
    .2byte ITEM_QUICK_CLAW
    .2byte ITEM_EXP_SHARE
    .2byte ITEM_MACHO_BRACE
    .2byte ITEM_LUCKY_EGG
    .2byte ITEM_MASTER_BALL
    .2byte ITEM_RARE_CANDY
    .2byte ITEM_NONE
    release
    end
And as you can all see, the modification is working perfectly.
 

Delta231

Well-known member
#11
Pokeruby - Changing Held Items in Battle Tower

In battle_tower.c
Code:
tatic const u16 sBattleTowerHeldItems[] =
{
    ITEM_NONE,
    ITEM_KINGS_ROCK,
    ITEM_SITRUS_BERRY,
    ITEM_ORAN_BERRY,
    ITEM_CHESTO_BERRY,
    ITEM_HARD_STONE,
    ITEM_FOCUS_BAND,
    ITEM_PERSIM_BERRY,
    ITEM_MIRACLE_SEED,
    ITEM_BERRY_JUICE,
    ITEM_MACHO_BRACE,
    ITEM_SILVER_POWDER,
    ITEM_CHERI_BERRY,
    ITEM_BLACK_GLASSES,
    ITEM_BLACK_BELT,
    ITEM_SOUL_DEW,
    ITEM_CHOICE_BAND,
    ITEM_MAGNET,
    ITEM_SILK_SCARF,
    ITEM_WHITE_HERB,
    ITEM_DEEP_SEA_SCALE,
    ITEM_DEEP_SEA_TOOTH,
    ITEM_MYSTIC_WATER,
    ITEM_SHARP_BEAK,
    ITEM_QUICK_CLAW,
    ITEM_LEFTOVERS,
    ITEM_RAWST_BERRY,
    ITEM_LIGHT_BALL,
    ITEM_POISON_BARB,
    ITEM_NEVER_MELT_ICE,
    ITEM_ASPEAR_BERRY,
    ITEM_SPELL_TAG,
    ITEM_BRIGHT_POWDER,
    ITEM_LEPPA_BERRY,
    ITEM_SCOPE_LENS,
    ITEM_TWISTED_SPOON,
    ITEM_METAL_COAT,
    ITEM_MENTAL_HERB,
    ITEM_CHARCOAL,
    ITEM_PECHA_BERRY,
    ITEM_SOFT_SAND,
    ITEM_LUM_BERRY,
    ITEM_DRAGON_SCALE,
    ITEM_DRAGON_FANG,
    ITEM_IAPAPA_BERRY,
    ITEM_WIKI_BERRY,
    ITEM_SEA_INCENSE,
    ITEM_SHELL_BELL,
    ITEM_SALAC_BERRY,
    ITEM_LANSAT_BERRY,
    ITEM_APICOT_BERRY,
    ITEM_STARF_BERRY,
    ITEM_LIECHI_BERRY,
    ITEM_STICK,
    ITEM_LAX_INCENSE,
    ITEM_AGUAV_BERRY,
    ITEM_FIGY_BERRY,
    ITEM_THICK_CLUB,
    ITEM_MAGO_BERRY,
    ITEM_METAL_POWDER,
    ITEM_PETAYA_BERRY,
    ITEM_LUCKY_PUNCH,
    ITEM_GANLON_BERRY,
};
Add or remove any help item.

Pokeruby- Changing Banned Pokemon

In battle_tower.c

Code:
const u16 gBattleTowerBannedSpecies[] =
{
    SPECIES_MEW,
    SPECIES_MEWTWO,
    SPECIES_HO_OH,
    SPECIES_LUGIA,
    SPECIES_CELEBI,
    SPECIES_KYOGRE,
    SPECIES_GROUDON,
    SPECIES_RAYQUAZA,
    SPECIES_JIRACHI,
    SPECIES_DEOXYS,
    0xFFFF,
};
Change or remove any banned Pokemon.
 

Delta231

Well-known member
#12
Pokeruby - Changing long and short streaks in Battle Tower

In battle_tower.c From line 237 to 260.



Code:
// Item prizes for battle tower streaks of 5 or fewer sets.
static const u16 sShortStreakPrizes[] =
{
    ITEM_HP_UP,
    ITEM_PROTEIN,
    ITEM_IRON,
    ITEM_CALCIUM,
    ITEM_CARBOS,
    ITEM_ZINC,
};

// Item prizes for battle tower streaks of greater than 5 sets.
static const u16 sLongStreakPrizes[] =
{
    ITEM_BRIGHT_POWDER,
    ITEM_WHITE_HERB,
    ITEM_QUICK_CLAW,
    ITEM_LEFTOVERS,
    ITEM_MENTAL_HERB,
    ITEM_KINGS_ROCK,
    ITEM_FOCUS_BAND,
    ITEM_SCOPE_LENS,
    ITEM_CHOICE_BAND,
};
Change your wanting items.
 

Delta231

Well-known member
#13
Pokeruby - Changing the amount of Game Corner Coins

In coins.c Change the following line.

Code:
#define MAX_COINS 9999
Pokeruby - Changing roaming Pokemon

In roamer.c Change this line.


Code:
ifdef SAPPHIRE
#define ROAMER_SPECIES SPECIES_LATIAS
#else
#define ROAMER_SPECIES SPECIES_LATIOS
#endif
 

Delta231

Well-known member
#14
Pokeruby - Edit Start Location

In new_game.c Change the below line.


Code:
oid WarpToTruck(void)
{
    Overworld_SetWarpDestination(25, 40, -1, -1, -1); // inside of truck
    warp_in();
}
 
OP
OP
Gamer2020

Gamer2020

Well-known member
#16
Edit the Pokemon sent out in the intro!

To edit the cry, edit the following line in main_menu.c:

C:
CreatePokeballSpriteToReleaseMon(spriteId, gSprites[spriteId].oam.paletteNum, 0x70, 0x3A, 0, 0, 0x20, 0xFFFF, SPECIES_LOTAD);
To edit the sprite, edit the following line in main_menu.c:

C:
return sub_818D3E4(SPECIES_LOTAD, 8, 0, 1, a, b, 14, -1);
 

Lunos

Well-known member
#17
So, I just updated my previous post because some files and paths were changed since the time when I wrote it.
In order to avoid making spam, I decided to bring a small tutorial about changing the item pool of the Pickup ability.

Pokeruby - Changing the items list of the Pickup Ability
Open the file \pokeruby\src\battle\battle_4.c with a text editor.

Using Ctrl+F, search: static const u16 sPickupItems[] =
The search led me to the Line 1064 which contains this piece of code:
Code:
static const u16 sPickupItems[] =
{
    ITEM_SUPER_POTION, 30,
    ITEM_FULL_HEAL, 40,
    ITEM_ULTRA_BALL, 50,
    ITEM_RARE_CANDY, 60,
    ITEM_FULL_RESTORE, 70,
    ITEM_REVIVE, 80,
    ITEM_NUGGET, 90,
    ITEM_PROTEIN, 95,
    ITEM_PP_UP, 99,
    ITEM_KINGS_ROCK, 1
};
What we're seeing here is the list of items and the chance of getting them that our pokémon has.

As you might have guessed, we simply need to change the different items' names, compile and that's it.
For this test I replaced each item with a TM.
I suggest to check the \pokeruby\src\data\items_en.h file in case you don't know the correct way to write a specific item's name.

The modification that I did is certainly working correctly.

And that's it.

And here I decided to write some more silly tutorials, mainly because I'm bored.

Pokeruby - Changing an ability's name and description
In this case, we're going to focus in 2 files: \pokeruby\data\text\ability_descriptions.inc and \pokeruby\data\text\ability_names.inc

First of all, I'm going to change the name, so, using Ctrl+F, I'll search the name of the ability that I'm interested in. In this case I'll look for Zigzagoon's Pickup.
The search led me to the Line 55 of the \pokeruby\data\text\ability_names.inc file, which contains this line of text:
Code:
    .string "PICKUP$", 13
I don't need to say what will we have to do, right?
Just change "PICKUP" to whatever you want, but keep in mind the limitations when it comes to the amount of characters that can be used.
I decided to decap the word and translate it to spanish too, so my result was:
Code:
    .string "Recogida$", 13
And now, we're going to change the description, so, using Ctrl+F, I'll search for Pickup in the \pokeruby\data\text\ability_descriptions.inc file.
The search led me to the Line 160, which contains this 2 lines:
Code:
gAbilityDescription_Pickup: @ 81F9EB6
    .string "May pick up items.$"
Yes, you got that right. The only thing we need to change here, is the description itself and call it a day.
Like I did before, I'm going to translate the description to Spanish, so my result was:
Code:
gAbilityDescription_Pickup: @ 81F9EB6
    .string "Puede conseguir objetos.$"
After compiling and testing, I was able to confirm that the modification is certainly working correctly.


And that's it.

Pokeruby - Changing the names of the pokémon natures
Open the \pokeruby\src\data\text\nature_names_en.h file with a text editor.

Right off the bat, you'll see all the natures' strings. Just modify them, compile and test.
In this case, I'll translate the following natures to Spanish: Modest, Hasty, Serious, Lonely, Jolly and Hardy.
So from this:
Code:
static const u8 NatureName_Hardy[]   = _("HARDY");
static const u8 NatureName_Lonely[]  = _("LONELY");
static const u8 NatureName_Brave[]   = _("BRAVE");
static const u8 NatureName_Adamant[] = _("ADAMANT");
static const u8 NatureName_Naughty[] = _("NAUGHTY");
static const u8 NatureName_Bold[]    = _("BOLD");
static const u8 NatureName_Docile[]  = _("DOCILE");
static const u8 NatureName_Relaxed[] = _("RELAXED");
static const u8 NatureName_Impish[]  = _("IMPISH");
static const u8 NatureName_Lax[]     = _("LAX");
static const u8 NatureName_Timid[]   = _("TIMID");
static const u8 NatureName_Hasty[]   = _("HASTY");
static const u8 NatureName_Serious[] = _("SERIOUS");
static const u8 NatureName_Jolly[]   = _("JOLLY");
static const u8 NatureName_Naive[]   = _("NAIVE");
static const u8 NatureName_Modest[]  = _("MODEST");
static const u8 NatureName_Mild[]    = _("MILD");
static const u8 NatureName_Quiet[]   = _("QUIET");
static const u8 NatureName_Bashful[] = _("BASHFUL");
static const u8 NatureName_Rash[]    = _("RASH");
static const u8 NatureName_Calm[]    = _("CALM");
static const u8 NatureName_Gentle[]  = _("GENTLE");
static const u8 NatureName_Sassy[]   = _("SASSY");
static const u8 NatureName_Careful[] = _("CAREFUL");
static const u8 NatureName_Quirky[]  = _("QUIRKY");
I'll go to this:
Code:
static const u8 NatureName_Hardy[]   = _("Fuerte");
static const u8 NatureName_Lonely[]  = _("Hura{41}a");// You have to write the "ñ" like that or otherwise, it won't work.
static const u8 NatureName_Brave[]   = _("BRAVE");
static const u8 NatureName_Adamant[] = _("ADAMANT");
static const u8 NatureName_Naughty[] = _("NAUGHTY");
static const u8 NatureName_Bold[]    = _("BOLD");
static const u8 NatureName_Docile[]  = _("DOCILE");
static const u8 NatureName_Relaxed[] = _("RELAXED");
static const u8 NatureName_Impish[]  = _("IMPISH");
static const u8 NatureName_Lax[]     = _("LAX");
static const u8 NatureName_Timid[]   = _("TIMID");
static const u8 NatureName_Hasty[]   = _("Activa");
static const u8 NatureName_Serious[] = _("Seria");
static const u8 NatureName_Jolly[]   = _("Alegre");
static const u8 NatureName_Naive[]   = _("NAIVE");
static const u8 NatureName_Modest[]  = _("Modesta");
static const u8 NatureName_Mild[]    = _("MILD");
static const u8 NatureName_Quiet[]   = _("QUIET");
static const u8 NatureName_Bashful[] = _("BASHFUL");
static const u8 NatureName_Rash[]    = _("RASH");
static const u8 NatureName_Calm[]    = _("CALM");
static const u8 NatureName_Gentle[]  = _("GENTLE");
static const u8 NatureName_Sassy[]   = _("SASSY");
static const u8 NatureName_Careful[] = _("CAREFUL");
static const u8 NatureName_Quirky[]  = _("QUIRKY");
A guy whose nickname is "Mvit" gave me a valuable suggestion and I appreciate it, that is, to use the characters map when I'm in doubt about how to write a special character like the "ñ".
Also, keep in mind that the numbers right there are in hex, but at the time of writing them, you have to convert them to decimal. So "ñ" which has the number "29" becomes "41".

The modification that I did is certainly working correctly.


And that's it.

Pokeruby - Changing the starting items
This time, we're gonna change the "Potion" that the Player has stored on his PC when starting a new savefile.
Open the file \pokeruby\src\player_pc.c with a text editor.

Using Ctrl+F, search "Potion".
The search led me to the Line 156 where we can see this piece of code:
Code:
{
    { ITEM_POTION, 1 },
    { ITEM_NONE, 0 }
};
What we're seeing here is the items and amounts of them that the Player has stored in his PC by default.

As you might have guessed, we just have to edit them as we see fit and that's it. Just make sure to keep that ITEM_NONE 0 though.
For this test I replaced the Potion with an X Attack and also added a X Defend too. This was the result:
Code:
{
    { ITEM_X_ATTACK, 1 },
    { ITEM_X_DEFEND, 1 },
    { ITEM_NONE, 1 },
};
The modification that I did is certainly working correctly.


And that's it.
 
Last edited:
#18
download for what's to come

EDIT2: apparently the problem is that the compiler doesn't view decapitalizations as changes, instead requiring a clean build or a small spelling change in the file
so just do a clean build to fix
also need to fix pokedex categories, i made an error fixed now

EDIT: lunos has informed me that this isn't precisely working, but i did add a few more things nonetheless (everything added in master/data) which definitely should work
will check back in on this and find where the problem is


a small decap/edits thing i did (files for pokeruby)

list of files decapped:
master/data:​
various messages (strings2.s)​
decapped contest opponent names (contest_opponents.inc, contest.s)​
decapped event scripts (event_scripts.s)​
decapped field move scripts (field_move_scripts.inc)​
master/data/text:​
ability names (ability_names.inc, ability_descriptions.inc)​
SAVING... DON'T TURN OFF THE POWER. (save.inc)​
type names (for battles) (type_names.inc)​
master/src/data/text:​
move names (move_names_en.h)​
nature names (move_names_en.h)​
pokémon names (species_names_en.h)​
trainer class names (trainer_class_names_en.h)​
master/src/data:​
updated moves (battle_moves.c) (exceptions noted in the file)​
updated a few battle strings (aryan_10 did a few which i ported here) (battle_strings_en.h)​
decapped a few strings in the credits (credits_en.h)​
decapped item descriptions (item_descriptions_en.h)​
decapped item names (items_en.h)​
decapped pokédex entries and categories (pokedex_entries_en.h)​
decapped location names (region_map_names_en.h)​
master/src:​
more miscellaneous messages (strings.c)​
may have missed a few things, just point them out as they're found and i'll update the files. just something that took up like 7 hours of just sitting here and typing that shouldn't have to be done over and over
 
Last edited:
OP
OP
Gamer2020

Gamer2020

Well-known member
#19
So, I just updated my previous post because some files and paths were changed since the time when I wrote it.
In order to avoid making spam, I decided to bring a small tutorial about changing the item pool of the Pickup ability.

Pokeruby - Changing the items list of the Pickup Ability
Open the file \pokeruby\src\battle\battle_4.c with a text editor.

Using Ctrl+F, search: static const u16 sPickupItems[] =
The search led me to the Line 1064 which contains this piece of code:
Code:
static const u16 sPickupItems[] =
{
    ITEM_SUPER_POTION, 30,
    ITEM_FULL_HEAL, 40,
    ITEM_ULTRA_BALL, 50,
    ITEM_RARE_CANDY, 60,
    ITEM_FULL_RESTORE, 70,
    ITEM_REVIVE, 80,
    ITEM_NUGGET, 90,
    ITEM_PROTEIN, 95,
    ITEM_PP_UP, 99,
    ITEM_KINGS_ROCK, 1
};
What we're seeing here is the list of items and the chance of getting them that our pokémon has.

As you might have guessed, we simply need to change the different items' names, compile and that's it.
For this test I replaced each item with a TM.
I suggest to check the \pokeruby\src\data\items_en.h file in case you don't know the correct way to write a specific item's name.

The modification that I did is certainly working correctly.

And that's it.

And here I decided to write some more silly tutorials, mainly because I'm bored.

Pokeruby - Changing an ability's name and description
In this case, we're going to focus in 2 files: \pokeruby\data\text\ability_descriptions.inc and \pokeruby\data\text\ability_names.inc

First of all, I'm going to change the name, so, using Ctrl+F, I'll search the name of the ability that I'm interested in. In this case I'll look for Zigzagoon's Pickup.
The search led me to the Line 55 of the \pokeruby\data\text\ability_names.inc file, which contains this line of text:
Code:
    .string "PICKUP$", 13
I don't need to say what will we have to do, right?
Just change "PICKUP" to whatever you want, but keep in mind the limitations when it comes to the amount of characters that can be used.
I decided to decap the word and translate it to spanish too, so my result was:
Code:
    .string "Recogida$", 13
And now, we're going to change the description, so, using Ctrl+F, I'll search for Pickup in the \pokeruby\data\text\ability_descriptions.inc file.
The search led me to the Line 160, which contains this 2 lines:
Code:
gAbilityDescription_Pickup: @ 81F9EB6
    .string "May pick up items.$"
Yes, you got that right. The only thing we need to change here, is the description itself and call it a day.
Like I did before, I'm going to translate the description to Spanish, so my result was:
Code:
gAbilityDescription_Pickup: @ 81F9EB6
    .string "Puede conseguir objetos.$"
After compiling and testing, I was able to confirm that the modification is certainly working correctly.


And that's it.

Pokeruby - Changing the names of the pokémon natures
Open the \pokeruby\src\data\text\nature_names_en.h file with a text editor.

Right off the bat, you'll see all the natures' strings. Just modify them, compile and test.
In this case, I'll translate the following natures to Spanish: Modest, Hasty, Serious, Lonely, Jolly and Hardy.
So from this:
Code:
static const u8 NatureName_Hardy[]   = _("HARDY");
static const u8 NatureName_Lonely[]  = _("LONELY");
static const u8 NatureName_Brave[]   = _("BRAVE");
static const u8 NatureName_Adamant[] = _("ADAMANT");
static const u8 NatureName_Naughty[] = _("NAUGHTY");
static const u8 NatureName_Bold[]    = _("BOLD");
static const u8 NatureName_Docile[]  = _("DOCILE");
static const u8 NatureName_Relaxed[] = _("RELAXED");
static const u8 NatureName_Impish[]  = _("IMPISH");
static const u8 NatureName_Lax[]     = _("LAX");
static const u8 NatureName_Timid[]   = _("TIMID");
static const u8 NatureName_Hasty[]   = _("HASTY");
static const u8 NatureName_Serious[] = _("SERIOUS");
static const u8 NatureName_Jolly[]   = _("JOLLY");
static const u8 NatureName_Naive[]   = _("NAIVE");
static const u8 NatureName_Modest[]  = _("MODEST");
static const u8 NatureName_Mild[]    = _("MILD");
static const u8 NatureName_Quiet[]   = _("QUIET");
static const u8 NatureName_Bashful[] = _("BASHFUL");
static const u8 NatureName_Rash[]    = _("RASH");
static const u8 NatureName_Calm[]    = _("CALM");
static const u8 NatureName_Gentle[]  = _("GENTLE");
static const u8 NatureName_Sassy[]   = _("SASSY");
static const u8 NatureName_Careful[] = _("CAREFUL");
static const u8 NatureName_Quirky[]  = _("QUIRKY");
I'll go to this:
Code:
static const u8 NatureName_Hardy[]   = _("Fuerte");
static const u8 NatureName_Lonely[]  = _("Hura{41}a");// You have to write the "ñ" like that or otherwise, it won't work.
static const u8 NatureName_Brave[]   = _("BRAVE");
static const u8 NatureName_Adamant[] = _("ADAMANT");
static const u8 NatureName_Naughty[] = _("NAUGHTY");
static const u8 NatureName_Bold[]    = _("BOLD");
static const u8 NatureName_Docile[]  = _("DOCILE");
static const u8 NatureName_Relaxed[] = _("RELAXED");
static const u8 NatureName_Impish[]  = _("IMPISH");
static const u8 NatureName_Lax[]     = _("LAX");
static const u8 NatureName_Timid[]   = _("TIMID");
static const u8 NatureName_Hasty[]   = _("Activa");
static const u8 NatureName_Serious[] = _("Seria");
static const u8 NatureName_Jolly[]   = _("Alegre");
static const u8 NatureName_Naive[]   = _("NAIVE");
static const u8 NatureName_Modest[]  = _("Modesta");
static const u8 NatureName_Mild[]    = _("MILD");
static const u8 NatureName_Quiet[]   = _("QUIET");
static const u8 NatureName_Bashful[] = _("BASHFUL");
static const u8 NatureName_Rash[]    = _("RASH");
static const u8 NatureName_Calm[]    = _("CALM");
static const u8 NatureName_Gentle[]  = _("GENTLE");
static const u8 NatureName_Sassy[]   = _("SASSY");
static const u8 NatureName_Careful[] = _("CAREFUL");
static const u8 NatureName_Quirky[]  = _("QUIRKY");
A guy whose nickname is "Mvit" gave me a valuable suggestion and I appreciate it, that is, to use the characters map when I'm in doubt about how to write a special character like the "ñ".
Also, keep in mind that the numbers right there are in hex, but at the time of writing them, you have to convert them to decimal. So "ñ" which has the number "29" becomes "41".

The modification that I did is certainly working correctly.


And that's it.

Pokeruby - Changing the starting items
This time, we're gonna change the "Potion" that the Player has stored on his PC when starting a new savefile.
Open the file \pokeruby\src\player_pc.c with a text editor.

Using Ctrl+F, search "Potion".
The search led me to the Line 156 where we can see this piece of code:
Code:
{
    { ITEM_POTION, 1 },
    { ITEM_NONE, 0 }
};
What we're seeing here is the items and amounts of them that the Player has stored in his PC by default.

As you might have guessed, we just have to edit them as we see fit and that's it. Just make sure to keep that ITEM_NONE 0 though.
For this test I replaced the Potion with an X Attack and also added a X Defend too. This was the result:
Code:
{
    { ITEM_X_ATTACK, 1 },
    { ITEM_X_DEFEND, 1 },
    { ITEM_NONE, 1 },
};
The modification that I did is certainly working correctly.


And that's it.
Haven't had a chance to add this to the first post but I will eventually.

download for what's to come

EDIT2: apparently the problem is that the compiler doesn't view decapitalizations as changes, instead requiring a clean build or a small spelling change in the file
so just do a clean build to fix
also need to fix pokedex categories, i made an error fixed now

EDIT: lunos has informed me that this isn't precisely working, but i did add a few more things nonetheless (everything added in master/data) which definitely should work
will check back in on this and find where the problem is


a small decap/edits thing i did (files for pokeruby)

list of files decapped:
master/data:​
various messages (strings2.s)​
decapped contest opponent names (contest_opponents.inc, contest.s)​
decapped event scripts (event_scripts.s)​
decapped field move scripts (field_move_scripts.inc)​
master/data/text:​
ability names (ability_names.inc, ability_descriptions.inc)​
SAVING... DON'T TURN OFF THE POWER. (save.inc)​
type names (for battles) (type_names.inc)​
master/src/data/text:​
move names (move_names_en.h)​
nature names (move_names_en.h)​
pokémon names (species_names_en.h)​
trainer class names (trainer_class_names_en.h)​
master/src/data:​
updated moves (battle_moves.c) (exceptions noted in the file)​
updated a few battle strings (aryan_10 did a few which i ported here) (battle_strings_en.h)​
decapped a few strings in the credits (credits_en.h)​
decapped item descriptions (item_descriptions_en.h)​
decapped item names (items_en.h)​
decapped pokédex entries and categories (pokedex_entries_en.h)​
decapped location names (region_map_names_en.h)​
master/src:​
more miscellaneous messages (strings.c)​
may have missed a few things, just point them out as they're found and i'll update the files. just something that took up like 7 hours of just sitting here and typing that shouldn't have to be done over and over
I think this warrants it's own thread. Also I would consider starting a github repo so other people can help you.
 
#20
Pokemerald - Triple Layer Blocks Installation

In src/field_camera.c, add another switch case in DrawMetatileAt function:

Code:
    case 3: // TRIPLE_LAYER
        // Draw metatile's bottom layer to the bottom background layer.
        gBGTilemapBuffers3[offset] = metatiles[0];
        gBGTilemapBuffers3[offset + 1] = metatiles[1];
        gBGTilemapBuffers3[offset + 0x20] = metatiles[2];
        gBGTilemapBuffers3[offset + 0x21] = metatiles[3];

        // Draw metatile's top layer to the middle background layer..
        gBGTilemapBuffers1[offset] = metatiles[4];;
        gBGTilemapBuffers1[offset + 1] = metatiles[5];
        gBGTilemapBuffers1[offset + 0x20] = metatiles[6];
        gBGTilemapBuffers1[offset + 0x21] = metatiles[7];

        // Draw metatile's extra layer to the top background layer.
        gBGTilemapBuffers2[offset] = metatiles[8];
        gBGTilemapBuffers2[offset + 1] = metatiles[9];
        gBGTilemapBuffers2[offset + 0x20] = metatiles[10];
        gBGTilemapBuffers2[offset + 0x21] = metatiles[11];
        break;
Credits to diegoisawesome for the original ASM code.