• 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.

FBI's HM type-check hack

Uncommon

Oozma Kappa
192
Posts
8
Years
Well, nice, if you want to connect to my thread with custom AddOns, check out my signature and it have a thread I've started with my custom settings.

Minor update: I've confirmed your fix and applied it to the Surf, Waterfall, Cut, Rock Smash, and Strength scripts. Flash, as you noted, was already working correctly. For Fly, I have totally forgotten how I built it in the first place, but luckily I documented the whole thing - I am going through that documentation now to figure out how to implement the fix. As soon as I get that implemented correctly, I'll release the updated version, as well as link to your version as another option. Thanks for your contribution!
 
352
Posts
7
Years
  • Age 30
  • Seen Mar 10, 2022
Minor update: I've confirmed your fix and applied it to the Surf, Waterfall, Cut, Rock Smash, and Strength scripts. Flash, as you noted, was already working correctly. For Fly, I have totally forgotten how I built it in the first place, but luckily I documented the whole thing - I am going through that documentation now to figure out how to implement the fix. As soon as I get that implemented correctly, I'll release the updated version, as well as link to your version as another option. Thanks for your contribution!

Good, I don't know if Fly is wrong because I've removed the black bar and Pok?mon showing up.

If you have a source for Fly send me, because I'll try to make an AddOn like the others I made, to add a second type check to Fly.
 

Uncommon

Oozma Kappa
192
Posts
8
Years
Good, I don't know if Fly is wrong because I've removed the black bar and Pok?mon showing up.

If you have a source for Fly send me, because I'll try to make an AddOn like the others I made, to add a second type check to Fly.

Yep, Fly also exhibits the same bug. I'll post the source once I figure it out again. It's only a very slight modification to FBI's routine in order to check for badges/other flags.
 

Blah

Free supporter
1,924
Posts
11
Years
What are you guys trying to do? Fix the Pokemon that appears when you use an HM?

If so writing the slot id (0-5) of the Pokemon who is using fly to 0203B0A9 before calling the fly routine should do it.
 
Last edited:

Uncommon

Oozma Kappa
192
Posts
8
Years
What are you guys trying to do? Fix the Pokemon that appears when you use an HM?

If so writing the slot id (0-5) of the Pokemon who is using fly to 0203B0A9 before calling the fly routine should do it.

Thanks FBI! I know it's simple but I'm super rusty + was never good at ASM to begin with + have almost no time for ROM hacking these days :( Always appreciate your help.
 

Flying Turtle

Some Random Ghost
29
Posts
9
Years
Would it be possible to make it check for more than one type? e.g. make it so that both Fire- and Electric-types can use Flash.
 

Uncommon

Oozma Kappa
192
Posts
8
Years
What are you guys trying to do? Fix the Pokemon that appears when you use an HM?

If so writing the slot id (0-5) of the Pokemon who is using fly to 0203B0A9 before calling the fly routine should do it.

Hey FBI, I'm struggling to accomplish this and wondering if you could help point me in the right direction.

Code:
.text
.align 2
.thumb
.thumb_func

main:
	push {lr}
	ldr r0, .VAR @set paramaters for special
	mov r1, #0x2
	strb r1, [r0]
	ldr r1, =(0x80CA804 +1) @check flying type
	bl CALLER
	cmp r0, #0x6
	bge NORMALMAP @if no flying open normal map

	[B]ldr r1, .SLOT
	strb r0, [r1] @write slot number of flying type to .SLOT[/B]

	ldr r1, =(0x80C4EF8 +1)
	bl CALLER
	b END

NORMALMAP:
	ldr r1, =(0x80A1CC0 +1)
	bl CALLER
	b END

CALLER:
	bx r1

END:
	pop {pc}
	

.align 2
.VAR:
	.word 0x020270B8 + (0x8000 * 2)
[B].SLOT:
	.word 0x0203B0A9 + (0x8000 * 2)
[/B]

Bold are the lines I've added to try to fix this. It write the slot ID, which is stored in r0 by the special, to the address you specified. But testing shows no change from the original behavior (ie, still showing whichever Pokemon is first in the party). Anything obvious I'm doing wrong here? Thanks
 

Blah

Free supporter
1,924
Posts
11
Years
Hey FBI, I'm struggling to accomplish this and wondering if you could help point me in the right direction.

Code:
.text
.align 2
.thumb
.thumb_func

main:
	push {lr}
	ldr r0, .VAR @set paramaters for special
	mov r1, #0x2
	strb r1, [r0]
	ldr r1, =(0x80CA804 +1) @check flying type
	bl CALLER
	cmp r0, #0x6
	bge NORMALMAP @if no flying open normal map

	[B]ldr r1, .SLOT
	strb r0, [r1] @write slot number of flying type to .SLOT[/B]

	ldr r1, =(0x80C4EF8 +1)
	bl CALLER
	b END

NORMALMAP:
	ldr r1, =(0x80A1CC0 +1)
	bl CALLER
	b END

CALLER:
	bx r1

END:
	pop {pc}
	

.align 2
.VAR:
	.word 0x020270B8 + (0x8000 * 2)
[B].SLOT:
	.word 0x0203B0A9 + (0x8000 * 2)
[/B]

Bold are the lines I've added to try to fix this. It write the slot ID, which is stored in r0 by the special, to the address you specified. But testing shows no change from the original behavior (ie, still showing whichever Pokemon is first in the party). Anything obvious I'm doing wrong here? Thanks

change:
Code:
.word 0x0203B0A9 + (0x8000 * 2)

to

Code:
.word 0x0203B0A9
 

Uncommon

Oozma Kappa
192
Posts
8
Years
change:
Code:
.word 0x0203B0A9 + (0x8000 * 2)

to

Code:
.word 0x0203B0A9

woooooooowwwww
that works {D:}
can't believe that's all it took
FBI I owe you so much

I'll integrate this with the rest of the stuff, document it, and release the updated patch tomorrow.
 

Uncommon

Oozma Kappa
192
Posts
8
Years
Update 1/1/17


Happy New Year PC! I have a few bits of news to share about this project:


  • Version 1.1 released! mbcn10ww discovered and solved a bug with this hack. In Version 1.0, for all HMs except Flash, although checking for types was functionally correct, the animation and text always showed the first Pokémon in your party, not necessarily the one with the correct type. mbcn10ww came up with a simple fix, which I verified and applied to all HMs in Version 1.1, with help from FBI. The Downloads section of the OP has been updated.
  • I've added the source ASM for Fly into the Advanced section (originally I only had the compiled version there), so you can mess around with it if you want.
  • Also, mbcn10ww has made his own fork of this hack. In addition to the aforementioned bug fix, his version also moves the hack out to offset 0x990000 to increase compatibility with hacks in progress and adds the ability to use more than one type per HM move (which is really cool!). Check out the thread here.
  • I will continue to keep this thread maintained because I feel this base version is simpler and I can personally vouch for its stability, but feel free to check out mbcn10ww's version, too. I will still love you no matter which version you use <3
  • The Advanced section of the OP is still being updated to reflect the changes to Version 1.1, I'll try to have that finished in the next couple days and will post an announcement when done. All the other sections are already updated.
 
Last edited:

Uncommon

Oozma Kappa
192
Posts
8
Years
Minor update 1/7/17:

  • Advanced and Compatibility sections of the OP updated
  • The whole OP is now up-to-date for Version 1.1
 

Uncommon

Oozma Kappa
192
Posts
8
Years

As noted in the linked thread, this is a real yet extremely minor bug that only occurs in the Safari Zone and is not game-breaking in any way. The only ill effect is that you lose the option to immediately "retire" from the Start menu and have to use up your steps instead. I don't plan on addressing it, but I have posted the relevant information in the linked thread in case you want to take a crack at it.
 
352
Posts
7
Years
  • Age 30
  • Seen Mar 10, 2022
Minor update 1/7/17:

  • Advanced and Compatibility sections of the OP updated
  • The whole OP is now up-to-date for Version 1.1

I updated my HMs Type Check, take a look:
- Used offsets 0x98FE00 - 0x99119F (it don't uses all of it, but it's more safe to have this all free space);
- Added Rock Climb system;
- Added Dive system;
- Replaced unused RSE protagonists sprites with new Dive sprites for Red and Leaf;
- Changed the Alternate Flags to default/unused safe flags (don't need expanded flags anymore).

https://www.pokecommunity.com/showpost.php?p=9510044&postcount=1
 
22
Posts
15
Years
  • Age 37
  • Seen Sep 15, 2021
Followed the tutorial; I got as far as trying to compile the script with XSE. Unfortunately that script throws the error 'Unknown keyword "bufferypartypokemon" at line 24'. I eventually found out that it might have changed to "bufferpokemon" since that is an option and appears to work. I then replaced all instances with "bufferpokemon". At this point it also gives a new error "Error 6 'Overflow' on line 44. Wrong parameter type." What? Okay, this one I actually don't know what it's asking for, so I guess that's as far as I go. Any ideas?

PS. The ips patch works well, but since it's a romhack in progress it actually overwrites the data of one of my maps, making it garbage blocks for most of the map, causing it to crash when entered. So much for a backup method to get it working.
 

Uncommon

Oozma Kappa
192
Posts
8
Years
Unfortunately that script throws the error 'Unknown keyword "bufferypartypokemon" at line 24'.

Emphasis mine. Looks like somehow you ended up with an extra letter typed in there, which would cause exactly the error you describe.

I eventually found out that it might have changed to "bufferpokemon" since that is an option and appears to work. I then replaced all instances with "bufferpokemon". At this point it also gives a new error "Error 6 'Overflow' on line 44. Wrong parameter type." What? Okay, this one I actually don't know what it's asking for, so I guess that's as far as I go. Any ideas?

Yeah don't do that, "bufferpartypokemon" and "bufferpokemon" are not interchangeable and take different parameters, so I would expect that error.

PS. The ips patch works well, but since it's a romhack in progress it actually overwrites the data of one of my maps, making it garbage blocks for most of the map, causing it to crash when entered. So much for a backup method to get it working.

This is exactly what the Compatibility section of the OP is addressing. I can't predict where everyone is going to put their data so I just picked a spot and called it out with a warning, and provided all the source code so people can make their own version that is definitely compatible with their work. In retrospect, I'm not very happy with the place I chose, since anyone who simply uses the first available free space is going to end up crashing with it. Maybe someday I'll move it to a better location, like mbcn10ww's version which moves the hack out to something like 0x990000. I guess the ideal solution would be to build an inserter tool where all you have to do is find free space and it does all the work, but I never got around to learning how to build those.
 
Last edited:
22
Posts
15
Years
  • Age 37
  • Seen Sep 15, 2021
Emphasis mine. Looks like somehow you ended up with an extra letter typed in there, which would cause exactly the error you describe.



Yeah don't do that, "bufferpartypokemon" and "bufferpokemon" are not interchangeable and take different parameters, so I would expect that error.



This is exactly what the Compatibility section of the OP is addressing. I can't predict where everyone is going to put their data so I just picked a spot and called it out with a warning, and provided all the source code so people can make their own version that is definitely compatible with their work. In retrospect, I'm not very happy with the place I chose, since anyone who simply uses the first available free space is going to end up crashing with it. Maybe someday I'll move it to a better location, like mbcn10ww's version which moves the hack out to something like 0x990000. I guess the ideal solution would be to build an inserter tool where all you have to do is find free space and it does all the work, but I never got around to learning how to build those.
Wow, wasn't expecting a reply this early from a mod that seemed derelict. Anyway, I can assure you that the errant 'y' in my post was an error only in my post. The script is verbatim what you typed in your original post, and very much does not work. I changed nothing.

Also that link you posted was a solution I very much would attempt, were his download links for all versions not down. It's too bad that isn't available anywhere, I would have liked to try it.

Anyway, since there is no modification the script I used, do you have any idea what I should try?
 

Uncommon

Oozma Kappa
192
Posts
8
Years
Wow, wasn't expecting a reply this early from a mod that seemed derelict.

lol, I'm not a mod, and don't think I'm "derelict", either. I really don't have time to hack anymore but still check this site once or twice a week because I like to maintain my work (ie. this thread).

Anyway, I can assure you that the errant 'y' in my post was an error only in my post. The script is verbatim what you typed in your original post, and very much does not work. I changed nothing....

Anyway, since there is no modification the script I used, do you have any idea what I should try?

What's the error you're getting? The one you posted corresponded to exactly what you'd get if you had that typo. Copy-and-paste the script into XSE (directly, don't paste it into another text editor first), compile, copy-and-paste the error you get. What line does it fail at?
 
22
Posts
15
Years
  • Age 37
  • Seen Sep 15, 2021
lol, I'm not a mod, and don't think I'm "derelict", either.
...
What's the error you're getting? The one you posted corresponded to exactly what you'd get if you had that typo. Copy-and-paste the script into XSE (directly, don't paste it into another text editor first), compile, copy-and-paste the error you get. What line does it fail at?

Lol, I wasn't calling YOU a mod, I meant your rom modification.

Either way, when I said verbatim I meant it. I directly copied from your post to XSE. Anyway, I managed to use your ips patch on a relatively new rom a week or so ago and it's working properly. Been working on a hack ever since. For posterity's sake, I might as well do exactly as you directed though.

Spoiler:


Just a quick question as well: which version of XSE was used for this to work successfully? I was using version 1.0.1. I already tried to use the update function, but apparently support for this program has been discontinued and it could not check for a newer version.
 
Back
Top