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

Code: Trainers with EVs

199
Posts
12
Years
  • Seen Jul 18, 2016
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?

I think this controls the AI.
worst = 0 best = 7 or something like that.
Spoiler:
 
29
Posts
11
Years
  • Seen Nov 15, 2014
I think this controls the AI.
worst = 0 best = 7 or something like that.
Spoiler:

Thanks! That is actually really, really important information. There should be some sort of announcement made about that. You just saved me a lot of time.

Also, this script is really cool, simple, and useful. It can easily change the gameplay of any hack. Thank you for making and sharing, Doesn't.
 
108
Posts
13
Years
  • Seen Sep 30, 2020
Would an ev asm that works for emerald also work for Ruby? I am planning to make a simple Ruby difficulty hack with only 202 pokemon found in hoenn available, as opposed to the 386 emerald and firered/leafgreen hacks out there, and I wanted to give this a try.


I also noticed something about the level 7 AI in ruby, they never uses moves like encore or mud sport no matter how much I try, is that specific to the lower AIs? First time actually trying to hack third gen.

EDIT: yea, its level 5 that allows their pokemon to use encore sometimes, as well as certain pokemon using pain split, while at the same time, the enemies will use stronger moves like the level 7 AIs. Though the level 5 AI won't use status moves or protect as much.

But yeah, I'm really bad at asm, and the trainer ev spread asm routine is a work of genius when making a more difficult pokemon hack, which I commend you for it. (I was curious a long time ago in how to implement that in my first gen hacks myself, until I was told that that was impossible.)
 
Last edited:
180
Posts
10
Years
  • Age 34
  • Seen Jan 10, 2017
Suggestion:

If you are still working on this Doesn't, it would be really nice to use those filler bytes to be able to shift between abilities of the AI's Pokemon. Currently, the AI always gets Ability 1.

I was also going to suggest to use them to control the happiness of the AI's Pokemon, but I'm not sure how the AI handles the BP of Return and Frustration.
 

DoesntKnowHowToPlay

Tiny Umbrella with Lots and Lots of Good
265
Posts
12
Years
  • Seen Feb 24, 2024
That's actually really easy to add and I thought I put it in here earlier- just put the following in the middle of the other loads:

Code:
LoadAbility:
lsl r0, r6, #0x4
ldr r2, .EV_Table
add r2, r0
add r2, #0xC
mov r1, #0x2E
mov r0, r4
bl Insert_Element
This maps ability to the byte 0xC, the first of the last four unused bytes.

Happiness requires passing InsertElement x20 in r1, and should be easy enough for you to add yourself, but I don't advise it as the AI isn't very smart about using Return and Frustration anyway.
 
Last edited:
199
Posts
12
Years
  • Seen Jul 18, 2016
I once read that pokemon in the battle frontier all have zero happiness so maybe it applies to the main game too? Or perhaps they have base values of the pokemon used?
 

Agastya

Grinding failed. Item Grind level dropped by 3.
73
Posts
14
Years
  • Age 33
  • Seen Mar 19, 2023
they default to 0 happiness, yes. if something needs stab return, you should opt to use frustration unless you hate it for flavor reasons.
 
199
Posts
12
Years
  • Seen Jul 18, 2016
Sorry to bump this thread, but I think I found another problem.

I have recently been playing through the battle pyramid to test some new team I gave the brain there. The opponents first pokemon had slightly higher speed than my one, and without any speed related items or +/- priority moves, it moved last always.
It turns out that it was due to the IVs of this pokemon being 31, which was also the slot number that had a speed reducing nature assigned to it. I tried removing the EV hack and it worked as it should. Would it be possible to make it not conflict with the battle frontier and other battle facilities?

EDIT:
Alright well I didn't think of just using some EV spreads I already made before and giving them to the frontier brains to get around this little issue, but I guess it may be able to affect the random trainers in the frontier still.
EDIT2:
It also appear to mess with the stats of Steven's pokemon during the double battle event at Mossdeep. Even though the changes it causes are minor (1-3 points,) thought I should note it anyway.
Guess I should try to test some more things too.
 
Last edited:
51
Posts
9
Years
  • Age 38
  • Seen Dec 20, 2022
Sorry to bump this thread, but I think I found another problem.

I have recently been playing through the battle pyramid to test some new team I gave the brain there. The opponents first pokemon had slightly higher speed than my one, and without any speed related items or +/- priority moves, it moved last always.
It turns out that it was due to the IVs of this pokemon being 31, which was also the slot number that had a speed reducing nature assigned to it. I tried removing the EV hack and it worked as it should. Would it be possible to make it not conflict with the battle frontier and other battle facilities?

EDIT:
Alright well I didn't think of just using some EV spreads I already made before and giving them to the frontier brains to get around this little issue, but I guess it may be able to affect the random trainers in the frontier still.
EDIT2:
It also appear to mess with the stats of Steven's pokemon during the double battle event at Mossdeep. Even though the changes it causes are minor (1-3 points,) thought I should note it anyway.
Guess I should try to test some more things too.

Is this not a fairly concerning issue? If I get this correctly, it means that any trainer in the game that has pokemon with IVs will be affected? So half of these EV spreads will be used up redoing all the battle frontier teams and some others with IVs?
 
199
Posts
12
Years
  • Seen Jul 18, 2016
Is this not a fairly concerning issue? If I get this correctly, it means that any trainer in the game that has pokemon with IVs will be affected? So half of these EV spreads will be used up redoing all the battle frontier teams and some others with IVs?

It will only take 36 slots or so for the brains spreads, maybe even less because of using other spreads you already made. That is minus the Factory Head's team since it cannot be changed.

It is not that concerning. It is just a nitpick.
 
51
Posts
9
Years
  • Age 38
  • Seen Dec 20, 2022
It will only take 36 slots or so for the brains spreads, maybe even less because of using other spreads you already made. That is minus the Factory Head's team since it cannot be changed.

It is not that concerning. It is just a nitpick.

Yeah actually I just thought carefully about what I said there. If this works with the IV value then of course that will happen, makes sense. It's a small price to pay for something so awesome. However, it would be nice if the battle frontier was exempt from this because as far as I understand there are already EV spreads for the battle frontier. I suppose if I translated all those entries to this new ev spread then I could theoretically free up the original spread as free space?
 
794
Posts
10
Years
Quick question.
"First you will need to insert this ASM."
What exactly is ASM? I looked it up, but only found out it's connected to Assembly.
And where exactly am I supposed to insert this?
 

jAvAcOlA

Banned
152
Posts
15
Years
  • Seen Feb 22, 2015
Quick question.
"First you will need to insert this ASM."
What exactly is ASM? I looked it up, but only found out it's connected to Assembly.
And where exactly am I supposed to insert this?

Check out this tutorial under the "Having fun with ASM" section: http://www.pokecommunity.com/showthread.php?t=117917#ASM1

This is how I first learned. Inserting ASM seems insanely complex when you first come across it, but you'll realize it's really straight forward.

You're gonna need to know how to hex edit as well, which is also very easy once you understand the basics.
 
794
Posts
10
Years
You will also need to find x1000 bytes of space, and change the .EV_Table variable in the method to point to it (I used xF00000). This is where the spreads will go. The method gives you 256 spreads to use- this is not full control, but it is more than you are likely to need (the Emerald Battle Frontier only uses around 36 IIRC). The EV Spread table format is:
So...I don't quite understand this. What bytes are we talking about? Those before where I inserted the routine? Also how do I change the EV_Table variable? Am I supposed to do it in XSE or some other editor? If so, how is it done?
Sorry for the nooby question. I'd be very grateful if someone could help me.

Edit: I've finally made this work. Thank you Doesn'tKnowHowToPlay for your routine!
 
Last edited:

Chaotix

Love to test
59
Posts
17
Years
  • Age 34
  • Seen Jan 11, 2020
I'm having trouble getting this to work.

I'm not quite sure where the code I'm supposed to replace begins and stops. With what I just tried if I get into a trainer battle that has Custom Moves and Items the game restarts.

This is on Fire Red.
 
Last edited:

Suwandi

Banned
3
Posts
9
Years
  • Age 32
  • Seen Mar 25, 2015
aahhhm?? What makes this hack unique? No! Its very unique, just wondering, how the Trainer EV's affect the entire game? Does it share his Pokemons EV stat?

what the heck are you talking about? it gives EVs to opposing pokemon.
 

Cruztown

Squirtle Squirt.
45
Posts
11
Years
  • Age 30
  • Seen Feb 1, 2024
Yo, I can't quite seem to get this to work for me. It doesn't cause any errors, the game seems to just ignore it. This is what I've tried compiling
Spoiler:
with the resulting Hex
Spoiler:
 

Chaotix

Love to test
59
Posts
17
Years
  • Age 34
  • Seen Jan 11, 2020
Yo, I can't quite seem to get this to work for me. It doesn't cause any errors, the game seems to just ignore it. This is what I've tried compiling
Spoiler:
with the resulting Hex
Spoiler:

There is also hex you have to replace at 0x115f6 and 0x3dc70. Go to those offsets in the bin and replace whats in your rom with them.
 

Cruztown

Squirtle Squirt.
45
Posts
11
Years
  • Age 30
  • Seen Feb 1, 2024
There is also hex you have to replace at 0x115f6 and 0x3dc70. Go to those offsets in the bin and replace whats in your rom with them.
I completely over looked that, thanks a bunch! That said, it just begins freezing. I looked around and nothing else seems to be altered, not even 0x011624 (that's still 20 1C 33 1C 2C F0 14 FA like Mystery Man suggested in the ASM Help thread). Any other iceas
 
Last edited:
Back
Top