• 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

794
Posts
10
Years
  • There were errors in the case on lines 22 and 31. The fixed version is below

    Spoiler:

    Even though it compiles now, there is another problem. This code doesn't work for me. After inserting it when I select a move in a battle and use it, the whole game freezes. On a modified rom it actually resets and on a clean rom it just freezes. Now, am I just doing something incorrectly or is this the code that is wrong?
     

    Touched

    Resident ASMAGICIAN
    625
    Posts
    9
    Years
    • Age 122
    • Seen Feb 1, 2018
    Even though it compiles now, there is another problem. This code doesn't work for me. After inserting it when I select a move in a battle and use it, the whole game freezes. On a modified rom it actually resets and on a clean rom it just freezes. Now, am I just doing something incorrectly or is this the code that is wrong?

    After a quick glance I can't see anything obviously wrong with the logic. Did you follow the instruction telling you to put 01 48 00 47 00 00 xx xx xx 08 1A 4A at 01F1E2. Remember the offset has to be little-endian and plus 1 (since it's THUMB code). If you did this, I can only assume it's broken.
     
    794
    Posts
    10
    Years
  • After a quick glance I can't see anything obviously wrong with the logic. Did you follow the instruction telling you to put 01 48 00 47 00 00 xx xx xx 08 1A 4A at 01F1E2. Remember the offset has to be little-endian and plus 1 (since it's THUMB code). If you did this, I can only assume it's broken.
    Yes, it was my fault. Apparently I didn't add 1 to my offset. Thanks for your help!
     
    218
    Posts
    10
    Years
    • Seen Nov 12, 2021
    Hi,
    how am I suppose to do if I want to make technician not the number 0x66 ability but rather the 0x4D ability ? Because in the routine, if I replace the "cmp r4, #066" with "cmp r4, #04D" the assembler doesn't want to assemble my routine.
    Any clue ? Tell me if I'm not clear
     
    457
    Posts
    10
    Years
    • Seen today
    Hi,
    how am I suppose to do if I want to make technician not the number 0x66 ability but rather the 0x4D ability ? Because in the routine, if I replace the "cmp r4, #066" with "cmp r4, #04D" the assembler doesn't want to assemble my routine.
    Any clue ? Tell me if I'm not clear

    "cmp r4, #0x66"
    "cmp r4, #0x4D"

    Don't forget to have x those kind of digits because that means a hex digit otherwise your routine doesn't want to assemble at all.
     
    457
    Posts
    10
    Years
    • Seen today

    Expanding Ability Names Data and Ability Descriptions Pointer Table

    I think this should be here so I don't need to make a new thread with a very simple tutorial. Alright! I'm going to tell you how to expand Ability tables (the Names and the Descriptions). I'm using HxD here as a HEX Editor.

    Legend:
    • Green bolded text are for Emerald.
    • Red bolded text are for FireRed.

    Step 1: Ability Names

    • Go to a new free space names (example: 0x720000). Select 3328 (0xD00 in HEX) bytes. Fill the bytes with AE AE AE AE AE AE AE FF 00 00 00 00 00.
    • Go to 31B6DB or 24FC40. Select and copy 1014 (0x3F6 in HEX) bytes.
    • Go to the offset of your names data (which the example is 0x720000) and paste the data there.
    • Replace all DB B6 31 08 or 40 FC 24 08 with the "reversed hex in little indian of your new names data offset with 08 at the end" (example: 00 00 72 08)

    Step 2: Ability Descriptions

    • Go to a new free space descriptions (example: 0x720D00). Select 1024 (0x400 in HEX) bytes. Fill the bytes with 98 AF 31 08 or C4 F3 24 08.
    • Go to 31BAD4 or 24FB08. Select and copy 312 (0x138 in HEX) bytes.
    • Go to the offset of your description table (which the example is 0x720D00) and paste the data there.
    • Replace all D4 BA 31 08 or 08 FB 24 08 with the "reversed hex in little indian of your new description data offset with 08 at the end" (example: 00 0D 72 08)

    Then, change your .ini-s. Replace the old offsets in the .ini with your new data (they should be at where the Ability Names and Ability Descriptions are). Luckily, these don't have limiter stuff at all.

    With the expanded data, the new data should be working. I have made this tutorial to have maximized the slots to 256 abilities (255 usable abilities plus one for the none "-----" slot). Now you have 178 new slots for Generation IV+ abilities. Noted that the game can only support up to 256 abilities. The rest of the tutorial on how to insert ability routines are on the first post of this thread since inserting ability routines are now complicated. I hope this post is to be linked up in the Extra Information of this thread so everyone can expand stuff too.
     
    Last edited:
    218
    Posts
    10
    Years
    • Seen Nov 12, 2021

    Expanding Ability Names Data and Ability Descriptions Pointer Table

    I think this should be here so I don't need to make a new thread with a very simple tutorial. Alright! I'm going to tell you how to expand Ability tables (the Names and the Descriptions). I'm using HxD here as a HEX Editor.

    Legend:
    • Green bolded text are for Emerald.
    • Red bolded text are for FireRed.

    Step 1: Ability Names

    • Go to a new free space names (example: 0x720000). Select 3328 (0xD00 in HEX) bytes. Fill the bytes with AE AE AE AE AE AE AE FF 00 00 00 00 00.
    • Go to 31B6DB or 24FC40. Select and copy 1014 (0x3F6 in HEX) bytes.
    • Go to the offset of your names data (which the example is 0x720000) and paste the data there.
    • Replace all DB B6 31 08 or 40 FC 24 08 with the "reversed hex in little indian of your new names data offset with 08 at the end" (example: 00 00 72 08)

    Step 2: Ability Descriptions

    • Go to a new free space descriptions (example: 0x720D00). Select 1024 (0x400 in HEX) bytes. Fill the bytes with 98 AF 31 08 or C4 F3 24 08.
    • Go to 31BAD4 or 24FB08. Select and copy 1014 (0x3F6 in HEX) bytes.
    • Go to the offset of your description table (which the example is 0x720D00) and paste the data there.
    • Replace all D4 BA 31 08 or 08 FB 24 08 with the "reversed hex in little indian of your new description data offset with 08 at the end" (example: 00 0D 72 08)

    Then, change your .ini-s. Replace the old offsets in the .ini with your new data (they should be at where the Ability Names and Ability Descriptions are). Luckily, these don't have limiter stuff at all.

    With the expanded data, the new data should be working. I have made this tutorial to have maximized the slots to 256 abilities (255 usable abilities plus one for the none "-----" slot). Now you have 178 new slots for Generation IV+ abilities. Noted that the game can only support up to 256 abilities. The rest of the tutorial on how to insert ability routines are on the first post of this thread since inserting ability routines are now complicated. I hope this post is to be linked up in the Extra Information of this thread so everyone can expand stuff too.

    Until now I had to use Sigma Emerald to test new abilities, thank's to you I can do it on clean ROM now !

    EDIT : Little problem, as always. Problems in bold :

    Emerald There are questions in the spoiler too
    Spoiler:


    Also, these require Jambo's Callasm and Setword commands, and his Battle String Loader Hack. Is it needed since the battle script are already compiled ? If so, where can I find those?
     
    Last edited:
    457
    Posts
    10
    Years
    • Seen today
    Until now I had to use Sigma Emerald to test new abilities, thank's to you I can do it on clean ROM now !

    EDIT : Little problem, as always. Problems in bold :

    Q: Do I have to put +1 at this pointer ? Like a pointer to an ASM routine ? And for the others pointers in battle scripts ?
    A: Yes. ASM pointers are +1. Scripts stuff do not need +1 for pointers, ASMs only.

    Q: I don't understand here. How am I supposed to know whether the "setword command is at FB, and the RAM location for the string pointer is at 0x203E320" or not?
    A: I don't also understand that but it is something you want to use another rather than 0x203E320 or FB (the given safest stuff).

    Q: Is it needed since the battle script are already compiled ? If so, where can I find those?
    A: Yes. They are truly necessary. For the Battle String Loader Hack, look for it at Move Resource Thread. Emerald routines, just look for the authors KDS or HidoranBlaze. For the Callasm, use the routine here: https://www.pokecommunity.com/showpost.php?p=7101031&postcount=230 and use scriptlocation: .word 0x02024214 if you are using Emerald. Then, for the Setword command, I dunno how to do that but the link I have typed at the last sentence might guide you.
     
    132
    Posts
    10
    Years
    • Age 23
    • Seen May 15, 2024
    3. New Switch-in Ability System
    Spoiler:

    Would the flawed switch-in system be the reason that Natural Cure is broken? At the moment, switching out a Pokemon with Natural Cure doesn't heal it (in the MrDS base). If so, I'm even more anticipating the update of the base, because I'd like to have Natural Cure actually function for Spritzee and Aromatisse.
     

    Trainer 781

    Guest
    0
    Posts
    --questions
    Spoiler:


    Z-nogyroP said:
    Would the flawed switch-in system be the reason that Natural Cure is broken? At the moment, switching out a Pokemon with Natural Cure doesn't heal it (in the MrDS base). If so, I'm even more anticipating the update of the base, because I'd like to have Natural Cure actually function for Spritzee and Aromatisse.

    Nope. Natural Cure is a switch-out ability rather than a switch-in one.
     

    Trainer 781

    Guest
    0
    Posts
    So, I repointed my table, it ends with "...D1 6E 05 08 DD 6E 05 08 F9 6E 05 08 (pointer callasm Jambo with .word 0x02024214 instead) (pointer battlestring loader from the resource thread with 0x0203E320 in the code in the code) (pointer setword command that you given)"

    And after that I insert the ability and that's all ? (didn't say it was easy x))

    EDIT : Doesn't seem to work for me

    You don't need to add the pointer to battle string loader in command table. Just make the byte changes mentioned in spoiler above the battle string loader's code. Rest is correct.
     
    218
    Posts
    10
    Years
    • Seen Nov 12, 2021
    You don't need to add the pointer to battle string loader in command table. Just make the byte changes mentioned in spoiler above the battle string loader's code. Rest is correct.

    Ok so then the setword will be at FA, doesn't it ?
    Don't know what I missed because I tried to toggle (in the moxie code) the setword at F8, F9 , FA, FB, nothing works. And it's weird because it doesn't even freeze or restart or whatever. It's just like my scizor has no ability. Yet I toggle 9A to 50 because it's my 80th ability, I triple checked, count 2 or 3 times :/
    Sorry if it turns at ASM lesson/fix, I'll delete the posts when it'll be ok

    I think 0x49C04 is not the good location to put the pointer of moxie's battle script because no matter what I set here, nothing changes.
     
    Last edited:

    Trainer 781

    Guest
    0
    Posts
    The emerald offset turned out to be incorrect. It shoulf be x49C8c instead of x49c04. The OP is now updated as well.
     
    218
    Posts
    10
    Years
    • Seen Nov 12, 2021
    I guess this one deserves to be here, of course all the credit goes to Tlachtli :

    Spoiler:

    I think I did all the stupid mistakes as possible when I tried to implement it. That's why I put some precisions that may seems obvious. So if anyone has problem with it you can PM or VM me.
     
    Last edited:

    MrDollSteak

    Formerly known as 11bayerf1
    858
    Posts
    15
    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:
     
    Last edited:
    218
    Posts
    10
    Years
    • Seen Nov 12, 2021
    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 just does nothing for me. No freeze but not regenerated

    As usually I tested it on double battle, seems to works on One VS One but doubles don't like your routine x)

    Precisions : Work in double battle if the poke is your first poke, otherwise doesn't work
    I think it only update the RAM stats of our first pokemon (yeah obvious I know..)

    Tested on Emerald

    But I'm only talking about the bad, thank's for sharing it. I personally don't mind if you release routines that are not completed or that have still bugs. I think it forces people to take a look into it to make it works (like me), and it gives idea for creating new ones. Only the offset where you hook is useful so, keep going :)

    For contrary I have an idea but it's gonna be boring : Editing the moves that affect stats change, something like :
    jumpifability 0xDependsonthetarget 0xContrary 0xReverseEffect,
    For the problem of intimidate, I don't know how exactly but it should be easy enough since the statu's change is always the same : -1 attack
     
    Last edited:

    MrDollSteak

    Formerly known as 11bayerf1
    858
    Posts
    15
    Years
  • Nice job. Are your Prankster and No Guard implementations glitch free or still a work-in-progress? Is No Guard possible by just altering battle script?

    Prankster in my rombase is glitched, but I've made a new bug free routine.

    Regenerator just does nothing for me. No freeze but not regenerated

    As usually I tested it on double battle, seems to works on One VS One but doubles don't like your routine x)

    Precisions : Work in double battle if the poke is your first poke, otherwise doesn't work
    I think it only update the RAM stats of our first pokemon (yeah obvious I know..)

    Interesting! Thanks for that feedback, I do actually know EXACTLY what the problem is. It's in the section add r1, r1, r3 in Natural Cure, however I was unsure about actually putting it in for Regenerator as I thought it was just a double index check, but it's actually making sure that you can get the second Pokemon in your double battle fixed.

    I've updated that post, so it should be all fixed.

    No Guard

    Spoiler:
     
    Last edited:
    180
    Posts
    10
    Years
    • Seen Jan 10, 2017
    Actually in your RomBase noguard hits through fly/dig etc. Though I don't remember if it was 1.5 or 1.5a
    Even if it's not a big deal, I thought you would like to know

    Another thing, do you think it's a good idea to make a new section in this thread for the news items (choiceS, eviolite, etc).
    Don't know if it deserves a thread or not, didn't want to create one anyway because I'm still struggling to port choice spec in Emerald (yet I'm stealing your code, sorry)

    As weird as it sounds - No Guard actually hits through Fly and Dig in the official games, too :)
     

    MrDollSteak

    Formerly known as 11bayerf1
    858
    Posts
    15
    Years
  • Actually in your RomBase noguard hits through fly/dig etc. Though I don't remember if it was 1.5 or 1.5a
    Even if it's not a big deal, I thought you would like to know

    Another thing, do you think it's a good idea to make a new section in this thread for the news items (choiceS, eviolite, etc).
    Don't know if it deserves a thread or not, didn't want to create one anyway because I'm still struggling to port choice spec in Emerald (yet I'm stealing your code, sorry)

    mamamama is right. It's supposed to do that.

    I don't think I'll put item codes here. I've already ported it to Emerald, but I do believe there is a held item thread somewhere.

    Also for future reference I won't be accepting the BS abilities you or Tlachtli have done so far, the only ability that should be done completely by a battle script is Skill Link. On that note, here it is.

    Skill Link

    Spoiler:
     
    Last edited:
    Back
    Top