Advertiser Content

Resource FBI's HM type-check hack Page 3

Started by Uncommon December 2nd, 2015 7:28 PM
  • 16760 views
  • 70 replies

Uncommon

Oozma Kappa

Johto
Seen 5 Days Ago
Posted 5 Days Ago
191 posts
4.3 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.
My work: HM type-check system hack (FireRed) | Turbo Test patch (FireRed)

Uncommon

Oozma Kappa

Johto
Seen 5 Days Ago
Posted 5 Days Ago
191 posts
4.3 Years
BUG ALERT!!!!!

https://www.pokecommunity.com/showthread.php?t=390176
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.
My work: HM type-check system hack (FireRed) | Turbo Test patch (FireRed)

mbcn10ww

Male
Brazil
Seen 1 Week Ago
Posted 1 Week Ago
367 posts
3 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
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
Male
Seen August 23rd, 2018
Posted July 17th, 2018
21 posts
11.2 Years
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

Johto
Seen 5 Days Ago
Posted 5 Days Ago
191 posts
4.3 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.
My work: HM type-check system hack (FireRed) | Turbo Test patch (FireRed)

Male
Seen August 23rd, 2018
Posted July 17th, 2018
21 posts
11.2 Years
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

Johto
Seen 5 Days Ago
Posted 5 Days Ago
191 posts
4.3 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?
My work: HM type-check system hack (FireRed) | Turbo Test patch (FireRed)

Male
Seen August 23rd, 2018
Posted July 17th, 2018
21 posts
11.2 Years
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:
So I started with a clean 1.0 Fire Red Rom. I found 40 bytes of freespace at the offset 0x71A23C. I then paste-wrote (ctrl+b) the instructed bytes to this location.
06 4A 12 78 88 79 90 42 02 D0 C8 79 90 42 03 D1 28 1C 70 BC 02 BC 08 47 01 48 00 47 B8 70 03 02 59 A8 0C 08
I then went to offset 0xCA840 and paste-wrote the below bytes:
00 48 00 47 3D A2 71 08
The former four being ones you supplied, the latter four being the modified pointer to the new data I just added.

I then opened XSE, opened my rom, pasted in the code in your first post that I immediately copied from said post and pressed compile. Below is the error I receive. The IMG tag will not work here for some unknown reason, so you will have to follow the link to the Imgur post I made manually.


https://imgur.com/a/SuxPdOs


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.

Uncommon

Oozma Kappa

Johto
Seen 5 Days Ago
Posted 5 Days Ago
191 posts
4.3 Years
For posterity's sake, I might as well do exactly as you directed though.

Spoiler:
So I started with a clean 1.0 Fire Red Rom. I found 40 bytes of freespace at the offset 0x71A23C. I then paste-wrote (ctrl+b) the instructed bytes to this location.
06 4A 12 78 88 79 90 42 02 D0 C8 79 90 42 03 D1 28 1C 70 BC 02 BC 08 47 01 48 00 47 B8 70 03 02 59 A8 0C 08
I then went to offset 0xCA840 and paste-wrote the below bytes:
00 48 00 47 3D A2 71 08
The former four being ones you supplied, the latter four being the modified pointer to the new data I just added.

I then opened XSE, opened my rom, pasted in the code in your first post that I immediately copied from said post and pressed compile. Below is the error I receive. The IMG tag will not work here for some unknown reason, so you will have to follow the link to the Imgur post I made manually.


https://imgur.com/a/SuxPdOs


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.
Thanks for documenting your process so well! I just tried to recreate this by following the same steps on a clean ROM, and I wasn't able to reproduce the error. I checked the XSE version and mine is v1.1.1 - that is likely the issue. Maybe "bufferpartypokemon" is a keyword not recognized by older versions? You can try getting v1.1.1 from here and see if that solves the problem.
My work: HM type-check system hack (FireRed) | Turbo Test patch (FireRed)

Male
Seen August 23rd, 2018
Posted July 17th, 2018
21 posts
11.2 Years
Updating to XSE 1.1.1 absolutely fixed the problem I was having. The script compiled and I saved the log it made. I got a few steps into the hex editing stuff and when I looked at how much more there was to do for something I already have working properly I just stopped. Make sure you tell people to specifically get XSE version 1.1.1 in the main post. Thanks for being so active.

Oddly enough the update check on 1.1.1 actually functions and returns that 1.1.1 is the newest version. Weird that 1.0.1 can't be updated in this way.

lilbluedemon

Crunching the numbers!

Female
Seen May 4th, 2019
Posted October 6th, 2018
209 posts
4.6 Years
How do you do Diving and Rock Climbing?
I'm not 100% sure, but wouldn't these need some extra work, since even though Dive is in FRLG, it doesn't have any function as a field move since Kanto, and the Sevii Islands have no underwater areas.

And Rock Climbing isn't a thing in FRLG, but I know some people have made scripts, and codings for it.
"What are you running from?"

Uncommon

Oozma Kappa

Johto
Seen 5 Days Ago
Posted 5 Days Ago
191 posts
4.3 Years
How do you do Diving and Rock Climbing?
I'm not 100% sure, but wouldn't these need some extra work, since even though Dive is in FRLG, it doesn't have any function as a field move since Kanto, and the Sevii Islands have no underwater areas.

And Rock Climbing isn't a thing in FRLG, but I know some people have made scripts, and codings for it.
lilbluedemon is exactly right - Dive's and Rock Climb's field effects don't exist in vanilla FireRed, so they also don't exist in this patch. A few people have built their own versions, including Spherical Ice off the top of my head. Maybe if I somehow got a ton of free time someday I could add them to this, but at the moment I have no plans to do so.

However, mbcn10ww's fork of this hack does include both Dive and Rock Climb (according to his thread, I haven't personally tested it).
My work: HM type-check system hack (FireRed) | Turbo Test patch (FireRed)

Male
Seen September 9th, 2018
Posted September 9th, 2018
38 posts
3.9 Years
So correct me if I'm wrong, but it should be possible to have multiple types able to use HMs, right? I'm looking at the script for Strength:

#org @newstrength

call @init            'initialization check, from original
call @flagcheck       'check if new check system is enabled 
if 0x0 goto @originalstrength

lockall
checkflag 0x828       'set this to the new badge you want (828 is the pkmn menu)
if 0x0 goto 0x81BE185
checkflag 0x805       'strength active flag - do not change
if 0x1 goto 0x81BE18E

setvar 0x8000 0x1     'set this to the type you want (1 is Fighting)
special2 0x4001 0x12B
compare 0x4001 0x6
if 0x4 goto 0x81BE185
'setvar 0x4001 LASTRESULT 

goto @strengthaction
It should be possible to call the type check twice for Fighting and, if that fails, let's say Rock. It won't necessarily use the first Pokemon in the party (e.g. a Geodude up front and a Machop at the end would result in Machop using Strength because Fighting was checked first) but it would allow either to work. I haven't worked with XSE a whole lot yet but it looks like a second comparison of variable 0x4001 to 6 would work: if equal go to the second type check.

Uncommon

Oozma Kappa

Johto
Seen 5 Days Ago
Posted 5 Days Ago
191 posts
4.3 Years
So correct me if I'm wrong, but it should be possible to have multiple types able to use HMs, right? I'm looking at the script for Strength:

...

It should be possible to call the type check twice for Fighting and, if that fails, let's say Rock. It won't necessarily use the first Pokemon in the party (e.g. a Geodude up front and a Machop at the end would result in Machop using Strength because Fighting was checked first) but it would allow either to work. I haven't worked with XSE a whole lot yet but it looks like a second comparison of variable 0x4001 to 6 would work: if equal go to the second type check.
Absolutely! I believe that's exactly how mbcn10ww did it in his fork of the hack. Fly is slightly more complicated since it's done through ASM, but I was able to modify its routine for mbcn10ww to check two types as well.
My work: HM type-check system hack (FireRed) | Turbo Test patch (FireRed)

Overlord Kaktus

Made in Guatemala

Male
Guatemala City
Seen 2 Days Ago
Posted 3 Days Ago
302 posts
5.6 Years
Well, for the ones using this awesome hack but want to get rid forever of the old HM field moves there is a way to remove it.

You just need to write FF FF FF FF FF FF FF FF FF FF FF FF FF FF at 0x45A77B and that will remove the check for the moves that have an outside field effect. Here is a gif with this applied:



This will just remove the move check from HM01 to HM07, This will NOT remove the field effect for other moves like Teleport or Dig,

Uncommon

Oozma Kappa

Johto
Seen 5 Days Ago
Posted 5 Days Ago
191 posts
4.3 Years
Well, for the ones using this awesome hack but want to get rid forever of the old HM field moves there is a way to remove it.

You just need to write 00 00 00 00 00 00 00 00 00 00 00 00 00 00 at 0x45A77B and that will remove the check for the moves that have an outside field effect. Here is a gif with this applied:



This will just remove the move check from HM01 to HM07, This will NOT remove the fied effect for other moves like Teleport or Dig,
Ooh, this is really cool! I had wanted to add this but had no idea how to do it. How did you figure it out? Thanks for sharing!
My work: HM type-check system hack (FireRed) | Turbo Test patch (FireRed)

Overlord Kaktus

Made in Guatemala

Male
Guatemala City
Seen 2 Days Ago
Posted 3 Days Ago
302 posts
5.6 Years
Ooh, this is really cool! I had wanted to add this but had no idea how to do it. How did you figure it out? Thanks for sharing!
By using the documentation from FBI's method to add more field moves. And well, I updated the information I posted because by doing what I wrote will give you some errors with Pokémon with less than 4 moves.
I'm just a normal romhacker c:
Advertiser Content