• 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

24
Posts
10
Years
    • Seen yesterday
    [Pokeemerald] DS-Style party screen (2 versions)
    Changes the party screen to one similar to the DS versions. 2 different layouts available!
    V1:
    Simple Modifications Directory

    V2:
    Simple Modifications Directory


    How to:
    V1: Have a look at the following commit for the main implementation LINK.
    V2: Implement the first version and the have a look at the commit LINK

    Or clone it into your repo:
    Code:
    git remote add xaman https://github.com/TheXaman/pokeemerald/
    For version 1:
    Code:
    git pull xaman tx_ui_party_screen_ds_style_1
    For version 2:
    Code:
    git pull xaman tx_ui_party_screen_ds_style_2

    Thats it! If you find any bugs, let me know.
    If you want to change the look of the windows you need to alter graphics/interface/party_menu_bg.png

    Eggs:
    Simple Modifications Directory
    Double battles:
    Simple Modifications Directory



    Known bugs ONLY V1: Healing via potion "breaks" the slash between hp and maxHp


    Credits:
    TheXaman
    visually inpsired by Lunos binary version, but no code or assets used.

    If you add DisplayPartyPokemonMaxHPCheck after DisplayPartyPokemonHPCheck in Task_PartyMenuModifyHP the potion bug does not occur
     
    24
    Posts
    10
    Years
    • Seen yesterday
    [pokeemerald] Power item and Destiny Knot breeding

    I spent a few hours on this so I thought I would share.
    Makes Power item holders pass the appropriate IVs to their offspring and makes Destiny Knot holders' offspring inherit 5 IVs from their parents instead of 3.
    If both parents hold the same power item it takes the first ones' IV, not 50% chance for each like in the newer games.

    In include/constants/daycare.h add:
    Code:
    #define INHERITED_IV_DESTINY_KNOT_COUNT 5

    In src/daycare.c add:
    Code:
    #include "constants/hold_effects.h"

    Change InheritIVs function in src/daycare.c to:
    Spoiler:

    edit: utilize power item secondary ids
     
    Last edited:
    180
    Posts
    6
    Years
    • Seen Apr 15, 2024
    [AI] Switch If Specific Pokémon Has Specific Super Effective Revealed Move [EM]
    in battle_ai_switch_items.c
    Code:
    static bool8 EnemyMonHasSpecificSuperEffectiveRevealedMove(void)
    {
        u8 opposingPosition = BATTLE_OPPOSITE(GetBattlerPosition(gActiveBattler));
    	if (gBattleMons[GetBattlerAtPosition(opposingPosition)].species == [B]YOUR_SPECIES_HERE[/B]) {
    		u8 moveFlags = AI_TypeCalc(gLastLandedMoves[gActiveBattler], gBattleMons[gActiveBattler].species, gBattleMons[gActiveBattler].ability);
    		if (gLastLandedMoves[gActiveBattler] == [B]YOUR_MOVE_HERE[/B] && (moveFlags & MOVE_RESULT_SUPER_EFFECTIVE)) {
    			*(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE;
    			BtlController_EmitTwoReturnValues(1, B_ACTION_SWITCH, 0);
    			return TRUE;
    		}
    	}
    }
    in ShouldSwitch
    Code:
    	if (EnemyMonHasSpecificSuperEffectiveRevealedMove())
    		return TRUE;

    Id love to add this feature, but each time ive tried it, it softlocks the game once a battle starts and im about to use a move, specially with stronger enemies, like the Elite 4
     
    4
    Posts
    3
    Years
    • Seen Dec 27, 2022
    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.

    Simple Modifications Directory

    when i try to compile i get this error, "src/pokemon_storage_system.c: In function `FieldTask_ReturnToPcMenu':
    src/pokemon_storage_system.c:1676: too few arguments to function `FlagGet'" would you know why?
     
    180
    Posts
    6
    Years
    • Seen Apr 15, 2024
    when i try to compile i get this error, "src/pokemon_storage_system.c: In function `FieldTask_ReturnToPcMenu':
    src/pokemon_storage_system.c:1676: too few arguments to function `FlagGet'" would you know why?
    I really don't know why this would be happening, since FlagGet only has one argument. Maybe you've added that part of the tutorial wrong?
    Could you attach one image of how that part of your code looks so i can see what's wrong?
     

    AsparagusEdu

    AsparagusEduardo
    30
    Posts
    10
    Years
    • Seen May 8, 2024
    "Move Pokémon" as first PSS option [EM]
    Simple Modifications Directory

    In "src/pokemon_storage_system.c", look for the enum where OPTION_MOVE_MONS is defined and change its order.

    Spoiler:

    Finally decided to come back and update this post. Now that the PC has been more properly documented, changing the option order should be as simple as changing it in the enum
     
    207
    Posts
    8
    Years
    • Seen today
    [Pokeemerald] Earn battle points from trainer battles (with a variable)

    The following changes allow you to earn battle frontier points from trainer battles by setting a variable.
    Variable 0x8003 is used to activate this routine and also overrides the current trainer battle transition (a random transition from the battle frontier table is used instead).
    Variable 0x8004 controls the amount of points earned from the battle. By default, the string is limited to 3 digits (999 points).

    Both variables need to be set before the trainerbattle command, and they are automatically reset upon the player winning (or upon whiteout).

    All of the changes can be found in this commit:
    https://github.com/Scyrous/pokeemerald/commit/f69452cb557bc2b06bf68fab67a6920621e28541

    Demonstration:
    Simple Modifications Directory

    After defeating Steven in battle, the player earns a whopping 15 battle points.

    Usage:

    I found a couple of bizarre bugs.

    I've been trying to make the code work for like an hour, but every time I got into a trainer battle with those vars, the game created a battle with a female swimmer for some reason (and crashed after battle). After a few code checks (which I'm sure it's perfectly implemented), I discovered that if you want the code to work, you need to talk with the NPC and not let the NPC see you.
    The second bug is that even if you talk to the NPC, and get the BP as expected after battle, the trainer that you just defeated will now see you and start again a new trainerbattle. This time, again, with a female swimmer that crashes the game after battle.
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Text shortcut to print a Pokémon's nickname [Em]
    I did this as a workaround to a problem I was having.
    I decided to come and share it because why not.

    Text strings have access to buffers that allow you to store whatever you want in them, or that store specific things such as words.
    I added one such buffer that upon being invoked, gets filled with the nickname of the Pokémon whose slot is stored in the var 0x8004.
    As one can guess, I made this to work in conjunction with things like the special ChoosePartyMon.

    Usage:
    Store the slot of a Pokémon in either the Player's or the Enemy's party in the variable 0x8004, and then write a text string invoking the buffer just like you would invoke any other string buffer.
    Code:
    MauvilleCity_EventScript_CitySign::
            special ChoosePartyMon
            waitstate
    	msgbox MauvilleCity_Text_CitySign, MSGBOX_SIGN
    	end
    
    MauvilleCity_Text_CitySign:
    	.string ""That's a cute {CHOSEN_MON_NICKNAME}!"$"

    To put an example, let's say I picked my Torchic named Chckn.
    The string will say ""That's a cute Chckn!"" InGame.

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

    And that's pretty much it.​
     
    4
    Posts
    3
    Years
    • Seen Dec 27, 2022
    IV Checker NPC [EM]
    If there's a better way to do this, please let me know! I'm rather new to decomp stuff, but wanted to try this out.​

    In data\scripts.inc, add these lines:
    Code:
    	def_special GetHpIV
    	def_special GetAtkIV
    	def_special GetDefIV
    	def_special GetSpAtkIV
    	def_special GetSpDefIV
    	def_special GetSpeedIV

    In src\pokemon.c (or any file in src that has access to pokemon.h), add these lines:
    Code:
    u16 GetHpIV(void)
    {
    	return GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_HP_IV, NULL);
    }
    u16 GetAtkIV(void)
    {
    	return GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_ATK_IV, NULL);
    }
    u16 GetDefIV(void)
    {
    	return GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_DEF_IV, NULL);
    }
    u16 GetSpAtkIV(void)
    {
    	return GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_SPATK_IV, NULL);
    }
    u16 GetSpDefIV(void)
    {
    	return GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_SPDEF_IV, NULL);
    }
    u16 GetSpeedIV(void)
    {
    	return GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_SPEED_IV, NULL);
    }

    Then, add these scripts to whatever map's scripts.inc that you want the IV Checker to be in.
    Code:
    Script_IVChecker::
    	lock
    	faceplayer
    	bufferpartymonnick 0, 0
    	msgbox Text_IVChecker_1, MSGBOX_DEFAULT
    	specialvar VAR_RESULT, GetHpIV
    	buffernumberstring 0, VAR_RESULT
    	specialvar VAR_RESULT, GetAtkIV
    	buffernumberstring 1, VAR_RESULT
    	specialvar VAR_RESULT, GetDefIV
    	buffernumberstring 2, VAR_RESULT
    	msgbox Text_IVChecker_2, MSGBOX_DEFAULT
    	specialvar VAR_RESULT, GetSpAtkIV
    	buffernumberstring 0, VAR_RESULT
    	specialvar VAR_RESULT, GetSpDefIV
    	buffernumberstring 1, VAR_RESULT
    	specialvar VAR_RESULT, GetSpeedIV
    	buffernumberstring 2, VAR_RESULT
    	msgbox Text_IVChecker_3, MSGBOX_DEFAULT
    	release
    	end
    
    Text_IVChecker_1:
    	.string "Your {STR_VAR_1}...$"
    
    Text_IVChecker_2:
    	.string "Its HP IV is {STR_VAR_1}.\p"
    	.string "Its Attack IV is {STR_VAR_2}.\p"
    	.string "Its Defense IV is {STR_VAR_3}.$"
    
    Text_IVChecker_3:
    	.string "Its Special Attack IV is {STR_VAR_1}.\p"
    	.string "Its Special Defense IV is {STR_VAR_2}.\p"
    	.string "Its Speed IV is {STR_VAR_3}.\n"
    	.string "You're welcome.$"

    Add Script_IVChecker to an NPC (I used PoryMap to do this), and talk to the NPC. Your result should look like this!

    Simple Modifications Directory


    scripts.inc is meant to be specials.inc btw.
     
    10
    Posts
    13
    Years
    • Seen Dec 7, 2022
    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.

    Simple Modifications Directory


    It works until I reach the point where that Devcorp employee gives me the pokenav. The employee waits while I call the devcorp president and the "PC" option dissapears when I open start to do that call strangely, after the employee leaves and I press the start menu again the game freezes and I cant do anything. I've checked the code a dozen times and its exactly the same I'm not sure what I'm missing.

    Also your code creates two PC options in the start menu after I recieve my starter
     
    Last edited:
    21
    Posts
    5
    Years
    • Seen today
    Smogon Stats [EM]
    This allows you to use Smogon statistics for things. Maybe you could code an AI or a competitive Pokemon mode, idk.
    In pokemon.h:
    Code:
    struct __attribute__((packed, aligned(2))) SmogonTeams {
        u16 species;
        u16 item;
        u8 ability;
        u16 moves[4];
        u8 evs[6];
        u8 ivs[6];
        u8 nature;
        u8 nickname[11];
    };
    
    struct SmogonMoves {
        u16 move;
        u16 usage;
    };
    
    struct SmogonSpreads {
    	u8 nature;
        u8 spread[6];
        u16 usage;
    };
    
    struct SmogonItems {
        u16 item;
        u16 usage;
    };
    
    struct SmogonCaC {
        u16 species;
        u16 weightedScore;
    };
    
    struct SmogonTeammates {
        u16 species;
        u16 usage;
    };
    
    struct SmogonAbilities {
        u8 ability;
        u16 usage;
    };
    
    struct Smogon {
    	const struct SmogonTeams (*teams)[6];
    	u16 usage;
    	const struct SmogonMoves *moves;
    	const struct SmogonSpreads *spreads;
    	const struct SmogonItems *items;
    	const struct SmogonCaC *cac;
    	const struct SmogonTeammates *teammates;
    	const struct SmogonAbilities *abilities;
    	u16 teamsCount;
    	u8 movesCount, spreadsCount, itemsCount, cacCount, teammatesCount, abilitiesCount;
    };
    Attached is a smogon.h file you put in the src/data/pokemon folder (or wherever).

    Update: Here's one for National Dex:
    Code:
    struct SmogonMoves 
    {
        u16 move;
        u16 usage;
    };
    
    struct SmogonItems 
    {
        u16 item;
        u16 usage;
    };
    
    struct SmogonChecksAndCounters 
    {
        u16 species;
        u16 usage;
    };
    
    struct SmogonTeammates
    {
        u16 species;
        u16 usage;
    };
    
    struct Smogon
    {
        const struct SmogonMoves *moves;
        const struct SmogonItems *items;
        const struct SmogonChecksAndCounters *checksAndCounters;
        const struct SmogonTeammates *teammates;
        u16 usage, movesCount;
        u8 itemsCount;
        u16 cacCount, teammatesCount;
    };
    See smogon_nat_dex.h (for use with pokeemerald-expansion).
     

    Attachments

    • smogon_nat_dex.h
      10.6 MB · Views: 24
    • smogon.h
      4 MB · Views: 10
    Last edited:

    Jessler

    PidgeyFox
    33
    Posts
    6
    Years
  • [pokeemerald] Overworld Expansion

    This has been around for a while now, but slawter's repo is pretty out of date and lost in other posts so I thought i would post here for posterity.

    This simply expands the graphicsId from u8 to u16 (up to 65535). Link to my maintained branch

    How to use:
    • Pull from the repo
    • Add new object graphics Ids to include/constants/event_objects.h
    • Make sure you update NUM_OBJ_EVENT_GFX!!!
    • Add new overworld objects as normal (see this wiki post)

    Hey, just pulled this and literally every overworld sprite is now Brendan (playing as female). What did I do wrong?

    EDIT: Doesn't seem to matter what gender I am. Everyone is still Brendan as the male player.

    EDIT 2: A make clean fixed it, nevermind!
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Gen. 6 styled Exp. Share (Em)

    For battle_engine users:
    Code:
    git remote add lunos https://github.com/LOuroboros/pokeemerald
    git pull lunos gen6_exp_share_BE

    EDIT (10/06/2022):
    I edited the post yet again, linking an alternative branch I made for battle_engine users, mostly because handling the changes to Cmd_getexp can be daunting to newbies.
    If anyone spots any mistakes I may have made, please let me know.

    Also, this branch varies quiet a bit from the other one, as I now use an unused flag to handle toggling the system On/Off instead of adding a whole new variable to the SaveBlock1 for it pointlessly.
    Feel free to change which flag is used or whatever if you want or need to.
    Quoting the most relevant parts as a heads up. I added a Gen. 6 Exp. Share branch for battle_engine users.
     
    Last edited:

    Deokishisu

    Mr. Magius
    990
    Posts
    18
    Years
  • Move Item [EM]

    Spoiler:

    This code leaves out an important restriction. The player should not be able to initiate moving an item on a Pokemon with an item and then swap it with a Pokemon holding mail. Doing so can create blank mails that cannot be removed from a Pokemon by normal means.

    In CursorCb_MoveItemCallback, under the check for eggs and giving to the same Pokemon in case 1, add this code:
    Code:
        case 1:     // User hit A on a Pokemon
            // Pokemon can't give away items to eggs or themselves
            if (GetMonData(&gPlayerParty[gPartyMenu.slotId2], MON_DATA_IS_EGG)
                || gPartyMenu.slotId == gPartyMenu.slotId2)
            {
                PlaySE(SE_FAILURE);
                return;
            }
    
            [span="background-color:green"]if(GetMonData(&gPlayerParty[gPartyMenu.slotId2], MON_DATA_HELD_ITEM) >= ITEM_ORANGE_MAIL[/span]
            [span="background-color:green"]&& GetMonData(&gPlayerParty[gPartyMenu.slotId2], MON_DATA_HELD_ITEM) <= ITEM_RETRO_MAIL)[/span]
            [span="background-color:green"]{[/span]
                [span="background-color:green"]PlaySE(SE_FAILURE);[/span]
                [span="background-color:green"]return;[/span]
            [span="background-color:green"]}[/span]
     
    55
    Posts
    1
    Years
    • Seen May 11, 2024
    [Pokeemerald] Toggle Trainers "Seeing" You

    This is probably mostly useful for a debug menu, but could have utility for certain game events.
    • Add FLAG_TOGGLE_TRAINER_BATTLES in include/constants/flags
    • Change CheckForTrainersWantingBattle in src/trainer_see.c to:
      Code:
      bool8 CheckForTrainersWantingBattle(void)
      {
          u8 i;
          
          if (FlagGet(FLAG_TOGGLE_TRAINER_BATTLES))
              return FALSE;
          
          gNoOfApproachingTrainers = 0;
          //etc...
    • set FLAG_TOGGLE_TRAINER_BATTLES in a script or function!

    Obviously, still talking directly to the trainer will trigger the battle, but they won't catch sight of you.

    I don't know why but this causes problem specifically with the team fight with Steven. Any trainer fight after that match will make you fight Maxie again and then no encounters after that.
     
    Back
    Top