• 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.

Trading with your self & Shiny Odds

31
Posts
3
Years
    • Seen Oct 7, 2023
    I have 2 main things I want to do right now. First is add someone who lets you trade with yourself (or they trade with you; basically just a guy to evolve trade evo pokemon), and second is to increase the shiny odds. I got the idea for the self trading from this post, however it didn't work. When I did version number one (trading with myself), the trade would seem to go through, but then my text frame would change and my inventory would be full of bad eggs. Version 2 did essentially the same but my pokemon would turn into a bad egg during the trade and the end result would be the same. When I asked the guide creator, he said that the scripting commands are probably outdated, so if someone knows what to do, or has an idea, it would help.
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • I got the idea for the self trading from this post, however it didn't work. When I did version number one (trading with myself), the trade would seem to go through, but then my text frame would change and my inventory would be full of bad eggs. Version 2 did essentially the same but my pokemon would turn into a bad egg during the trade and the end result would be the same. When I asked the guide creator, he said that the scripting commands are probably outdated, so if someone knows what to do, or has an idea, it would help.
    I just tried the v1 myself in a clean copy of Pokeemerald and it seems to work fine, leaving aside the fact that the partner NPC doesn't have a valid name.

    Here's the diff: https://pastebin.com/byMzF7S6
    and second is to increase the shiny odds.
    Modify the value of SHINY_ODDS in include/constants/pokemon.h.
    The newer games use a value of 16/65536.

    Alternatively, do extra rolls just like the Pokeemerald-expansion's item_expansion branch does.
    https://github.com/rh-hideout/pokeemerald-expansion/blob/item_expansion/src/pokemon.c#L2229-L2239
     
    31
    Posts
    3
    Years
    • Seen Oct 7, 2023
    I just tried the v1 myself in a clean copy of Pokeemerald and it seems to work fine, leaving aside the fact that the partner NPC doesn't have a valid name.

    Here's the diff: https://pastebin.com/byMzF7S6

    Modify the value of SHINY_ODDS in include/constants/pokemon.h.
    The newer games use a value of 16/65536.

    Alternatively, do extra rolls just like the Pokeemerald-expansion's item_expansion branch does.
    https://github.com/rh-hideout/pokeemerald-expansion/blob/item_expansion/src/pokemon.c#L2229-L2239

    I really don't understand what my issue is. I did the dynamic trade name fix that the original guide said to do:

    Code:
    static void BufferTradeSceneStrings(void)
    {
        u8 mpId;
        u8 name[20];
        const struct InGameTrade *ingameTrade;
    
        if (sTradeData->isLinkTrade)
        {
            mpId = GetMultiplayerId();
            StringCopy(gStringVar1, gLinkPlayers[mpId ^ 1].name);
            GetMonData(&gEnemyParty[gSelectedTradeMonPositions[TRADE_PARTNER] % PARTY_SIZE], MON_DATA_NICKNAME, name);
            StringCopy10(gStringVar3, name);
            GetMonData(&gPlayerParty[gSelectedTradeMonPositions[TRADE_PLAYER]], MON_DATA_NICKNAME, name);
            StringCopy10(gStringVar2, name);
        }
        else
        {
    	GetMonData(&gEnemyParty[0], MON_DATA_OT_NAME, gStringVar1);
    	GetMonData(&gEnemyParty[0], MON_DATA_NICKNAME, name);
    	StringCopy10(gStringVar3, name);
    	GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, name);
    	StringCopy10(gStringVar2, name);
        }
    }

    as well as the other change that the guide said to do:

    Code:
    void CreateInGameTradePokemon(void)
    {
    	if (gSpecialVar_0x8004 == 6)  // Version 1 (a value greater than return value range of 0-5 and not 255)
                 gEnemyParty[0] = gPlayerParty[gSpecialVar_0x8005];
            else
                 _CreateInGameTradePokemon(gSpecialVar_0x8005, gSpecialVar_0x8004);
    }

    I'll attach my code for my npc as well as what it looks like in porymap but I really don't know what is wrong.
     

    Attachments

    • Trading with your self & Shiny Odds
      Screenshot 2021-12-17 123547.png
      26.5 KB · Views: 1
    • Trading with your self & Shiny Odds
      Screenshot 2021-12-17 124929.png
      42.3 KB · Views: 1
    31
    Posts
    3
    Years
    • Seen Oct 7, 2023
    I just tried the v1 myself in a clean copy of Pokeemerald and it seems to work fine, leaving aside the fact that the partner NPC doesn't have a valid name.

    Here's the diff: https://pastebin.com/byMzF7S6

    Modify the value of SHINY_ODDS in include/constants/pokemon.h.
    The newer games use a value of 16/65536.

    Alternatively, do extra rolls just like the Pokeemerald-expansion's item_expansion branch does.
    https://github.com/rh-hideout/pokeemerald-expansion/blob/item_expansion/src/pokemon.c#L2229-L2239

    Oh and changing the value of shiny odds didn't work I thought maybe I needed to edit something elsewhere but I wasn't sure.
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • I really don't understand what my issue is. I did the dynamic trade name fix that the original guide said to do:

    Code:
    static void BufferTradeSceneStrings(void)
    {
        u8 mpId;
        u8 name[20];
        const struct InGameTrade *ingameTrade;
    
        if (sTradeData->isLinkTrade)
        {
            mpId = GetMultiplayerId();
            StringCopy(gStringVar1, gLinkPlayers[mpId ^ 1].name);
            GetMonData(&gEnemyParty[gSelectedTradeMonPositions[TRADE_PARTNER] % PARTY_SIZE], MON_DATA_NICKNAME, name);
            StringCopy10(gStringVar3, name);
            GetMonData(&gPlayerParty[gSelectedTradeMonPositions[TRADE_PLAYER]], MON_DATA_NICKNAME, name);
            StringCopy10(gStringVar2, name);
        }
        else
        {
    	GetMonData(&gEnemyParty[0], MON_DATA_OT_NAME, gStringVar1);
    	GetMonData(&gEnemyParty[0], MON_DATA_NICKNAME, name);
    	StringCopy10(gStringVar3, name);
    	GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, name);
    	StringCopy10(gStringVar2, name);
        }
    }

    as well as the other change that the guide said to do:

    Code:
    void CreateInGameTradePokemon(void)
    {
    	if (gSpecialVar_0x8004 == 6)  // Version 1 (a value greater than return value range of 0-5 and not 255)
                 gEnemyParty[0] = gPlayerParty[gSpecialVar_0x8005];
            else
                 _CreateInGameTradePokemon(gSpecialVar_0x8005, gSpecialVar_0x8004);
    }

    I'll attach my code for my npc as well as what it looks like in porymap but I really don't know what is wrong.
    I didn't apply Ghoul's dynamic trade names when I tested it 2 weeks ago in my previous post.
    I'll give it a try and edit this post in a moment.

    EDIT: Nope, still working fine on my end.


    Here's the new diff (I edited the old paste I made 2 weeks ago when I tested this for you): https://pastebin.com/byMzF7S6
    Oh and changing the value of shiny odds didn't work I thought maybe I needed to edit something elsewhere but I wasn't sure.
    It totally works, there's no way it couldn't unless you yourself removed the usages of the SHINY_ODDS constant from the codebase.
     
    Last edited:
    31
    Posts
    3
    Years
    • Seen Oct 7, 2023
    I didn't apply Ghoul's dynamic trade names when I tested it 2 weeks ago in my previous post.
    I'll give it a try and edit this post in a moment.

    EDIT: Nope, still working fine on my end.


    Here's the new diff (I edited the old paste I made 2 weeks ago when I tested this for you): https://pastebin.com/byMzF7S6

    It totally works, there's no way it couldn't unless you yourself removed the usages of the SHINY_ODDS constant from the codebase.

    The only difference in code I see in the paste bin is that my trade.c file has 'StringCopy10' instead of 'StringCopy_Nickname'

    I'm also not sure what it means in the past bin when it says:

    Code:
    --- a/src/trade.c
    +++ b/src/trade.c
    @@ -3271,9 +3271,9 @@ static void BufferTradeSceneStrings(void)

    I get that the minuses are talking about removed lines and the opposite for the plus signs but I don't know what the numbers mean so maybe I'm missing something.

    EDIT: I just tried this in the pokeemerald expansion decomp I have and it worked, I guess either my original pokeemerald decomp is outdated or I must have done something to it, but if you know what that could possibly be I could try to change it
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • The only difference in code I see in the paste bin is that my trade.c file has 'StringCopy10' instead of 'StringCopy_Nickname'

    I'm also not sure what it means in the past bin when it says:

    Code:
    --- a/src/trade.c
    +++ b/src/trade.c
    @@ -3271,9 +3271,9 @@ static void BufferTradeSceneStrings(void)

    I get that the minuses are talking about removed lines and the opposite for the plus signs but I don't know what the numbers mean so maybe I'm missing something.
    Forget about the numbers and focus on the plus/minus signs.
    Effectively, minus signs represent removed/old code, while the plus signs represent the replacing/new code.
    EDIT: I just tried this in the pokeemerald expansion decomp I have and it worked, I guess either my original pokeemerald decomp is outdated or I must have done something to it, but if you know what that could possibly be I could try to change it
    I don't. Sorry. As you can see, I tried the code on a clean Pokeemerald repository and things just work.
    It's clear there's something wrong with your personal project, but I don't really have any clues to help you troubleshoot the problem, so there isn't much that I can do.
    Maybe try asking in Pret's Discord. Though the people there will likely ask you to provide more info than just "I did X in my project and it doesn't work, but it works on a clean copy".
     
    Last edited:
    31
    Posts
    3
    Years
    • Seen Oct 7, 2023
    Forget about the numbers and focus on the plus/minus signs.
    Effectively, minus signs represent removed/old code, while the plus signs represent the replacing/new code.

    I don't. Sorry. As you can see, I tried the code on a clean Pokeemerald repository and things just work.
    It's clear there's something wrong with your personal project, but I don't really have any clues to help you troubleshoot the problem, so there isn't much that I can do.
    Maybe try asking in Pret's Discord. Though the people there will likely ask you to provide more info than just "I did X in my project and it doesn't work, but it works on a clean copy".

    I just tried working backwords and seeing what specifically causes the issue. I added 30 more tms, new moves, and the trading npc and it turns out when I removed the new moves, the npc worked. I do want to have new moves but it is at least good to know what is causing the issue. The problem is where to go from here (oh and the shiny odds thing worked I just messed it up before).
     
    Back
    Top