• Our software update is now concluded. You will need to reset your password to log in.
  • Please note that the site will be down briefly around 10AM EST, 23 February, for planned maintenance.
  • Welcome to PokéCommunity! Register now and join one of the best places on the 'net to talk Pokémon and more! Community members will not see the bottom screen advertisements.
  • Want to share your adventures playing Pokémon?
    Check out our new Travel Journals forum for sharing playthroughs of ROM Hacks, Fan Games, and other Pokémon content!
  • IMPORTANT: Following a takedown request, the following hacks have been delisted from PokéCommunity:

    • Pokémon Glazed
    • Pokémon: Giratina Strikes Back
    • Pokémon Flora Sky
    • Pokémon Stranded
    The downloads and discussion threads for these hacks will no longer be accessible, and staff will be unable to return questions regarding accessing this content.

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

3
Posts
167
Days
  • Age 26
  • 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.
 
421
Posts
6
Years
  • Age 37
  • Seen today
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?
 
3
Posts
167
Days
  • Age 26
  • Seen Nov 23, 2023
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

  • pokeemerald expansion trades.png
    pokeemerald expansion trades.png
    83.6 KB · Views: 7
421
Posts
6
Years
  • Age 37
  • Seen today
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.
 
3
Posts
167
Days
  • Age 26
  • Seen Nov 23, 2023
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