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

[Battle] Restoring a Vanilla Move's Data

22
Posts
15
Years
    • Seen Sep 15, 2021
    Hello. So I've been messing around with PGE, Gen3Tools and googling to try and figure this out and I just can't seem to do it on my own. I was wondering how to go about restoring a move's effect to its vanilla effect when using a modified rom. I've been using pokefreak890's 1460 base for a romhack I've been working on, and I noticed that False Swipe and Thief do not have their intended battle effects. I was hoping that I could simply find their hex data in a vanilla rom, and replace it in the rom hack. Of course, I'm not sure where these effects are stored nor how many bytes they occupy, but I'm hoping this is possible. Anyone know how to do this? Thanks in advance.
     
    476
    Posts
    6
    Years
    • Seen Feb 26, 2020
    Just use one of the tools lol. Go to "move effect" and look through the list until you find the effect you want
     
    22
    Posts
    15
    Years
    • Seen Sep 15, 2021
    Just use one of the tools lol. Go to "move effect" and look through the list until you find the effect you want
    I probably should have specified that it is impossible to use PGE for editing moves with my rom hack because whenever I open up the edit moves tab it simply errors out and will not let me view them at all; even with a custom .ini file that is purportedly configured for the base I'm using. I can still open them up with Gen3Tools, but even when PGE was functioning properly the actual information I'm looking for (offsets for effects, since the "false swipe" effect is not functioning as intended) is not present and therefore not available in these tools. Thank you for trying to help.

    Hopefully there is some useful and actionable information someone is willing to impart to me. Since I have no other leads I'm just going to have to wait.
     
    476
    Posts
    6
    Years
    • Seen Feb 26, 2020
    I probably should have specified that it is impossible to use PGE for editing moves with my rom hack because whenever I open up the edit moves tab it simply errors out and will not let me view them at all; even with a custom .ini file that is purportedly configured for the base I'm using. I can still open them up with Gen3Tools, but even when PGE was functioning properly the actual information I'm looking for (offsets for effects, since the "false swipe" effect is not functioning as intended) is not present and therefore not available in these tools. Thank you for trying to help.

    Hopefully there is some useful and actionable information someone is willing to impart to me. Since I have no other leads I'm just going to have to wait.

    Well, of course they won't list the actual offsets, since you don't ever need them.
     
    22
    Posts
    15
    Years
    • Seen Sep 15, 2021
    Well, of course they won't list the actual offsets, since you don't ever need them.

    Great, except for now, when I actually do need them.

    Again, I'm trying to find the offsets of the actual effects since a romhack base that has too many useful effects to be removed has broken something I'd like to restore to its vanilla working order. I was hoping to use manual hex editing to do this, but I'd need to know the offset of the move to do that.

    Hopefully that will clarify any further misunderstanding of the issue. Again, thank you for your attempted help thus far; hopefully this will only serve to help expedite the advance toward my goal.

    Of course, there's no guarantee that restoring the data would actually work as I intend it to, but since I'm trying to debug this and it is the only lead I have I'm going to have to pursue it first.
     

    AkameTheBulbasaur

    Akame Marukawa of Iyotono
    409
    Posts
    10
    Years
  • Great, except for now, when I actually do need them.

    Again, I'm trying to find the offsets of the actual effects since a romhack base that has too many useful effects to be removed has broken something I'd like to restore to its vanilla working order. I was hoping to use manual hex editing to do this, but I'd need to know the offset of the move to do that.

    Hopefully that will clarify any further misunderstanding of the issue. Again, thank you for your attempted help thus far; hopefully this will only serve to help expedite the advance toward my goal.

    Of course, there's no guarantee that restoring the data would actually work as I intend it to, but since I'm trying to debug this and it is the only lead I have I'm going to have to pursue it first.

    The attack data table is at 0x250C04. To get to the move, multiply the index number of the move by 12, and then add that to the offset I just gave you. This is all in hex of course. You can find the index number by going to Bulbapedia and finding it (in decimal). There are probably other ways too.

    Anyway, you'll need some sort of Hex calculator. I don't know what computer you have but I'm pretty sure every OS comes with one. There are also online ones too.

    Anyway, once you have the offset, you'll want to select the 12 bytes at that offset in a clean FireRed. This is the default move data. Then you'll want to replace the data in the ROM you have with the vanilla data.

    I haven't checked the ROM base you're using, but if they expanded the attack data table then the offset above will not be right. If you search for 04 0C 25 08 in the rom, and you get no results, you know they changed it.

    That table has all the data you'd be able to edit in PGE. It might not work, however, if the changes to the move's effects were made to the battle script itself. In that case, you will want to get a Battle Script editor/compiler/decompiler and find and replaces the scripts with the ones from default FireRed.

    Hopefully, this helped a little! If you have any more questions or want me to clarify anything feel free to ask.
     
    Last edited:
    22
    Posts
    15
    Years
    • Seen Sep 15, 2021
    The attack data table is at 0x250C04. To get to the move, multiply the index number of the move by 12, and then add that to the offset I just gave you. This is all in hex of course. You can find the index number by going to Bulbapedia and finding it (in decimal). There are probably other ways too.

    Anyway, you'll need some sort of Hex calculator. I don't know what computer you have but I'm pretty sure every OS comes with one. There are also online ones too.

    Anyway, once you have the offset, you'll want to select the 12 bytes at that offset in a clean FireRed. This is the default move data. Then you'll want to replace the data in the ROM you have with the vanilla data.

    I haven't checked the ROM base you're using, but if they expanded the attack data table then the offset above will not be right. If you search for 04 0C 25 08 in the rom, and you get no results, you know they changed it.

    That table has all the data you'd be able to edit in PGE. It might not work, however, if the changes to the move's effects were made to the battle script itself. In that case, you will want to get a Battle Script editor/compiler/decompiler and find and replaces the scripts with the ones from default FireRed.

    Hopefully, this helped a little! If you have any more questions or want me to clarify anything feel free to ask.

    Well that was incredibly helpful! Okay, he's what I got so far:

    False Swipe's ID is 206 or 0xCE in hex. Multiplying 0xCE by 0x12 (or 18 in base 10 mathematics) it comes to 0xE7C, therefore the offset I'm looking for is 0x251A80. In a vanilla FireRed rom those 12+ bytes are filled with things, unfortunately in the mod they're all blank (0xFF). Okay, how about the attack table? 0x250C04 is blank as far as the eye can see. Ah. Okay, how about the hex values 04 0C 25 08 that you gave me? Well, I found them easily in vanilla, but they're nowhere to be found in the mod. Okay. Well, I'm off to google then, to find information about FireRed battle scripting. Huh, some tool by shinyquagsire that doesn't seem to help me and a few threads that don't seem to help me...

    Okay, one more thing before I'm out of ideas. I found the custom .ini that the 1400 base is supposed to work with in PGE (it doesn't by the way) and it lists the Pokémon Attack Table as offset 0x025D7B4. Using that, the offset for False Swipe should be 0x25E630. So I took the 12 bytes from the original rom in the aforementioned original offset and pasted them over 12 bytes at 0x25E630. Rom boots, no noticeable changes at the moment, but False Swipe does not work as intended. Okay, at least I tried.

    Thank you for your help thus far, is there perhaps a tutorial or series of tutorials you have found to be useful that I might be able to make some headway in?
     
    476
    Posts
    6
    Years
    • Seen Feb 26, 2020
    Well that was incredibly helpful! Okay, he's what I got so far:

    False Swipe's ID is 206 or 0xCE in hex. Multiplying 0xCE by 0x12 (or 18 in base 10 mathematics) it comes to 0xE7C, therefore the offset I'm looking for is 0x251A80. In a vanilla FireRed rom those 12+ bytes are filled with things, unfortunately in the mod they're all blank (0xFF). Okay, how about the attack table? 0x250C04 is blank as far as the eye can see. Ah. Okay, how about the hex values 04 0C 25 08 that you gave me? Well, I found them easily in vanilla, but they're nowhere to be found in the mod. Okay. Well, I'm off to google then, to find information about FireRed battle scripting. Huh, some tool by shinyquagsire that doesn't seem to help me and a few threads that don't seem to help me...

    Okay, one more thing before I'm out of ideas. I found the custom .ini that the 1400 base is supposed to work with in PGE (it doesn't by the way) and it lists the Pokémon Attack Table as offset 0x025D7B4. Using that, the offset for False Swipe should be 0x25E630. So I took the 12 bytes from the original rom in the aforementioned original offset and pasted them over 12 bytes at 0x25E630. Rom boots, no noticeable changes at the moment, but False Swipe does not work as intended. Okay, at least I tried.

    Thank you for your help thus far, is there perhaps a tutorial or series of tutorials you have found to be useful that I might be able to make some headway in?

    Or you can just try to find the move data table in your ROM. There's probably something in the INI about it.
     

    AkameTheBulbasaur

    Akame Marukawa of Iyotono
    409
    Posts
    10
    Years
  • Well that was incredibly helpful! Okay, he's what I got so far:

    False Swipe's ID is 206 or 0xCE in hex. Multiplying 0xCE by 0x12 (or 18 in base 10 mathematics) it comes to 0xE7C, therefore the offset I'm looking for is 0x251A80. In a vanilla FireRed rom those 12+ bytes are filled with things, unfortunately in the mod they're all blank (0xFF). Okay, how about the attack table? 0x250C04 is blank as far as the eye can see. Ah. Okay, how about the hex values 04 0C 25 08 that you gave me? Well, I found them easily in vanilla, but they're nowhere to be found in the mod. Okay. Well, I'm off to google then, to find information about FireRed battle scripting. Huh, some tool by shinyquagsire that doesn't seem to help me and a few threads that don't seem to help me...

    Okay, one more thing before I'm out of ideas. I found the custom .ini that the 1400 base is supposed to work with in PGE (it doesn't by the way) and it lists the Pokémon Attack Table as offset 0x025D7B4. Using that, the offset for False Swipe should be 0x25E630. So I took the 12 bytes from the original rom in the aforementioned original offset and pasted them over 12 bytes at 0x25E630. Rom boots, no noticeable changes at the moment, but False Swipe does not work as intended. Okay, at least I tried.

    Thank you for your help thus far, is there perhaps a tutorial or series of tutorials you have found to be useful that I might be able to make some headway in?

    You multiplied by 0x12 (in hex), but you really should have multiplied by 12 in decimal (which is 0xC in hex). That might have done it, since you would have pasted the wrong move data.
     
    22
    Posts
    15
    Years
    • Seen Sep 15, 2021
    ... To get to the move, multiply the index number of the move by 12 ... This is all in hex of course. ...
    I tried to follow your instructions precisely, but I must have been confused by your wording.

    Anyway, thanks for telling me I misunderstood. I recalculated and re-edited based on these numbers. Honestly there is no difference, which makes me sad. The offsets in question are all filled with empty space in the mod (0xFF). I pasted the original 12 bytes to the empty space anyway just to make sure; it didn't do anything and False Swipe still knocks out. I was wrong about Thief not working, however. That move does work properly. Small solace. Anyway, below are the recalculated offsets, feel free to check them. Just in case I also tried the effect offset as well. Honestly, I'm not even sure how that worked, but with a backup I couldn't go wrong trying it anyway.

    Thinking about it, since they added 100 or so attacks the attack table should be different, so I guess it's not surprising that they repointed to change the offset. I found the thread where I got the ups patch for the 1400 from here. Further down the post they have ini file data for the mods, and I found that the offset for Attacks is now 0x900000. I also tried with that one, which unfortunately didn't work. The results are also below.

    Spoiler:
    My moment of greatest hope was when only one byte was off and I just had to change a 01 to 00. Unfortunately it did not work; shame.

    Likely I'll have to do some scripty nonsense to get this to work. Would you mind pointing me to some tutorials that might help?
     

    AkameTheBulbasaur

    Akame Marukawa of Iyotono
    409
    Posts
    10
    Years
  • I tried to follow your instructions precisely, but I must have been confused by your wording.

    Anyway, thanks for telling me I misunderstood. I recalculated and re-edited based on these numbers. Honestly there is no difference, which makes me sad. The offsets in question are all filled with empty space in the mod (0xFF). I pasted the original 12 bytes to the empty space anyway just to make sure; it didn't do anything and False Swipe still knocks out. I was wrong about Thief not working, however. That move does work properly. Small solace. Anyway, below are the recalculated offsets, feel free to check them. Just in case I also tried the effect offset as well. Honestly, I'm not even sure how that worked, but with a backup I couldn't go wrong trying it anyway.

    Thinking about it, since they added 100 or so attacks the attack table should be different, so I guess it's not surprising that they repointed to change the offset. I found the thread where I got the ups patch for the 1400 from here. Further down the post they have ini file data for the mods, and I found that the offset for Attacks is now 0x900000. I also tried with that one, which unfortunately didn't work. The results are also below.

    Spoiler:
    My moment of greatest hope was when only one byte was off and I just had to change a 01 to 00. Unfortunately it did not work; shame.

    Likely I'll have to do some scripty nonsense to get this to work. Would you mind pointing me to some tutorials that might help?

    First you'll want to get your hands on battle script pro. I haven't always had the best luck with it, but as far as I know it is the only option.

    https://www.pokecommunity.com/showthread.php?t=298933

    Here's a tutorial on it.

    What I recommend you do first is open a Clean Rom in BSP and go to script 101. Then open the new rom in BSP and open its version of script 101 and then compare the two and see if anything is different.

    By the way, the table is 0x250C04 only deals with the data for the moves themselves.
     
    Last edited:
    22
    Posts
    15
    Years
    • Seen Sep 15, 2021
    First you'll want to get your hands on battle script pro. I haven't always had the best luck with it, but as far as I know it is the only option.

    https://www.pokecommunity.com/showthread.php?t=298933

    Here's a tutorial on it.

    What I recommend you do first is open a Clean Rom in BSP and go to script 101. Then open the new rom in BSP and open its version of script 101 and then compare the two and see if anything is different.

    By the way, the table is 0x250C04 only deals with the data for the moves themselves.
    Hey, thanks for the lead!

    Unfortunately, as far as I can tell that tool and help for it has been discontinued. I opened a vanilla FR rom and tried to decompile effect 101 as well as FALSE SWIPE slightly lower (seems to just be an easier interface for it) but unfortunately it just gives me an error about the SQL database missing. After googling it, I found someone in that thread listing the same error as me, but they were given a solution. Turns out you need to go to Help > Update Database and that's supposed to do something that will
    allow you to decompile. Unfortunately when I try to update the database it just says "Could not update file. Restore backup..." and never actually does anything. I can do this as many times as I wish, and nothing happens. Actually all online/update functions seem to just fail, so I'm going to go out on a limb and say that this tool has been discontinued and therefore I will not be able to use it for anything whatsoever. In fact, to even get this tool I had to do some googling and find a different upload because the original is gone.

    In summary: it looks like that tool is no longer useful to anyone who did not already build a database; any other ideas?
     
    22
    Posts
    15
    Years
    • Seen Sep 15, 2021
    All right; I'm not sure exactly how to work this, but I've sidestepped the issue entirely. Instead of using the buggy 1040 base I'm back to using MrDollSteaks Decap and Attack Rombase 1.5a. The only reason I stopped using that in the first place was that it broke the DayCare, but after finding a manual hex editing fix for that even the DayCare works. This eliminates the only reason I wasn't using that base, so I went back to it. Even after a week or so of screwing with it and adding various other things, False Swipe is still working as intended. My apologies to anyone from the future looking through this for a fix, but unfortunately I was never able to find one. Thanks for all the help anyway!
     
    476
    Posts
    6
    Years
    • Seen Feb 26, 2020
    All right; I'm not sure exactly how to work this, but I've sidestepped the issue entirely. Instead of using the buggy 1040 base I'm back to using MrDollSteaks Decap and Attack Rombase 1.5a. The only reason I stopped using that in the first place was that it broke the DayCare, but after finding a manual hex editing fix for that even the DayCare works. This eliminates the only reason I wasn't using that base, so I went back to it. Even after a week or so of screwing with it and adding various other things, False Swipe is still working as intended. My apologies to anyone from the future looking through this for a fix, but unfortunately I was never able to find one. Thanks for all the help anyway!

    There's an alternative base that you can find on here for FR that is literally just MRDS's base but without all the bugs.
     
    Last edited:
    Back
    Top