• 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

218
Posts
10
Years
  • Seen Nov 12, 2021
The byte changes actually re-insert the routine for you. The implementation was broken, so the byte changes make it reflect this new routine.



Fur Coat and Multiscale definitely work 100% as intended, no breaking at all.
I fixed No Guard, basically I put a ldr, instead of ldrb, for the bank check, it definitely works now.

Mold Breaker, Teravolt and Turboblaze

Spoiler:

In the routine that makes pokemon forced to switch-out being affected by the entry hazards, we shouldn't use the index 0xFF, it is used to set the weather depending on the map :
Spoiler:


So perhaps we should use the index 0x0
 

Trainer 781

Guest
0
Posts
In the routine that makes pokemon forced to switch-out being affected by the entry hazards, we shouldn't use the index 0xFF, it is used to set the weather depending on the map :
Spoiler:


So perhaps we should use the index 0x0

Good find! 0x0 should not be used because of Gastro Acid. 0xFE would bhi better in this case.
 
218
Posts
10
Years
  • Seen Nov 12, 2021
Good find! 0x0 should not be used because of Gastro Acid. 0xFE would bhi better in this case.

What is the matter with gastro acid ?
Also 0xFE is used to check water or mudsport, I don't remember. Though when rewritting the damage calculator I updated them so it shouldn't be a problem

Perhaps we could change the index to something that has no effect in battle, like pickup
 
794
Posts
10
Years
Sorry for the lack of updates in a while guys, I've got heaps of projects going on, and am very busy in real life at the moment. Anyway I've since written up the Regenerator routine that my rombase uses, it was improved immensely by Doesnt. It's bug free as far as I can tell considering I just fixed the bug wherein it broke Natural Cure.

Regenerator

Spoiler:

Regenerator doesn't work for me in double battles or when AI switches out.(Fire Red) HP may not update, kill AI pokemon or break health bar depending on the position of a pokemon. I played with it for a while and it seems the problem lies in str r0, [sp]. This only works for user, changing it to str r0, [sp, #0x28] will work for AI but freeze the game if player switches out. Double battles won't work either way. I think it has to do with bank position of switching and aforementioned sp.

EDIT: So I did some tests and it turns out that AI switching statused Pokemon with Natural Care in double battles also doesn't work. It doesn't have to do with your routine though, it just doesn't work in vanilla FR. Nvm, vanilla natural care works fine with all Pokemon, so the problem is somewhere in your routine.
 
Last edited:

Trainer 781

Guest
0
Posts
What is the matter with gastro acid ?
Also 0xFE is used to check water or mudsport, I don't remember. Though when rewritting the damage calculator I updated them so it shouldn't be a problem

Perhaps we could change the index to something that has no effect in battle, like pickup

Actually, 0x0 turns out to be good. I verified by re-evaluating the situation.
 

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
Regenerator doesn't work for me in double battles or when AI switches out.(Fire Red) HP may not update, kill AI pokemon or break health bar depending on the position of a pokemon. I played with it for a while and it seems the problem lies in str r0, [sp]. This only works for user, changing it to str r0, [sp, #0x28] will work for AI but freeze the game if player switches out. Double battles won't work either way. I think it has to do with bank position of switching and aforementioned sp.

EDIT: So I did some tests and it turns out that AI switching statused Pokemon with Natural Care in double battles also doesn't work. It doesn't have to do with your routine though, it just doesn't work in vanilla FR. Nvm, vanilla natural care works fine with all Pokemon, so the problem is somewhere in your routine.

Hrm, I'll look into it. Might be before the str r0, I think it might be add r0, r0, r2 instead of r0, r0, r3.
 

Trainer 781

Guest
0
Posts
For some of the codes, some say "insert XX XX XX 08 at this offset", while others say "insert XX+1 XX XX 08 at this offset". Is it XX XX XX 08 or XX+1 XX XX 08?

When you are refering to a Battle Script, Table etc. you use XX XX XX 08.
For ASM code you use XX+1 XX XX 08.

Though there may be some exceptions, but usually this is the case.
 
218
Posts
10
Years
  • Seen Nov 12, 2021
When you are refering to a Battle Script, Table etc. you use XX XX XX 08.
For ASM code you use XX+1 XX XX 08.

Though there may be some exceptions, but usually this is the case.

The only exception would be when usin the bl instruction, but usually when we use it the address is given, like "bl 0xD7500" or "bl some_routine"

Even when there's a switch statement, we can use the +1, because mov pc, rX automatically nuliffy the LSB and considers we're in thumb mode

So yeah, you can consider pointers for ASM always having this "+1"
 
180
Posts
10
Years
  • Age 34
  • Seen Jan 10, 2017
Wonder Skin and Snow Cloak

I am unable to compile Wonder Skin and the 2nd Snow Cloak routine. Kleenex has posted a Snow Cloak no hail damage routine but I want the no hail damage for Overcoat etc. that was posted.

Is there a fix for this?

Thanks for all the hard work you put in!
 

pokefreak890

The One that will make everything great
853
Posts
9
Years
  • Age 26
  • Seen May 18, 2023
i got u mamamamama

snow cloak part 1
.text
.text
.align 2
.thumb
.thumb_func
.global snowcloak

BufferAbility:
ldr r0, .TargetBank
ldrb r0, [r0]
mul r0, r5
add r0, r0, r7
add r0, #0x20
ldrb r0, [r0]
SandVeilCheck:
cmp r0, #0x8
bne SnowCloakCheck
SandVeil:
ldr r0, .Return
bx r0
SnowCloakCheck:
cmp r0, #0x52
bne Return
SnowCloak:
ldr r0, .WeatherLoc
ldrh r1, [r0]
mov r0, #0x18
lsl r0, r0, #0x4
and r0, r1
cmp r0, #0x0
beq Return
ldr r1, .Return2
bx r1
Return:
ldr r0, .Return3
bx r0

.align 2

.TargetBank: .word 0x0202420C
.Return: .word 0x0804689D
.WeatherLoc: .word 0x020243CC
.Return2: .word 0x080468A9
.Return3: .word 0x080468B9

snow cloak part 2 (this one does compile)

.text
.align 2
.thumb
.thumb_func
.global preventfromhail

Start:
mov r0, r2
add r0, #0x20
ldrb r1, [r0]
cmp r1, #0x52
bne Return

Untouched:
ldr r1, UntouchedBack
bx r1

Return:
add r0, #1
ldrb r0, [r0]
cmp r0, #0xF
beq Untouched
ldr r1, Back
bx r1

.align 2
Back: .word 0x08051BFA+1
UntouchedBack: .word 0x08051C3C+1

wonderskin

.text
.text
.align 2
.thumb
.thumb_func
.global wonderskin

BufferAbility:
ldr r0, .TargetBank
ldrb r0, [r0]
mul r0, r2
add r0, r0, r3
add r0, #0x20
ldrb r0, [r0]
ldrb r3, [r7, #0x3]
CheckWonderSkin:
cmp r0, #0x94
bne Return
WonderSkin:
ldrb r0, [r7, #0xA]
cmp r0, #0x2
bne Return
cmp r3, #0x32
ble Return
mov r3, #0x32
Return:
mov r8, r3
mov r0, #0x0
str r0, [sp]
mov r0, #0x13
ldr r1, .Return
bx r2

.align 2

.TargetBank: .word 0x0202420C
.Return: .word 0x080467E5

sorry its like this but i dont know how to do spoilers
 
180
Posts
10
Years
  • Age 34
  • Seen Jan 10, 2017
i got u mamamamama

Thanks!

Wonder Skin compiles now, but the game freezes when I try to use Spore on a Pokemon with this ability. It seems to be related to the 01 48 00 47 00 00 XX+1 XX XX 08 bytes. Have you made any changes to them?

The Snow Cloak fix doesn't seem to contain the checks for future and current abilities such as Ice Body and Overcoat like the original posted by Mr. DollSteak did. It would be great if that routine was able to be corrected.


I can confirm that this routine, despite the fix by kleenexfeu, does not work. During my tests, Dynamicpunch still missed, did not hit flying types, and the opposing Pokemon still missed mine at times despite me having No Guard.
 

Trainer 781

Guest
0
Posts
I can confirm that this routine, despite the fix by kleenexfeu, does not work. During my tests, Dynamicpunch still missed, did not hit flying types, and the opposing Pokemon still missed mine at times despite me having No Guard.

There is a typo in the third line. Change ldr r0, [r0] to ldrb r0, [r0]
 

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
Thanks!

Wonder Skin compiles now, but the game freezes when I try to use Spore on a Pokemon with this ability. It seems to be related to the 01 48 00 47 00 00 XX+1 XX XX 08 bytes. Have you made any changes to them?

The Snow Cloak fix doesn't seem to contain the checks for future and current abilities such as Ice Body and Overcoat like the original posted by Mr. DollSteak did. It would be great if that routine was able to be corrected.



I can confirm that this routine, despite the fix by kleenexfeu, does not work. During my tests, Dynamicpunch still missed, did not hit flying types, and the opposing Pokemon still missed mine at times despite me having No Guard.

The problem for all of these routines in typos I made. In Wonder Skin it should be bx r1 in the last line in both Fire Red and Emerald. I have fixed those now.

In Snow Cloak I had two Returns available for some reason, there should only be one, which is why the compiling error occurred. Also KDS is right, for some reason in the emerald no guard it was saying ldr instead of ldrb, whereas the fire red one had ldrb correctly. I obviously haven't been copying these routines from my rombase as accurately as I thought haha!

Weird no one's pointed these out before but thanks mamamama and KDS for pointing these out to me.
 

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
Small bug: Toxic Boost boosts when my Pokemon is poisoned, but not when it is badly poisoned.



Another small bug: Toxic always hits regardless of whether the user is poison type. For example: A Normal type can hit flyers with Toxic. I am using the original Toxic Script without any changes to it.

Another one: Blizzard always hits, even without hail. Using the original script here aswell

Would you be able to provide the full list of moves that are affected by the changes made to the accuracycheck(?) command?

EDIT: Overall, after implementing the accuracy abilities, it seems like moves just generally seem to miss a lot. I missed 3 100% accuracy pounds in a row for no reason when having Overgrow as ability attacking another Pokemon with Pick Up as ability. I will try to investigate which exact ability causes this issue.

Fixed the issue with Toxic always hitting, there was a ldr instead of the ldrb. Not sure what the issue with Toxic Boost is, because the check looks right.

Not sure about the others, might just be that bad bank command from earlier.
 

Trainer 781

Guest
0
Posts
Fixed the issue with Toxic always hitting, there was a ldr instead of the ldrb. Not sure what the issue with Toxic Boost is, because the check looks right.

Not sure about the others, might just be that bad bank command from earlier.

In No Guard, make sure to call the Method BL in the AutoHit label too. That BL is for Protect check. Otherwise, No Guard will bypass new protection moves like King Shield.
 
180
Posts
10
Years
  • Age 34
  • Seen Jan 10, 2017
Prankster, Gale Wings, Stall, Sand Rush, Slow Start and Quick Feet

1. I tried to implement this but the routine does not compile. I have tried changing the line mov r10, r1 to mov r0, r1, but it does not help (I also noticed it is written as just mov 10, r1 in the routine). Is it possible that there are any more typos?

2. I suppose the "Move Data" is supposed to be changed if you have expanded your move data table. But the fact that you use 31C198 makes me unsure. Is that just a typo for 31C898, which is the move data location in Emerald?

3. Kleenexfeu told me that the free RAM location in Emerald start at 0203E320, does that mean I can use say E320, E321, E322 etc. or do I need to have some space in-between each?
 

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
1. I tried to implement this but the routine does not compile. I have tried changing the line mov r10, r1 to mov r0, r1, but it does not help (I also noticed it is written as just mov 10, r1 in the routine). Is it possible that there are any more typos?

2. I suppose the "Move Data" is supposed to be changed if you have expanded your move data table. But the fact that you use 31C198 makes me unsure. Is that just a typo for 31C898, which is the move data location in Emerald?

3. Kleenexfeu told me that the free RAM location in Emerald start at 0203E320, does that mean I can use say E320, E321, E322 etc. or do I need to have some space in-between each?

I have fixed that damn routine so many times haha, it definitely compiles now.

The ram locations I've been using are 203E324 and beyond. Most of them take 2 or 4 bytes. Trick room is one, and tailwind is two, the others are 4 I think.
 
275
Posts
8
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?
 
Back
Top