• 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
    A little improvement of Tlachtli's routine for Protean. This one is for Emerald :

    Now the user turn systematically to mono type, unless he's asleep or can't move because paralyzed etc. Weather ball/hidden power are correctly handled too.

    Thank's to touched for the fixing bug and display correctly the [Pokemon] transformed into [X] Type

    Good work Kleenexfeu! I've edited your routine to touch up the mistakes, as well as to optimise it, and finally port it to Fire Red.

    Protean

    Spoiler:
     
    Last edited:

    Trainer 781

    Guest
  • 0
    Posts
    Great work both of you! Also thanks for sharing the string display bl.
    The ability looks like it will work properly, just leaving a few corner cases which I will mention:
    1. .CheckTypeLoc should not be specified directly because it is Dynamically Allocated (it rarely changes but has a chance to change). The type should be loaded via the x2023FE8 offset i.e. ldr r3, =0x02023FE8; ldr r3, [r3, 0x13]

    2. Also, shouldn't the dynamic type be generalized (not just for Weatherball and Hidden Power but for new Moves like Natural Gift and possibly for some future Generation VII moves that might come).
    The idea is to load the dynamic type, then 'and'ing it with #0x3F (this automatically cover's subtracting C0 or 80 from r3) Then if results comes out to be zero check the type of the move from the move table. (The vanilla type effectiveness routine does this)
    This way there is no need to handle different type changing moves differently.

    3. Also, by directly returning instead of checking the move table, if the register is zero, we won't get a normal Weather Ball transforming the Protean mon to a Normal Type.
     

    MrDollSteak

    Formerly known as 11bayerf1
  • 858
    Posts
    15
    Years
    Great work both of you! Also thanks for sharing the string display bl.
    The ability looks like it will work properly, just leaving a few corner cases which I will mention:
    1. .CheckTypeLoc should not be specified directly because it is Dynamically Allocated (it rarely changes but has a chance to change). The type should be loaded via the x2023FE8 offset i.e. ldr r3, =0x02023FE8; ldr r3, [r3, 0x13]

    2. Also, shouldn't the dynamic type be generalized (not just for Weatherball and Hidden Power but for new Moves like Natural Gift and possibly for some future Generation VII moves that might come).
    The idea is to load the dynamic type, then 'and'ing it with #0x3F (this automatically cover's subtracting C0 or 80 from r3) Then if results comes out to be zero check the type of the move from the move table. (The vanilla type effectiveness routine does this)
    This way there is no need to handle different type changing moves differently.

    3. Also, by directly returning instead of checking the move table, if the register is zero, we won't get a normal Weather Ball transforming the Protean mon to a Normal Type.

    Fantastic! That's what I thought. I figured once there is more working code for Natural Gift and Judgment etc. I'd look into it, though what you've said sounds perfect. I'll make those changes right now.
     
  • 132
    Posts
    10
    Years
    • Age 23
    • Seen yesterday
    Hey, I'm having some issues getting Protean to work.

    Firstly, it refused to compile for a bit due to having two sections titled "GetMoveType"; it compiled after I changed one of them to GetMoveType2, but I don't know if that changed anything.

    Secondly, whenever something with Protean uses an attack, the game freezes. I don't know why precisely this happens (I tried putting both the address and the addres +1 in reverse hex at 1D7D8), but might it have something to do with me using MrDollSteak's rombase? The MoveIndex, MoveData, and possibly the things related to type might need to be changed.
     

    Germaniac

    Victoria Concordia Crescit
  • 539
    Posts
    15
    Years
    What is it at 46074 and what makes it ok to overwrite it?
    .
    EDIT: I've briefly tested kleenexfeu's routine, it doesn't show the message if the user already has the type of the move it's using (in this case Greninja (Water/Dark) using Scald), not sure if it changes into mono-type, tho.

    Also please note that Struggle don't trigger Protean, if it already is then please ignore this for I haven't tested yet
     
    Last edited:

    Starmytes

    Fabulous Fruit
  • 21
    Posts
    9
    Years
    I will actually be including all the abilities you want in the future, though I can't say when.

    As Kleenex said, there is no effects table, just the move names and descriptions which Sky High has written a tutorial about (linked in the first post).

    But you will need a Battle Script Editor (get BSP), a Hex Editor, and some sort of Ability Name and Description editor if you aren't comfortable in writing names and descriptions in Hex.

    Reserving this post for the absorb Type damage abilities such as Dry Skin, Sap Sipper etc.
    Really?! <3 Ah you've just made my day :D

    I shall wait patiently for your releases and leave adding these abilities until the end!
    Adding the abilities into the game is straight forward it's just learning ASM to make the abilities... it's so simple it's difficult xD
     
  • 218
    Posts
    10
    Years
    • Seen Nov 12, 2021
    What is it at 46074 and what makes it ok to overwrite it?
    .
    EDIT: I've briefly tested kleenexfeu's routine, it doesn't show the message if the user already has the type of the move it's using (in this case Greninja (Water/Dark) using Scald), not sure if it changes into mono-type, tho.

    Also please note that Struggle don't trigger Protean, if it already is then please ignore this for I haven't tested yet

    08046074 is a part of the attack canceler, we branching from here and make the changing/checks accordingly to the situation.

    I'm sure my routine works because I use it for month now, never had any bug. I'll check because I could have make a mistake when copy/paste.

    A mono-type user won't have the message chaging type if attack type = poke type, that's how it works.

    A double type attacker always result in mono-types and that's what the routine does, I'm sure about it too, again, I'll check it out.

    And thanks KDS, I thought directly use the address would be alright, I'll edit that too.

    Really?! <3 Ah you've just made my day :D

    I shall wait patiently for your releases and leave adding these abilities until the end!
    Adding the abilities into the game is straight forward it's just learning ASM to make the abilities... it's so simple it's difficult xD

    Most of the damamge-related abilities are indeed simple. But some of them are a pain in the but, whether because they're require many edit (look at my Delta stream code, it requires like 15 routines + several battle script) and some of them work so weirdly that it's really difficult to implement/found the good place. An exemple : I still don't have the animation working for contrary/simple/defiant/competitive while the buffering stats works perfectly

    Hey, I'm having some issues getting Protean to work.

    Firstly, it refused to compile for a bit due to having two sections titled "GetMoveType"; it compiled after I changed one of them to GetMoveType2, but I don't know if that changed anything.

    Secondly, whenever something with Protean uses an attack, the game freezes. I don't know why precisely this happens (I tried putting both the address and the addres +1 in reverse hex at 1D7D8), but might it have something to do with me using MrDollSteak's rombase? The MoveIndex, MoveData, and possibly the things related to type might need to be changed.

    Yeah, you have to edit those only move data, MrDS put the information in "move table things" or something
     
    Last edited:
  • 218
    Posts
    10
    Years
    • Seen Nov 12, 2021
    And what makes it ok to be overwritten?

    As I said, we branching to alter the code. And as I said month ago, this isn't an ASM tutorial thread. I advice you should some ASM tutorial, try to understand by yourself, then when you worked a little bit and you still don't understand you can PM me if you have some question, but not here as this isn't the good place.

    I'm not an expert but I can help and I don't mind to do so

    Great work both of you! Also thanks for sharing the string display bl.
    The ability looks like it will work properly, just leaving a few corner cases which I will mention:
    1. .CheckTypeLoc should not be specified directly because it is Dynamically Allocated (it rarely changes but has a chance to change). The type should be loaded via the x2023FE8 offset i.e. ldr r3, =0x02023FE8; ldr r3, [r3, 0x13]

    Thanks for that, I changed it in my routine

    2. Also, shouldn't the dynamic type be generalized (not just for Weatherball and Hidden Power but for new Moves like Natural Gift and possibly for some future Generation VII moves that might come).
    The idea is to load the dynamic type, then 'and'ing it with #0x3F (this automatically cover's subtracting C0 or 80 from r3) Then if results comes out to be zero check the type of the move from the move table. (The vanilla type effectiveness routine does this)
    This way there is no need to handle different type changing moves differently.

    Makes sense. I saw that in the original routine but I didn't understand how it worked, that's why I choose to substract. Now edited.

    3. Also, by directly returning instead of checking the move table, if the register is zero, we won't get a normal Weather Ball transforming the Protean mon to a Normal Type.

    Actually it's never 0 when those move are used, it was for safety. When weather ball is normal type, 0x80 is used and hidden power cannot be normal. but I changed that too. It's cleaner, thanks again

    Good work Kleenexfeu! I've edited your routine to touch up the mistakes, as well as to optimise it, and finally port it to Fire Red.

    I edited/tested my routine, it now uses KDS advises and your optimisation so you just have to update your post and Protean will be completely done for both version
     
    Last edited:

    Trainer 781

    Guest
  • 0
    Posts

    Just need to handle Struggle as Germaniac said, then this routine is set (should not activate protean) and also you do not need to check for Weather Ball or Hidden Power. Just check the dynamic type then the move table.

    Also, for toxic (if you are using mamamama's Battle Script) and Curse, the order of attackercanceler and jumpiftype command in their BS should be swapped. Though curse can be leaved as it is unless there is a Protean pokemon learning it.
     
  • 218
    Posts
    10
    Years
    • Seen Nov 12, 2021
    Just need to handle Struggle as Germaniac said, then this routine is set (should not activate protean) and also you do not need to check for Weather Ball or Hidden Power. Just check the dynamic type then the move table.

    Also, for toxic (if you are using mamamama's Battle Script) and Curse, the order of attackercanceler and jumpiftype command in their BS should be swapped. Though curse can be leaved as it is unless there is a Protean pokemon learning it.

    Curse is almost impossible to handle in double. You have to choose the target when your ghost type, and before using it, your not ghost type. Just have to edit curse battlescript. EDIT : Done, but you can't chose your target.

    Toxic works already with mamamama's script.

    Struggle is handled too, I'll just edit the individual check. EDIT : Done
     
    Last edited:
  • 794
    Posts
    10
    Years
    Sturdy code here[/SPOILER][/SPOILER]

    I know that Sturdy isn't complete yet but I wanted to get you know about something. Pokemon with that ability cannot be taken out with full hp no matter what. What I mean is, if its HP goes down to 1 HP and then he hits itself in confusion or takes poison/burn damage it still lives(so it actually doesn't take any damage from it at all). If you were aware of that, sorry.
     

    MrDollSteak

    Formerly known as 11bayerf1
  • 858
    Posts
    15
    Years
    Curse is almost impossible to handle in double. You have to choose the target when your ghost type, and before using it, your not ghost type. Just have to edit curse battlescript. EDIT : Done, but you can't chose your target.

    Toxic works already with mamamama's script.

    Struggle is handled too, I'll just edit the individual check. EDIT : Done

    I'll edit the post I made with your routines to match this.
    Also I wouldn't use Mamamama's Toxic Battle Script, there's no real need, I've included it in the 'victory star / wonder skin' routine along with Blizzard (in hail) and a few other moves.

    The work you guys have been doing here is amazing, so I'll sticky this. Keep it up!

    YAY! The sticky is back!

    I know that Sturdy isn't complete yet but I wanted to get you know about something. Pokemon with that ability cannot be taken out with full hp no matter what. What I mean is, if its HP goes down to 1 HP and then he hits itself in confusion or takes poison/burn damage it still lives(so it actually doesn't take any damage from it at all). If you were aware of that, sorry.

    Eeh, the main priority for this thread is making existing abilities from Gens IV to VI, rather than custom ones.

    I think the next ability I upload here will probably be the accuracy check ones like Wonder Skin, Victory Star etc. Not because they're particularly exciting but just because I have them done.

    Victory Star

    Spoiler:
    Wonder Skin

    Spoiler:
    Snow Cloak

    Spoiler:
    Tangled Feet

    Spoiler:
     
    Last edited:

    Trainer 781

    Guest
  • 0
    Posts
    I'll edit the post I made with your routines to match this.
    Also I wouldn't use Mamamama's Toxic Battle Script, there's no real need, I've included it in the 'victory star / wonder skin' routine along with Blizzard (in hail) and a few other moves.

    Yes, this is best way to go and automically takes care of Protean.
     
  • 218
    Posts
    10
    Years
    • Seen Nov 12, 2021
    Contrary for Emerald :

    Spoiler:


    Also, in some battle scripts, cmd 0x45 (the play animation command), with some specific parameters, is also responsible for playing stat changing animations.

    Apparently it's already handled, some guys sent me Mightyena when I was at -6 attack and it behaved correctly. Thanks again to KDS for the advice and thanks to Jambo51's documentation on battlescript.

    Contrary is now 100% working.

    A prototype of Simple, again for Emerald :
    Spoiler:


    Todo: Change the message displayed.

    Any suggestion to improve it is welcome, you can also use it as I'm sure it's bug free, the issue is just not "aesthetic".
     
    Last edited:

    Trainer 781

    Guest
  • 0
    Posts

    You'll also need to edit the Jumpifstat command to handle Contrary.

    Suppose you are +6 attack, +6 defense, and -6 speed. And you are using non-ghost type Curse on a Contrary mon after this.
    Then the series of these commands would assume that there is no further need to change stats and branch to the fail condition without considering Contrary.

    Also, in some battle scripts, cmd 0x45 (the play animation command), with some specific parameters, is also responsible for playing stat changing animations.
     

    MrDollSteak

    Formerly known as 11bayerf1
  • 858
    Posts
    15
    Years
    Here's Snow Warning for Fire Red! I'll update this and port it to Emerald. I'm going to edit it slightly in the future to account for the new weather abilities too that Kleenex has already written routines for.

    Snow Warning

    Spoiler:
     
    Last edited:
  • 275
    Posts
    9
    Years
    Is it possible to make an ability where physical normal attacks are changed to the Pokémon's type (or for a specific type, like Rock)?
    My reasons: If an Onix or a Golem tackles, they throw their bodies against the enemy. But since their bodies are made of rock, it would be like a Rock Throw, making the normal attack be exactly like a rock-type attack.
    Well, possible?
     
    Back
    Top