Binary Hack Research & DevelopmentGot a well-founded knack with your binary Pokémon hacks? Love reverse-engineering them? For the traditional Pokémon ROM hacker, this is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!
hello. i just wanna ask how to properly implement a new ability.
i'm kind of new to asm hacking and so far i think i'm doing well (just a thought, though)
i successfully added some into my rom like the BW2 Repel system, gain-exp-on-catch, fix sturdy, color codes on nature and IV indicator. since i've done it pretty well i just thought maybe i'd try adding a new ability.
the ability i was trying to add is this protean:
because greninja is a thing, but whenever i tried to use it on battle, it doesn't work.
now the problem is, when i paste this ( 00 49 08 47 01 7B 77 08 ) to 1D7D8 (as instructed) nothing happens. i tried to not to add 1 on the "00" (last) part of the hex where i insert the asm but the screen just stuck after an attack. then i even tried not to reverse the hex and it called a rain, then crash >___<
the part (offset?) where i inserted the asm was on 777B00. i can't really figure out where did i got it wrong, but i really want to learn how to add it because it's a good feature. i hope someone could tell me my mistake. and lastly, sorry for a long reply, plus the bad english since it's not my mother language.
ps: i'm using mrds patch
Okay, I'm not really good at ASM, but I picked up a few things.
1st, in the ASM code, there is a section near the start called 'Proteancheck'.
In this section there's a bit of code that says:
cmp r0, #0xA9.
The A9 represents the index for the ability Protean in the table of abilities. This will not be exactly the same as in your rom. Assuming this is the only ability you have added, it should be 0x4E.
If you have added more, then it should be 0x4D + NN + 0x01 where NN is the number of abilities you have added before protean in hex.
2nd, I believe there is a string that prints that the user has changed type that you have to insert as well, but I'm not entirely sure.
__________________
3DS Friend Code: 5069-3944-3902
IGN: Peter; (X, Y, OR, AS, S, M, US, UM)
Friend Safari: (Fighting) Throh, Meditite, Breloom
Living Pokedex Complete: Y, C, R, LG, E, D, Pl, HG, B, B2, X, Y, OR, AS, M, UM, LGP, Sw, LA
Big thanks especially to DestinedJagold, Xerneas_X, Elements1, ~RNC~ and ThePoke Man
Okay, I'm not really good at ASM, but I picked up a few things.
1st, in the ASM code, there is a section near the start called 'Proteancheck'.
In this section there's a bit of code that says:
cmp r0, #0xA9.
The A9 represents the index for the ability Protean in the table of abilities. This will not be exactly the same as in your rom. Assuming this is the only ability you have added, it should be 0x4E.
If you have added more, then it should be 0x4D + NN + 0x01 where NN is the number of abilities you have added before protean in hex.
2nd, I believe there is a string that prints that the user has changed type that you have to insert as well, but I'm not entirely sure.
i see. so it's a lot more complicated than i thought. thanks for telling me. ill try it again and see if ill be able to do it. thanks for the tips!
Is there a routine for Multitype and Judgement around? I think there's an Arceus form change somewhere but I'd like to know if anyone has a fully working version of him, as he should be, Judgement and all.
The bolded lines indicate my additions. Let's say C1 is the ability index, will this work?
__________________
This signature has been disabled.
Scrollbar appears
Please review and fix the issues by reading the signature rules.
You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.
Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
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.
I gave Chirpich (my ideamon) an Ability Snow Warning and Draciate(Don't mind the Draciate name, that's not its effect, just for a test) and capture two Chirpichs with Snow Warning and Draciate Ability. However, instead of "Chirpich's Snow Warning made it hail!", the text appears as "Chirpich's Draciate made it hail!" even though that Chirpich has Snow Warning Ability.
I provided 2 videos below.
The first one shows the success of Draciate but the second one fails.
Can anyone here help me with this?
__________________
This signature has been disabled.
Scrollbar appears
Please review and fix the issues by reading the signature rules.
You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.
Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
There was a report mentioning problems with the Magic Bounce Ability in MrDS's Rombase, so I decided it to implement this myself from scratch, and it is working fine in Trainer Battles and Doubles.
Here it is posted with Moxie.
Magic Bounce
Spoiler:
Fire Red
For MrDS's base 1.5a at x1D8D6 insert, 18 01 80 18 00 78 C0 06 88 46 before applying the new routines to remove branch to the old routine.
+ If for some stupid reason, Magic Coat is used on a Magic Bounce pokemon, then Magic coat activates before Magic bounce.
+ Magic Bounce does not activate, if the mon with Magic Bounce is in a semi-invulnerable state (fly, dive etc.).
+ Added a special Flag to ensure that Magic Bounce does not re-reflect a move reflected by Magic Bounce/Magic Coat. Otherwise, a infinite ping-pong loop happens between two Magic Bounce pokemon.
+ A free RAM location is used for this Flag. Initially, it is set to 0. When the condition for Magic Coat or Magic Bounce is met, it is set to 1 (e.g, always the case in singles, reflected spore in doubles) or 2 (e.g reflected growl in doubles), according to the no. of mons the rebounded Move can affect, and then the Rebound is executed.
+ If the value of the Flag is non-zero, the Magic Bounce and Magic Coat checks are automatically skipped to avoid the re-reflection situation and the Flag is decremented by 1 and this Step is repeated until the Flag is cleared to 0.
+ This to try to ensure that during the Rebound itself, the Flag is successfully cleared to 0.
+ The free RAM location refered in the 3 routines MUST BE SAME.
+ Will port to Emerald soon.
E3 01 ZZ ZZ ZZ 08
20 01 00 01 0C ZZ ZZ ZZ 08
39 20 00
2E 8F 44 02 02 00
48 01 02 00
2E 8E 44 02 02 11
89 41 ZZ ZZ ZZ 08
FB 20 E3 03 02 SS SS SS 08 //Assuming that setword command is at FB, and the RAM location for the string pointer is at 0x203E320. If not, then change this line accordingly
10 84 01
12 40 00
3C
Also, these require Jambo's Callasm and Setword commands, and his Battle String Loader Hack.
I expanded the table...
I think it has f7(starting from 00) commands.... so I inserted the jambo's callasm at f8 and setword command at f9 is it ok ????
also
1E 01 9AYY YY YY 08
what about that underlined 9A
do it needs to be changed or is something special there ???
#310Link to this post, but load the entire thread.
November 17th, 2016 (5:52 AM).
Trainer 781
Guest
Posts: n/a
Quote:
Originally Posted by The_learner
I expanded the table...
I think it has f7(starting from 00) commands.... so I inserted the jambo's callasm at f8 and setword command at f9 is it ok ????
also
1E 01 9AYY YY YY 08
what about that underlined 9A
do it needs to be changed or is something special there ???
hoping to get answer :)
Yes, its good to go.
9A is the ability index for moxie. So if you have an index other than 9A for moxie then you will have to change this.
.SlowStartLoc is a free ram location that you can use to have the counter for slow start.
It has come to my attention that Technician can apply some unwanted boosts to Revenge and a few other moves, so the code will be amended in the future.
.SlowStartLoc is a free ram location that you can use to have the counter for slow start.
It has come to my attention that Technician can apply some unwanted boosts to Revenge and a few other moves, so the code will be amended in the future.
It should be noted that this doesn't work fully with Multi-hit moves, in that they do not break Sturdy. I am planning on rewriting the entire Multi-hit system to make Parental Bond.
It should be noted that this doesn't work fully with Multi-hit moves, in that they do not break Sturdy. I am planning on rewriting the entire Multi-hit system to make Parental Bond.
False Swipe no longer works after I put Sturdy {D:}
Hey guys! I am finding it hard to insert the abilities in my ROM is there any one who could be willing to help out? I expand the Ability Table and then insert the ASM then what do i Have to do ??? I dont want to rely on MrDs' Patch (no offence) as it is not dynamic...
Hey guys! I am finding it hard to insert the abilities in my ROM is there any one who could be willing to help out? I expand the Ability Table and then insert the ASM then what do i Have to do ??? I dont want to rely on MrDs' Patch (no offence) as it is not dynamic...
insert the asm routines and make the necessary byte changes, and all should be outlined in the post :P
edit: and mrds' patch is rather fine to use unless if you're using that space starting at 0x900000
Search for the pointer D9 6C 1D 08 in your rom, and replace it with a pointer to free space XX XX XX 08.
Battle Script at XX XX XX
Code:
1E 01 5D YY YY YY 08
28 D9 6C 1D 08
Battle Script at YY YY YY
Code:
00
01 5E 69 1D 08
00 00 02 03
8D 05
8E 2E
2E DA 3F 02 02 00
28 EC 6C 1D 08
Emerald
Spoiler:
Search for the pointer EA 8D 2D 08 in your rom, and replace it with a pointer to free space XX XX XX 08.
Battle Script at XX XX XX
Code:
1E 01 5D YY YY YY 08
28 EA 8D 2D 08
Battle Script at YY YY YY
Code:
00
01 5E 8A 2D 08
00 00 02 03
8D 05
8E 2E
2E 8A 44 02 02 00
28 FD 8D 2D 08
Having a problem with this one - all multi-hit moves are hitting five times 100% of the time, even if the user does not have Skill Link. I figured maybe the 5D in the first script was just taken from the "default" index for Skill Link, and I changed that to the index of what it is in my hack, but no dice. Is there something else I need to do?
EDIT: Nevermind!! What I had accidentally done was, when replacing the pointers, I replaced the one in the second script by mistake. Working fine now.
There was a report mentioning problems with the Magic Bounce Ability in MrDS's Rombase, so I decided it to implement this myself from scratch, and it is working fine in Trainer Battles and Doubles.
Here it is posted with Moxie.
Magic Bounce
Spoiler:
Fire Red
For MrDS's base 1.5a at x1D8D6 insert, 18 01 80 18 00 78 C0 06 88 46 before applying the new routines to remove branch to the old routine.
+ If for some stupid reason, Magic Coat is used on a Magic Bounce pokemon, then Magic coat activates before Magic bounce.
+ Magic Bounce does not activate, if the mon with Magic Bounce is in a semi-invulnerable state (fly, dive etc.).
+ Added a special Flag to ensure that Magic Bounce does not re-reflect a move reflected by Magic Bounce/Magic Coat. Otherwise, a infinite ping-pong loop happens between two Magic Bounce pokemon.
+ A free RAM location is used for this Flag. Initially, it is set to 0. When the condition for Magic Coat or Magic Bounce is met, it is set to 1 (e.g, always the case in singles, reflected spore in doubles) or 2 (e.g reflected growl in doubles), according to the no. of mons the rebounded Move can affect, and then the Rebound is executed.
+ If the value of the Flag is non-zero, the Magic Bounce and Magic Coat checks are automatically skipped to avoid the re-reflection situation and the Flag is decremented by 1 and this Step is repeated until the Flag is cleared to 0.
+ This to try to ensure that during the Rebound itself, the Flag is successfully cleared to 0.
+ The free RAM location refered in the 3 routines MUST BE SAME.
+ Will port to Emerald soon.
E3 01 ZZ ZZ ZZ 08
20 01 00 01 0C ZZ ZZ ZZ 08
39 20 00
2E 8F 44 02 02 00
48 01 02 00
2E 8E 44 02 02 11
89 41 ZZ ZZ ZZ 08
FB 20 E3 03 02 SS SS SS 08 //Assuming that setword command is at FB, and the RAM location for the string pointer is at 0x203E320. If not, then change this line accordingly
10 84 01
12 40 00
3C
Also, these require Jambo's Callasm and Setword commands, and his Battle String Loader Hack.
Not sure why I am having a tough time getting Moxie to work. When I KO a pokemon in the wild the attack boost animation plays then the game gets stuck there.
I put the pointer to where I inserted script XXXXXX at 0x08213DC;
changed the ability index to 4E from 9A since I only added Moxie;
added callasm to the command table at F8;
added battle string loader exactly as Jambo posted it here https://www.pokecommunity.com/showpost.php?p=7101031&postcount=230 do I need to change it at all?;
added setword command KDS posted on page 3 and added a pointer to it at FA in the command table.
#320Link to this post, but load the entire thread.
January 7th, 2017 (3:17 AM).
Trainer 781
Guest
Posts: n/a
Quote:
Originally Posted by Chaotix
Not sure why I am having a tough time getting Moxie to work. When I KO a pokemon in the wild the attack boost animation plays then the game gets stuck there.
I put the pointer to where I inserted script XXXXXX at 0x08213DC;
changed the ability index to 4E from 9A since I only added Moxie;
added callasm to the command table at F8;
added battle string loader exactly as Jambo posted it here https://www.pokecommunity.com/showpost.php?p=7101031&postcount=230 do I need to change it at all?;
added setword command KDS posted on page 3 and added a pointer to it at FA in the command table.
#322Link to this post, but load the entire thread.
January 7th, 2017 (3:28 AM).
Trainer 781
Guest
Posts: n/a
Quote:
Originally Posted by Chaotix
The code for Fire Red has it as FA to start,
That segment of code as it is in my ROM:
Code:
FA 20 C0 03 02 90 50 77 08
Oops, my bad. The issue must be setword command not being set up properly if you are getting the animation to play properly. Try to redo the steps from scratch.
Oops, my bad. The issue must be setword command not being set up properly if you are getting the animation to play properly. Try to redo the steps from scratch.
Started from back-up before adding the one new ability, battle string loader, and setword; after re-implementing all of them it was the same result.
The changes made so far are: Doesn't's 1.6 PSS, repointed attack everything and added 1 new attack, Repointed BS command table, added callasm to F8, First Side Routine Rewrite. Could any of that cause a problem?
Either way gonna try straight from a clean FR now and add only the ability, repoint the BSC table and add F8 Callasm, FA Setword, and Battle String Loader.
Edit: From clean FR start after KOing a pokemon the animation for attack up plays then the message displayed is the Rival's "WHAT? Unbelievable! I Picked the wrong pokemon!" RAM offset issue for one of the things?
#324Link to this post, but load the entire thread.
January 7th, 2017 (5:18 AM).
Trainer 781
Guest
Posts: n/a
Quote:
Originally Posted by Chaotix
Started from back-up before adding the one new ability, battle string loader, and setword; after re-implementing all of them it was the same result.
The changes made so far are: Doesn't's 1.6 PSS, repointed attack everything and added 1 new attack, Repointed BS command table, added callasm to F8, First Side Routine Rewrite. Could any of that cause a problem?
Either way gonna try straight from a clean FR now and add only the ability, repoint the BSC table and add F8 Callasm, FA Setword, and Battle String Loader.
Edit: From clean FR start after KOing a pokemon the animation for attack up plays then the message displayed is the Rival's "WHAT? Unbelievable! I Picked the wrong pokemon!" RAM offset issue for one of the things?
Check the contents of 0x203C020 in the VBA memory viewer at the time of message display.
Check the contents of 0x203C020 in the VBA memory viewer at the time of message display.
All 0s anywhere near it. That section isn't having anything stored there at all while doing anything in the game.
Instead it seems to be loading from 0x202298C. Can advance frame by frame until it loads the Rival message then manually replace the contents with the bytes for the string and it prints "WO's Moxie Raised its attack!"
I have no idea why it isn't using 0x203C020..
Edit: while viewing the memory in VBA at 0x2023D74 it seems to have a pointer to what is currently happening in battle, when it lands on the FA in the Moxie script it jumps to the next byte after SS SS SS 08. Is it skipping the 20 C0 03 02 then?