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

[Other] [Pokeemerald-expansion] Help editing in-game trades?

  • 3
    Posts
    1
    Years
    • He/Him/His
    • Seen Nov 23, 2023
    Hello all, first time poster here. Been a fan of Pokémon ROM hacks for a while now, and have recently started working on one of my own using the pokeemerald-expansion project as a base. I was looking to see if I could change the in-game trades as I think the ones in base Emerald are a bit lacking. I was able to find the data for them easily enough in src/data/trade.h. However, I noticed that there is a variable for "personality", which I assume is for the Personality Value of the traded Pokémon that effects things like gender, nature, shiny-ness, etc. Is there any resource available that shows what values are acceptable to assign the variable to and how exactly they affect the data of the traded Pokémon? Also, if I wanted to change the Pokémon's held item to something other than the piece of mail, would I need to change the mailNum variable to be -1 like it is for the Seedot trade? I'd greatly appreciate any help on this, as I haven't been able to find anything else talking about this on my own.
     
    Hello all, first time poster here. Been a fan of Pokémon ROM hacks for a while now, and have recently started working on one of my own using the pokeemerald-expansion project as a base. I was looking to see if I could change the in-game trades as I think the ones in base Emerald are a bit lacking. I was able to find the data for them easily enough in src/data/trade.h. However, I noticed that there is a variable for "personality", which I assume is for the Personality Value of the traded Pokémon that effects things like gender, nature, shiny-ness, etc. Is there any resource available that shows what values are acceptable to assign the variable to and how exactly they affect the data of the traded Pokémon?
    You can set the personality value to any 32-bit number. This bulbapedia page describes how the value affects different aspects of a Pokemon.

    Also, if I wanted to change the Pokémon's held item to something other than the piece of mail, would I need to change the mailNum variable to be -1 like it is for the Seedot trade?
    It certainly sounds like it. Why don't you try it and see if it works?
     
    While I do appreciate the input, this does remind me of how I should probably include code whenever I have a coding question. I've attached a screenshot of the code for how the in-game Seedot and Plusle available for trade are coded. It's the same in Pokeemerald and in Expansion. As you can see, the .personality variable isn't just a string of 1s and 0s, which is where the confusion comes from. As for the item related question, I'll give it a shot. I'm also interested in assigning them pre-determined movesets, though reviewing the code leads me to believe that I would have to restructure how these Pokémon are generated altogether in order to do so.
     

    Attachments

    • [PokeCommunity.com] [Pokeemerald-expansion] Help editing in-game trades?
      pokeemerald expansion trades.png
      83.6 KB · Views: 9
    As you can see, the .personality variable isn't just a string of 1s and 0s, which is where the confusion comes from.
    Binary and hex(used in the screenshot) are just alternative ways to represent numbers. Thus any decimal number can be represented as a string of 1s and 0s.
    You can use a binary to hex conversion tool to examine/edit individual bits.

    I'm also interested in assigning them pre-determined movesets, though reviewing the code leads me to believe that I would have to restructure how these Pokémon are generated altogether in order to do so.
    While that will require coding, I doubt you actually need to "restructure how these Pokémon are generated altogether".
    Just add the moves to the InGameTrade structure, and add a section of code in CreateInGameTradePokemonInternal that sets the generated mon's moves to those.
     
    That actually makes perfect sense, and I feel a bit silly for not realizing that on my own 😅 Appreciate you taking the time to help me sort this out!
     
    Back
    Top