• 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?".
  • Forum moderator applications are now open! Click here for details.
  • 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.

Code: Trainers with EVs

199
Posts
12
Years
  • Seen Jul 18, 2016
I've revised the code and updated the OP with it. This fixed wild/gift pokemon no longer having randomized IVs- there is also no risk of them getting EVs or custom balls if you forget to sanitize the 33rd entry in the table.

Oh. So then I can just leave it filled with FF then?
 

pawell6

The truthseeker
50
Posts
14
Years
I made a screenshot. In the offset 0xEFFF90 is trainer data and 0xF00000, 0xF10000, and so on are spreads from table. Red 00 are number of spread from table. When I change red 00 to 01 spread from offset 0xF10000 doesn't load and the spread from 0xF00000 is loaded instead (ofcourse I tested it after saving in a hex editor and noticed that opponent's pokeball doesn't change from masterball to ultraball).
As I stated before, the spread from 0xF10000 load only if red 00 is changed to 09. So spreads are loaded in such way:
0x00 -> offset 0xF00000
0x09 -> offset 0xF10000
0x12 -> offset 0xF20000
0x1B -> offset 0xF30000
instead of
0x00 -> offset 0xF00000
0x01 -> offset 0xF10000
0x02 -> offset 0xF20000
0x03 -> offset 0xF30000
 

DoesntKnowHowToPlay

Tiny Umbrella with Lots and Lots of Good
265
Posts
12
Years
  • Seen Feb 24, 2024
Make sure you're inserting *all* of the asm- not all of it will be at the end of the binary. In FR, you'll also need to go 0x115f6 and 0x3dc70. It sounds like you didn't grab all of the first block, which makes the game load the entire byte of IV data instead of reducing it to a 0-31 range.
 

pawell6

The truthseeker
50
Posts
14
Years
I checked several times, in 0x115f6 I inserted 08 1C 00 00 00 00 00 00 00 00, in 0x3dc70 I inserted 00 00 00 00 00 49 08 47 01 00 F1 08 and in 0xF10000 I insterted
68 46 40 7C 20 28 5A D0 68 46 40 7C 00 01 30 4A 12 18 05 32 1A 21 38 1C 00 F0 53 F8 68 46 40 7C 00 01 2B 4A 12 18 06 32 1B 21 38 1C 00 F0 49 F8 68 46 40 7C 00 01 26 4A 12 18 07 32 1C 21 38 1C 00 F0 3F F8 68 46 40 7C 00 01 21 4A 12 18 08 32 1D 21 38 1C 00 F0 35 F8 68 46 40 7C 00 01 1C 4A 12 18 09 32 1E 21 38 1C 00 F0 2B F8 68 46 40 7C 00 01 17 4A 12 18 0A 32 1F 21 38 1C 00 F0 21 F8 68 46 40 7C 00 01 12 4A 12 18 0B 32 26 21 38 1C 00 F0 17 F8 69 46 48 7C 00 01 0D 4A 12 18 12 79 4A 74 38 1C 27 21 6A 46 11 32 00 F0 0A F8 38 1C 28 21 6A 46 11 32 00 F0 04 F8 03 49 08 47 03 49 08 47 04 4B 18 47 C0 46 8B DC 03 08 D1 DC 03 08 00 00 F0 08 D1 04 04 08
and it's the same: instead of 255 available spreads I "only" have 29 :(
 

pawell6

The truthseeker
50
Posts
14
Years
Wait. What game are you trying to apply this to?

Pokemon Fire Red. Well it's been modified version with physical/special split patch.

Edit: The same thing happens when applying to clean rom.
 
Last edited:
199
Posts
12
Years
  • Seen Jul 18, 2016
Pokemon Fire Red. Well it's been modified version with physical/special split patch.

I don't know then..I am using Emerald.

----

I think I found a bug.
After the credits you select what colo(u)r pokemon was seen on TV to choose what Lati twin you want. Choosing either of them "freezes" the game. Music continues to play though. I made sure this wasn't just something else I did to the ROM. I tested it on previous backups and finally a clean ROM. Still freezes if this asm is applied to it.

Any ideas?

EDIT: I recall reading that the Pokemon's(Latios/Latias) IVs and such are created when you select either RED/BLUE. Could the 33rd slot be affecting this or is that out of the question now?
 
Last edited:

DoesntKnowHowToPlay

Tiny Umbrella with Lots and Lots of Good
265
Posts
12
Years
  • Seen Feb 24, 2024
Updated the method. It now is inserted during code that is used only when loading trainers- this means wild pokemon and event mons should be unaffected. It also means you don't have to worry about the 33rd slot- it can be treated like any other. This should also fix the issue with the Latis.

Note that the adjustment means that the method now only works for trainers with custom movesets and items.

Pawell6, I honestly don't know what's going on with your ROM- try the new method and see if it works? It sounds like the initial loading of the IV values didn't get changed properly, as that would explain why you have fewer spreads, but if you did what you said you did it should probably work.
 
199
Posts
12
Years
  • Seen Jul 18, 2016
Updated the method. It now is inserted during code that is used only when loading trainers- this means wild pokemon and event mons should be unaffected. It also means you don't have to worry about the 33rd slot- it can be treated like any other. This should also fix the issue with the Latis.

Note that the adjustment means that the method now only works for trainers with custom movesets and items.

That is great. Thanks for this.
EDIT: It has indeed fixed the lati issue.
 
Last edited:

pawell6

The truthseeker
50
Posts
14
Years
I tested with the new method and everything works fine now :). Thanks for help.
 

Agastya

Grinding failed. Item Grind level dropped by 3.
73
Posts
14
Years
  • Age 33
  • Seen Mar 19, 2023
I made a Nightmare table to make it easier to edit EV spreads.

You may need to edit EV Hack Module.nmm depending on where you dumped the EV spread table.
Just open it in a text editor of your choice and at the start where it says..

Code:
1
EV Hack EV Spread Table Module
[S-HIGHLIGHT]0xF00000[/S-HIGHLIGHT]
256
16
Table Values.txt
NULL

.. change 0xF00000 to wherever you dropped your EV spread table.

The values in Table Values.txt are based off the AI values displayed in A-Trainer. You may add text after the numbers shown if you want to leave a note on what ball to use or what kind of EV spread you put there.

You will obviously need Nightmare to use this. If you don't have Nightmare 1, you'll have to settle for Nightmare 2.
 
Last edited:

DoesntKnowHowToPlay

Tiny Umbrella with Lots and Lots of Good
265
Posts
12
Years
  • Seen Feb 24, 2024
I updated the method again. It now allows for custom natures. Because this works by changing the personality value and trainer ID, it is very likely to disagree with shiny hacks- you should be able to get around this by not using spreads with defined natures for shiny trainer pokemon though.
 

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
Note that the adjustment means that the method now only works for trainers with custom movesets and items.

So does this mean, without custom movesets and items, trainers will just have the normal IV spread? or do trainers now have to use custom movesets and items? To be honest it's not a big deal, because you can even make the trainer hold useless items and give them their default level moves.

Great hack! Keeps getting better and better.
 

DoesntKnowHowToPlay

Tiny Umbrella with Lots and Lots of Good
265
Posts
12
Years
  • Seen Feb 24, 2024
So does this mean, without custom movesets and items, trainers will just have the normal IV spread? or do trainers now have to use custom movesets and items?

The former. And as you mentioned, you can just manually plug in default or bad sets and let them hold nothing, they just have to use the custom moves+custom items data type. I think I know how to fix this though- I'll see if I can squeeze some time in tomorrow to take a look at it.
 

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
Spoiler:
The former. And as you mentioned, you can just manually plug in default or bad sets and let them hold nothing, they just have to use the custom moves+custom items data type. I think I know how to fix this though- I'll see if I can squeeze some time in tomorrow to take a look at it.

Awesome this is really great. One of the most exciting hacks I've seen/used recently. I honestly
havent been psyched about a new thing since a) the PSS b) Day/Night Wild Pokemon Switching.

Great job! Had you already had this in YAFRH? Or are you adding it now for Lunatic Mode?
 
Last edited:
91
Posts
14
Years
  • Seen Feb 22, 2023
One more thing i dear to ask: May it be possible to determine a custom ability for a pokémon?

~SBird
 
1
Posts
15
Years
  • Seen Sep 18, 2013
Can anyone confirm that the custom natures work? I haven't been able to notice much of a difference, but it seems that the gender of the trainers pokemon change according to the nature value. I'm not sure if I did something wrong or not, the IVs and EVs seem to be working though.
 
199
Posts
12
Years
  • Seen Jul 18, 2016
Can anyone confirm that the custom natures work? I haven't been able to notice much of a difference, but it seems that the gender of the trainers pokemon change according to the nature value. I'm not sure if I did something wrong or not, the IVs and EVs seem to be working though.

Dunno about natures but genders of pokemon have changed.
 
29
Posts
11
Years
  • Seen Nov 15, 2014
T"o assign an EV spread to a trainer's pokemon, set the value that was formerly their IVs to which slot in the table you want that pokemon to use. If you are using A-Trainer, this value is erroneously marked as AI Value."

So are you saying that increasing AI Value in A-Trainer doesn't actually improve the AI? It only affects IVs? Is there any way to improve AI then?
 
Back
Top