• 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

853
Posts
3
Years
    • Seen Nov 9, 2023
    I might be mistaken, but won't this basically replace Hidden Power Dark with Fairy?

    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.

    possibly, I'm sending you a message from my thread now. but if it means anything type mystery is actually 0x9, not 0x8.


    edit:
    looked through things, mgriffin is right, there's one other change that needs to be made for this to work correctly.

    This is the original.
    Code:
    gBattleStruct->dynamicMoveType = (15 * typeBits) / 63 + 1;
    if (gBattleStruct->dynamicMoveType >= TYPE_MYSTERY)
    ++gBattleStruct->dynamicMoveType;

    This is what it needs to be changed to.
    Code:
    gBattleStruct->dynamicMoveType = (16 * typeBits) / 63 + 1;
    if (gBattleStruct->dynamicMoveType == TYPE_MYSTERY)
    gBattleStruct->dynamicMoveType = TYPE_FAIRY;

    Pretty confident about that, if you want to go over the explanations yourself you can check out my thread on the topic Here.

    also making this change *may* affect the odds/conditions for certain types appearing I can't confirm that as its theory and I'm not good with bitwise anyway.

    And a last note to cover all the bases , while the theory for this is sound, I haven't been able to test yet, so I don't recommend using the trick to try to add any more than
    1 type.

    Because of the way types have to be added, I am unsure if increasing the number would cause you to run afoul of the non-battle types.
    There could be simple ways around that, if you're knowledgeable/savvy but I just didn't feel comfortable leaving people without that warning.
     
    Last edited:
    11
    Posts
    3
    Years
    • Seen Jul 12, 2021
    Curve low-leveled wild Pokemon (PokeEmerald)

    The level-scaling logic I used is in `src/pokemon.c` in GetPartyMonCurvedLevel(). You will probably want to edit it; the logic I have here was to demonstrate it works, not designed around game balance.

    Locations that can have pokemon with a very wide range of levels will continue to do so; the level ranges are moved up so that the maximum level for wild pokemon is now either the max level in the encounter table, or (2 * curvedLevel + max)/3, whichever is higher. This weights the levels closer to the curve than the original, while maintaining a distinction between low-level areas and high-level ones.

    https://github.com/surskitty/pokeemerald/commit/192bc233a0ef7523289a0314946e9b0af23aac83

    Code:
    git remote add surskitty https://github.com/surskitty/pokeemerald
    git cherry-pick 192bc233a0ef7523289a0314946e9b0af23aac83

    ETA: Vital Spirit et al weren't functioning correctly. That's fixed now. Adjusted level scaling logic for slightly better scaling.
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Wonder Trade (Em)
    I've been working on this for the past 8 days or so, and after so many small issues that I solved thanks to the help of the gang at ROM Hacking Hideout, I think it's finally good to go.
    This is a Pokeemerald port of Deokishisu's Wonder Trade system for Pokeruby, modified to suit my personal tastes and made compatible with the Pokeemerald-expansion.
    Everything is pretty easy to modify as there's a handful of comments here and there, and the code in itself is easy to read too, so y'all can edit the whole thing as you see fit.

    To incorporate this into a project automatically, you'll have to track my repository via git remote and pull my wonder_trade branch using git pull.
    In other words:
    Code:
    git remote add lunos https://github.com/LOuroboros/pokeemerald
    git pull lunos wonder_trade

    Alternatively, you can implement this manually:
    https://github.com/pret/pokeemerald/compare/master...LOuroboros:pokeemerald:wonder_trade

    Video:


    I tried to test it as thoroughly as I could, but I wouldn't be surprised if for whatever reason invalid species or items could be generated.
    I appreciate any and all tests.

    Bugs:
    -Pokémon who can Mega Evolve or who can evolve into a species that can Mega Evolve, can't carry Y Mega Stones. Yes, this only applies to the Charmander Line, but still. (Fixed!)

    And that's pretty much it.​
     
    Last edited:
    11
    Posts
    3
    Years
    • Seen Jul 12, 2021
    Improved Editing Trainer Parties [EM]

    Provides control over most aspects of NPC trainers and homogenizes party types. Based off part of Syreldar's hack. Thanks to UltimaSoul for helping me get it to work.

    How to use:

    Code:
    git remote add surskitty https://github.com/surskitty/pokeemerald
    git pull surskitty trainer_control

    src/data/trainer_parties.h will need all structs changed to TrainerMon and src/data/trainers.h needs to have .TrainerMon instead of .NoItemDefaultMoves et al. Those are both already applied to vanilla, but if you've done substantial edits, keep your versions and then do the find-replace to change structs and .party type.

    More detailed usage notes are over here.
    This has recently had some refactoring to save space and fix bugs.

    I also have made a simpler version that's more space-efficient and does not involve manually selecting IVs and EVs. Instead, you set .build, .hiddenPower, and .difficulty to get an effort and IV setup that does roughly what you want. It's more limited but I'm personally finding it much better suited to my needs.

    .build can be TRAINER_MON_DEFENSES, TRAINER_MON_SPEED_PHYS, TRAINER_MON_SPEED_SPEC, TRAINER_MON_HP_DEF, TRAINER_MON_HP_SPDEF, TRAINER_MON_PHYS, TRAINER_MON_SPEC, and determines EV allocation. Both of the speed options raise the corresponding attack stat. A default build at high difficulty allocates effort points evenly.
    .difficulty TRAINER_EASIEST, TRAINER_EASY, TRAINER_MEDIUM only decide amount of IVs; TRAINER_MEDIUM is maxed. TRAINER_HARD, TRAINER_HARDER, and TRAINER_HARDEST allocate EVs and have maxed IVs. TRAINER_MAX is not player legal and assigns 255 EVs to each stat.
    .hiddenPower takes TYPE_ constants. TYPE_NORMAL is default and gives either worst, best, or average IVs, depending on difficulty. The IV spreads used can be found in include/pokemon_iv_spreads.h .

    Code:
    git remote add surskitty https://github.com/surskitty/pokeemerald
    git pull surskitty trainer_control_v2
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Evolution moves (FR)
    I ported UltimaSoul and Sagiri/Zeturic's implementation of the evolution moves mechanic which I brought here sometime ago to Pokefirered because I was bored.

    The changes can be checked in this commit:
    https://github.com/LOuroboros/pokefirered/commit/c5c27fe5838e10af7bdd9d85cf5f3cd4dc08aba7

    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/pokefirered
    git pull lunos evo_moves

    Pic:
    3L1BLzv.gif


    And that's pretty much it.​
     
    51
    Posts
    13
    Years
  • [pokeemerald] Feed any number of pokéblocks

    All changes are made at src/use_pokeblock.c:

    From the following code, delete what is in RED:

    Spoiler:
     
    853
    Posts
    3
    Years
    • Seen Nov 9, 2023
    probably not something many would want to use, but if you want to remove all instances of critical hits, you can do so with 1 change.

    https://github.com/pret/pokefirered/blob/master/src/battle_script_commands.c#L1219

    this is from pokefirered but the same change can be made in other decomps,

    in the critcalc function make sure gCritMultiplier is set to 1 for both cases.

    That one change prevents crits altogether, that includes bypassing the damage increase, the crit stat bypass, & avoiding the crit message popup.

    Since all of those things, check for if the multiplier is equal to 2.
     
    Last edited:

    takyon

    Villain
    17
    Posts
    6
    Years
    • Seen yesterday

    Move Item [EM]

    Spoiler:

    I'd like to point out that sub_81221EC is now called MenuHelpers_CallLinkSomething()
    (this change was in https://github.com/pret/pokeemerald/commit/74edaed4265cc7e964a5383c3e0fb8ef256f2bf8)
    and SE_HAZURE is now called SE_FAILURE
    and 2 instances of schedule_bg_copy_tilemap_to_vram should be ScheduleBgCopyTilemapToVram (https://github.com/pret/pokeemerald/commit/da3062097a2372539dd7d4b5a43a2098deafc1cb)

    [PokeEmerald] Surfboard instead of HM Surf​
    Spoiler:

    Same case for this, MUS_NAMINORI is now MUS_RG_SURF
    The changes for music file names are here: https://github.com/pret/pokeemerald/commit/30142411799650c17367ce4652269e8ecca7ceef

    For future reference for pret renaming, use git log -n 1 -S <insert your problem function/variable here>

    If this shouldn't be here I apologise but these need to be updated to current pret naming conventions.
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Preset Playable Character Name (Em)
    I was bored, so after seeing a post presenting a different way to achieve this result in "Whack a Hack", I was inspired to come up with a variant of it myself.
    As the title suggests, this makes it so the game won't let you select a name for the playable characters of the game.
    Instead, their names are forced set by us.

    To incorporate this into a project automatically, you'll have to track my repository via git remote and pull my preset_player_name branch using git pull.
    In other words:
    Code:
    git remote add lunos https://github.com/LOuroboros/pokeemerald
    git pull lunos preset_player_name

    Showcase:
    VKuUsWa.gif
    ciX7SNo.gif


    I think it's fairly obvious by just looking at the code, but the strings that manage the playable characters' names are gText_DefaultMaleName and gText_DefaultFemaleName.

    And that's pretty much it.​
     
    Last edited:
    239
    Posts
    8
    Years
    • Seen Apr 15, 2024
    [Pokeemerald] Remove warp's fadescreen effect

    There might come a day where you want to fade the screen to black in a script and play a fanfare, print a message, or do something else, and immediately warp. If you try this in vanilla emerald, the screen will fade FROM black, and then back TO black. Instead, let's create a flag that removes the fadescreen part of the warp script commands and we can do something like this:

    Before:
    lkYbY2N.gif


    After:
    HdnnlF9.gif


    Here's a wiki post with the simple instructions.
     
    239
    Posts
    8
    Years
    • Seen Apr 15, 2024
    [Pokeemerald] Flag to force Shiny Pokemon

    This lets you create a flag that, when set, will cause newly created pokemon (with the player's OTID) to be shiny.

    Check out the wiki post for information

    Example script:
    Code:
    givemon SPECIES_TORCHIC, 13, 0
    givemon SPECIES_ARON, 12, 0
    setflag FLAG_SHINY_CREATION
    givemon SPECIES_MUDKIP, 15, 0
    clearflag FLAG_SHINY_CREATION
    tMvkog4.gif
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Global Field Tints (Em)
    I was bored, so I ported what in Pokefirered is known as gGlobalFieldTintMode.
    What does this let you do? It allows you to put a tint on the elements shown on screen.
    It should be a nice complement for flashback scenes and stuff like that.
    Normally, in FRLG it's purely used in the flashbacks of the Quest Log feature of the game, which plays when you resume a savefile.

    To incorporate this into a project automatically, you'll have to track my repository via git remote and pull my global_field_tints branch using git pull.
    In other words:
    Code:
    git remote add lunos https://github.com/LOuroboros/pokeemerald
    git pull lunos global_field_tints

    Showcase:
    Untitled5994.gif


    To cast a tint, simply call either Script_SetGrayscaleTint or Script_SetSepiaTint in your script.
    Once you're done, call Script_RemoveTint to remove the tint.

    Bugs:
    -Palette glitches when walking in the tall grass
    Fixed.

    -The rain looks black in game
    I've no idea how to solve this and I also don't feel like working on this any longer.
    Any valuable information on how to fix this or ideas about what to try would be well received.

    And that's pretty much it.​
     
    Last edited:
    49
    Posts
    5
    Years
    • Seen Dec 27, 2023
    [Pokeemerald] Updated debug menu!

    n4RWIxf.gif


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

    Also lots of small fixes!

    Credits for the additions:
    Sierraffinity
    Jaizu

    Spoiler:
     
    Last edited:
    853
    Posts
    3
    Years
    • Seen Nov 9, 2023
    Emerald Style Gender Select Intro, in FireRed

    In pokemon emerald, if you chose the no option on the name confirmation menu in the intro,
    it will set you back to where you select your player gender.

    In firered that doesn't exist, instead, you only go back to the naming screen.

    And if you typically fast forward through the intro like I do, there are times, where you accidentally skip
    through the gender select screen without realizing it.

    With a small change to the section of code shown below from the oak_speech.c file, that'll never be a problem again.

    Spoiler:

    All that's needed is replacing Task_OakSpeech24 with OakSpeech16,
    and it'll smoothly transition back to the gender select screen.


    emerald-style-intro.gif
     

    Jaizu

    Average rom hacker
    281
    Posts
    14
    Years
  • [Pokeemerald] New Movement Actions

    This adds new scripting movements, including walking and jumping backwards. See asm/macros/movement.inc for the names to use in scripts. New diagonal movements were not added since some diagonal movements already exist in emerald. This should also be relatively easy to add to pokefirered, if there are interested parties.
    mzyHjIO.gif
    CmKBWsb.gif


    Here is the repo.

    How to Add:
    Credits:
    jiangzhengwenjzw for the source

    If someone is looking for this, it got removed!
    Those actions are actually not needed since we can use lock_facing_direction, like it's used in the Petalburg Woods when the aqua member backs off
    Code:
    PetalburgWoods_Movement_AquaBackOff: @ 822E1F9
    	lock_facing_direction
    	walk_up
    	unlock_facing_direction
    	step_end
     
    10
    Posts
    4
    Years
  • [Pokeemerald] Fix critical bug with wild land Pokemon encounter ratio

    Long time no see guys!
    Thanks to @Axis & @MandL27 from the RomHack Hideout Discord, a critical bug within the calculation of the chance for the land encounters has been discovered, I'm here to share the fix with you guys.

    Short explanation.
    Let's say you have 12 different pokemons in your Map, and you want to evenly distribute their encounter ratios to make them equally rare, the correct thing to do is to set each individual slot's index to the total number of the mons in that zone:

    RU5SjqU.png

    w4idmBU.png


    This will result in all of mons having a 100/12 (8.33%) chance of appearing, which results in a 99.96/100 overall chance, not perfect, but it works perfectly since the way it works is summing all of the indexes and calculating the random for each slot, resulting in a fair calculation. (in out case the sum is 144 (12 mons * 12 value each), so each mon has a 12/144 chances of appearing)

    But it has a critical flaw: The way it's coded.
    This is the current wildmon encounter calc for each index.

    Code:
    static u8 ChooseWildMonIndex_Land(void)
    {
        u8 rand = Random() % ENCOUNTER_CHANCE_LAND_MONS_TOTAL; // 0 to (ENCOUNTER_CHANCE_LAND_MONS_TOTAL-1) [143]
    
        if (rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_0) // if number (0-11) 0 (12 out of 143)
            return 0;
        else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_0 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_1) // if number (12-23) 1 (12 out of 143)
            return 1;
        else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_1 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_2) // if number (24-35) 2 (12 out of 143)
            return 2;
        else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_2 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_3) // if number (36-47) 3 (12 out of 143)
            return 3;
        else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_3 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_4) // if number (48-59) 4 (12 out of 143)
            return 4;
        else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_4 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_5) // if number (60-71) 5 (12 out of 143)
            return 5;
        else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_5 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_6) // if number (72-83) 6 (12 out of 143)
            return 6;
        else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_6 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_7) // if number (84-95) 7 (12 out of 143)
            return 7;
        else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_7 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_8) // if number (96-107) 8 (12 out of 143)
            return 8;
        else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_8 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_9) // if number (108-119) 9 (12 out of 143)
            return 9;
        else if (rand == ENCOUNTER_CHANCE_LAND_MONS_SLOT_9) // if number == 120 10 (1 out of 143)
            return 10;
        else
            return 11; // if number (121-143) 11 (23 out of 143)
    }

    Notice anything weird? Yup, the slot of index 10 will be almost impossible to reach, and the pokemon on the slot of index 11 (the last one) will appear much more likely than it should.

    Fixes:

    Land:
    Code:
    static u8 ChooseWildMonIndex_Land(void)
    Code:
    [COLOR="Red"]else if (rand == ENCOUNTER_CHANCE_LAND_MONS_SLOT_9)[/COLOR]
    Code:
    [COLOR="Lime"]else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_9 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_10)[/COLOR]


    This bug also exists within the Super rod's calculation, which in case of failure, will default to the first slot of the old rod. (Although this is impossible to reproduce on vanilla due to the slot limitations of the rods)

    Fishing:
    Code:
    static u8 ChooseWildMonIndex_Fishing(u8 rod)
    Code:
    [COLOR="Red"]if (rand == ENCOUNTER_CHANCE_FISHING_MONS_SUPER_ROD_SLOT_8)[/COLOR]
    Code:
    [COLOR="Lime"]if (rand >= ENCOUNTER_CHANCE_FISHING_MONS_SUPER_ROD_SLOT_8 && rand < ENCOUNTER_CHANCE_FISHING_MONS_SUPER_ROD_SLOT_9)[/COLOR]

    "Why has no one discovered this before?"

    Truth is Vanilla never had a land zone containing 12 different mons with evenly-distributed chances of appearing, thus this was impossible to notice and reproduce; the only way to notice the issue is inserting 12 different pokemons in a single zone and evenly distribute their chances of appearing, this way you would notice how rare the pokemon on the slot index 10 and how common the mon on the slot index 11 would be compared to all the others
     
    Last edited:
    49
    Posts
    5
    Years
    • Seen Dec 27, 2023
    [Pokeemerald] Only change nicknames of self caught mons!
    This is a super simple addition which limits the nickname changing to Pokemon caught by the player.
    In src/party_menu.c in the function SetPartyMonFieldSelectionActions change it to:
    Code:
    if (!IsTradedMon(&mons[slotId]))
    {
        AppendToList(sPartyMenuInternal->actions, &sPartyMenuInternal->numActions, MENU_NICKNAME);
    }


    Nicknaming as an option in the Pokémon Party Screen (Emerald)​
    Spoiler:
    Spoiler:
     
    Last edited:
    49
    Posts
    5
    Years
    • Seen Dec 27, 2023
    [Pokeemerald] TM Case ported from FR and custom one!

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

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


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

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


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


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

    Special thanks to:
    Jaizu for all the feedback

    Credits:
    TheXaman
     
    Last edited:

    Jaizu

    Average rom hacker
    281
    Posts
    14
    Years
  • [Pokeemerald] Plural giveitem

    Currently the game only properly converts giveitem to a plural string if you are receiving a berry or a poke ball. So I fixed it for all items.

    1cDuh4f.gif


    Here is the repo to pull from. Alternatively, follow the wiki guide

    How to pull from the repo:
    Spoiler:

    Updated the wiki article to give support to found items.
    L7pmXJh.png
     
    80
    Posts
    8
    Years
  • 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 CalcBerryYieldInternal.
    Add this code below the existing variable declarations:
    Code:
    u16 currentMap = ((gSaveBlock1Ptr->location.mapGroup) << 8 | gSaveBlock1Ptr->location.mapNum);
    
    if (currentMap == MAP_ROUTE119 || currentMap == MAP_ROUTE120 || currentMap == MAP_ROUTE123)
            return max;
    The maps used here are just examples, so you can change them to whatever you want. Also, this won't affect trees that have already grown - you'll need to plant new ones to see the effect.

    also have to have "#include "constants/map_groups.h" at the top of src\berry.c, or else it gives an error about the maps being undeclared in that function.
     
    Back
    Top