• 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: Ability Resource Thread

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
Just a quick question. Is there a limit for how many characteres I can use to make an ability description?
Because I was expanding an already expanded table, and all the descriptions that were there already took up 32 characters (the ones that didn't had FFs completing it until they were 32 bytes long).
But the very first ability I try to insert is longer than that (I'm reinserting it, actually, thus I know it's already in the game and it has more than 32 characters).
If they don't have a limit, why the first abilities I read had all FFs completing 32 bytes? Also, if I can use more than 32 characters, how can I do it? Just an FF between two abilities descriptions is enough?

Emerald you can't, but Fire Red you can probably push it to about 50-60?
 
11
Posts
8
Years
  • Age 36
  • Seen Aug 29, 2023
I'm trying to add Protean to my ROM, and I can't seem to get it right. I complied it and inserted it into the ROM (00954460, if that matters). Then I added the 00 49 08 47 60 44 95 08 at 1D7D8. When I used "Paste Insert" to add it Gen III suite freaked out and took my to the .ini restore thing. When I overwrote it 1D7D8 with the new code and opened it, Gen III Suite worked fine, but I couldn't find it in my abilities menu. Am I missing a step somewhere?

I'm also using Mr.DollSteak's ROM base. I read in the thread that I have to edit the move data when using the the ROM base, but I'm not sure exactly how or what I'm supposed to do in that regard.
 
180
Posts
10
Years
  • Age 34
  • Seen Jan 10, 2017
I have fixed that damn routine so many times haha, it definitely compiles now.

Prankster, Gale Wing etc.:The routine still wont compile for me. Thumb closes down too fast for me to have a look, but there seems to be two lines that creates the failure.

Overcoat: Works fine in Hail and Sandstorm. However, it doesn't stop Stun Spore/Effect Spore etc. from working (1st routine) and the game resets when an Overcoated 'mon uses an attack such as pound on an effect spore 'mon (2nd routine).

No Guard: The ability itself seems to work fine now. Still a problem with toxic though. Toxic now misses as if it were a non-poison 'mon using it even though the 'mon is a poison-type.
 

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
Prankster, Gale Wing etc.:The routine still wont compile for me. Thumb closes down too fast for me to have a look, but there seems to be two lines that creates the failure.

Overcoat: Works fine in Hail and Sandstorm. However, it doesn't stop Stun Spore/Effect Spore etc. from working (1st routine) and the game resets when an Overcoated 'mon uses an attack such as pound on an effect spore 'mon (2nd routine).

No Guard: The ability itself seems to work fine now. Still a problem with toxic though. Toxic now misses as if it were a non-poison 'mon using it even though the 'mon is a poison-type.

Yeah they're all 100% fixed now. The issue with the first one was that in my rom I'm compiling the BLs with 08 at the front, but I'd removed them all except for one in the routine.

The others were all typos.

The only thing I couldn't replicate was the issue you found with the 1st routine. Are you sure you've set up the table correctly from the prerequisites? and pointed to the right tables?
 

Exodrake

The Manliest Chick that Ever Manlied
163
Posts
10
Years
  • Age 30
  • Seen Nov 30, 2016
Parental Bond:-

Fire Red:-
Spoiler:
I can't get the 5th routine to compile. The command prompt disappears at light speed but with a fast screenshot, it says the problem is on line 23?
 

Trainer 781

Guest
0
Posts
In the first line after the Loop label, a comma is missing between ldrb r2 and [r5]. That is the compilation error. Thanks for notifying.
 
130
Posts
8
Years
  • Age 28
  • Seen Jun 14, 2023
What script editor is being used for these routines or can XSE use these when compiling?
I would like to make some new abilities for the new types in my hack. What is the routine (or offset so I can reverse engineer) for Overgrow, Swarm, Blaze, and/or Torrent so I can change the type to be one of the new ones.
And finally, after expanding the ability names and descriptions (PGE comes with a tool to do that), how would I get the game to know to use the routines? What offset would I need to change to make it work?

Thanks in advance.
 
794
Posts
10
Years
What script editor is being used for these routines or can XSE use these when compiling?
I would like to make some new abilities for the new types in my hack. What is the routine (or offset so I can reverse engineer) for Overgrow, Swarm, Blaze, and/or Torrent so I can change the type to be one of the new ones.
And finally, after expanding the ability names and descriptions (PGE comes with a tool to do that), how would I get the game to know to use the routines? What offset would I need to change to make it work?

Thanks in advance.

I was confused about this at first too. I'll try to explain how abilities or rather ability's effect work in battle. Pokemon ability is stored in a certain battle struct and is always retrieved from there. Each ability has an ID, a byte in order in the abilities names table. There are no routines for each specific ability. Mostly there are three places where abilities are checked, first being damage calc, second being accuracy checker and most important being giant ability_battle_effects function. So swarm for example works like this:
damage calculator code...
if (attacker_ability == SWARM and move_type == BUG and has less than 31 % of max hp)
{
damage = damage * 1.5;
}
rest of the code...
As you can see, abilities are checked at run time. Now, I suggest you take a copy of FR or EM IDA, look at offset locations in this thread and see how battle functions work.
So to answer, if you expand the ability and want the game to recognize it, you just have to do something like this in your code:
if (pokes_ability == ID_of_new_ability)
do something;
And again, some of the abilities are placed at many places, like there are checks for white smoke and clear smog in stat lowering function or there's a wonder guard check in the type damage calc.

Also, I think this thread becomes more and more unusable. There are about 100 new abilities in gens IV-VI and they all have to be hooked somewhere. I'm not even talking about the time to assemble and insert every routine that's here but also about how the hook locations may contradict each other and how changes to it become more difficult. The solution would be a partial rewrite of the battle engine compiled dynamically(preferably done in C), something that FBI's doing but to a much smaller degree.
 
130
Posts
8
Years
  • Age 28
  • Seen Jun 14, 2023
I was confused about this at first too. I'll try to explain how abilities or rather ability's effect work in battle. Pokemon ability is stored in a certain battle struct and is always retrieved from there. Each ability has an ID, a byte in order in the abilities names table. There are no routines for each specific ability. Mostly there are three places where abilities are checked, first being damage calc, second being accuracy checker and most important being giant ability_battle_effects function. So swarm for example works like this:
damage calculator code...
if (attacker_ability == SWARM and move_type == BUG and has less than 31 % of max hp)
{
damage = damage * 1.5;
}
rest of the code...
As you can see, abilities are checked at run time. Now, I suggest you take a copy of FR or EM IDA, look at offset locations in this thread and see how battle functions work.
So to answer, if you expand the ability and want the game to recognize it, you just have to do something like this in your code:
if (pokes_ability == ID_of_new_ability)
do something;
And again, some of the abilities are placed at many places, like there are checks for white smoke and clear smog in stat lowering function or there's a wonder guard check in the type damage calc.

Also, I think this thread becomes more and more unusable. There are about 100 new abilities in gens IV-VI and they all have to be hooked somewhere. I'm not even talking about the time to assemble and insert every routine that's here but also about how the hook locations may contradict each other and how changes to it become more difficult. The solution would be a partial rewrite of the battle engine compiled dynamically(preferably done in C), something that FBI's doing but to a much smaller degree.

Ok, so you're saying that in order to have the new Swarm/Torrent/Overgrow/Blaze-like ability work, I need to expand that damage calculator code section to include the newly created ability and the new type? Is the code that you posted, what is actually used in the game/script editor? Or will I need to find what is actually used and copy it from there?

I haven't looked at many of the posts here so I'm not sure where to look. I would just really like having abilities made for the new types. Like I'm planning on using those ?s between Celebi and Treecko for new Pokemon and using 9 of them as starters, so having one of those for the new types would be nice. ASM/Scripting is the hardest for me to do from scratch. If I can reverse engineer, I can make new things.
 
42
Posts
8
Years
  • Age 29
  • Seen yesterday
So I have Mr DS's ROM base, and know how to insert the ASM for the abilities, but how would I go about adding the names and descriptions?

Also, how would one go about creating Poison Touch for Fire Red?
 

pokefreak890

The One that will make everything great
853
Posts
9
Years
  • Age 26
  • Seen May 18, 2023
im on the works to complete my 1460 rombase and i want to add mold breaker,treavolt and turboblaze how would you go about adding them i know how to implement the routine but i dont know how the mold breaker table would look like if anyone already has the mold breaker table inserted for fire red can u show me what it looks like
 
959
Posts
11
Years
So I have Mr DS's ROM base, and know how to insert the ASM for the abilities, but how would I go about adding the names and descriptions?

Also, how would one go about creating Poison Touch for Fire Red?

I believe there is a table for the ability names and another one for descriptions; you have to expand both of them to support the new abilities, then add the new names/descriptions to the index slots that match the ASM (ie. if Protean has index 0x75 in it's ASM check, you'll have to find slot 0x75 on both tables and put the name/description there accordingly)

Apologies if the explanation was a bit vague or even incorrect, it's been a long time since I've worked on expanding stuff for new abilities :P
 
146
Posts
11
Years
  • CO
  • Seen Mar 16, 2023
Looked through to see if this was already requested but didn't find anything...

I was wondering if MissingNo's ability which really has no name could be implemented.
It would be interesting as the original from Red/Blue not only adds 128 of an item to your sixth item slot but also the sprite is determined by specific slots in the players name (I think it's the 3rd, 5th, 7th and also 8th-10th but the naming function only uses 7 characters and leaves the last 3 blank).

That's all I have for now though...
Thanks for your time and all the work you all put into this;
I understand if this is not priority or even done as you all have a lot on your plate already.
^_^
 
Back
Top