The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Battle Restoring a Vanilla Move's Data

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old July 4th, 2018 (5:52 PM).
bluedart's Avatar
bluedart bluedart is offline
 
Join Date: Aug 2008
Gender: Male
Nature: Serious
Posts: 21
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.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old July 4th, 2018 (9:52 PM).
BirdstarCat13 BirdstarCat13 is offline
 
Join Date: Nov 2017
Gender: Male
Posts: 476
Just use one of the tools lol. Go to "move effect" and look through the list until you find the effect you want
__________________
-------------------------
I hate signatures that are just a line of text without any clear division. You weirdos know who you are ;)
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old July 5th, 2018 (1:21 AM).
bluedart's Avatar
bluedart bluedart is offline
 
Join Date: Aug 2008
Gender: Male
Nature: Serious
Posts: 21
Quote:
Originally Posted by BirdstarCat13 View Post
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.
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old July 5th, 2018 (7:42 AM).
BirdstarCat13 BirdstarCat13 is offline
 
Join Date: Nov 2017
Gender: Male
Posts: 476
Quote:
Originally Posted by bluedart View Post
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.
__________________
-------------------------
I hate signatures that are just a line of text without any clear division. You weirdos know who you are ;)
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old July 5th, 2018 (1:04 PM).
bluedart's Avatar
bluedart bluedart is offline
 
Join Date: Aug 2008
Gender: Male
Nature: Serious
Posts: 21
Quote:
Originally Posted by BirdstarCat13 View Post
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.
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old July 5th, 2018 (9:36 PM). Edited July 5th, 2018 by AkameTheBulbasaur.
AkameTheBulbasaur's Avatar
AkameTheBulbasaur AkameTheBulbasaur is offline
Akame Marukawa of Iyotono
 
Join Date: May 2013
Location: A place :D
Age: 25
Gender: Male
Nature: Docile
Posts: 408
Quote:
Originally Posted by bluedart View Post
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.
__________________
"The human sacrificed himself, to save the Pokemon. I pitted them against each other, but not until they set aside their differences did I see the true power they all share deep inside. I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are." -Mewtwo
Reply With Quote
  #7   Link to this post, but load the entire thread.  
Old July 6th, 2018 (11:44 AM).
bluedart's Avatar
bluedart bluedart is offline
 
Join Date: Aug 2008
Gender: Male
Nature: Serious
Posts: 21
Quote:
Originally Posted by AkameTheBulbasaur View Post
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?
Reply With Quote
  #8   Link to this post, but load the entire thread.  
Old July 6th, 2018 (5:21 PM).
BirdstarCat13 BirdstarCat13 is offline
 
Join Date: Nov 2017
Gender: Male
Posts: 476
Quote:
Originally Posted by bluedart View Post
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.
__________________
-------------------------
I hate signatures that are just a line of text without any clear division. You weirdos know who you are ;)
Reply With Quote
  #9   Link to this post, but load the entire thread.  
Old July 6th, 2018 (6:34 PM).
AkameTheBulbasaur's Avatar
AkameTheBulbasaur AkameTheBulbasaur is offline
Akame Marukawa of Iyotono
 
Join Date: May 2013
Location: A place :D
Age: 25
Gender: Male
Nature: Docile
Posts: 408
Quote:
Originally Posted by bluedart View Post
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.
__________________
"The human sacrificed himself, to save the Pokemon. I pitted them against each other, but not until they set aside their differences did I see the true power they all share deep inside. I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are." -Mewtwo
Reply With Quote
  #10   Link to this post, but load the entire thread.  
Old July 7th, 2018 (1:20 PM).
bluedart's Avatar
bluedart bluedart is offline
 
Join Date: Aug 2008
Gender: Male
Nature: Serious
Posts: 21
Quote:
Originally Posted by AkameTheBulbasaur View Post
... 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:
Code:
Attack Table:
0x250C04

False Swipe
206 0x0CE

Effect 101 0x65

12 bytes each

False Swipe Attack ID
0x250C04 + 0x9A8 = 0x2515AC

Orig: 65 28 00 64 28 00 00 00 33 00 00 00
Mod : FF FF FF FF FF FF FF FF FF FF FF FF

False Swipe Effect ID
0x250C04 + 0x4BC = 0x2510C0

Orig: 57 01 07 64 0F 00 00 00 32 00 00 00
Mod : FF FF FF FF FF FF FF FF FF FF FF FF


AttackData=900000

False Swipe Attack ID
0x900000 + 0x948 = 0x900948

Orig: 65 28 00 64 28 00 00 00 33 00 00 00
Mod : 1D 19 04 5A 0A 00 00 00 32 00 00 00

False Swipe Effect ID
0x900000 + 0x4BC = 0x9004BC

Orig: 57 01 07 64 0F 00 00 00 32 00 00 00
Mod : 57 01 07 64 0F 00 00 00 32 00 01 00

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?
Reply With Quote
  #11   Link to this post, but load the entire thread.  
Old July 7th, 2018 (5:36 PM). Edited July 7th, 2018 by AkameTheBulbasaur.
AkameTheBulbasaur's Avatar
AkameTheBulbasaur AkameTheBulbasaur is offline
Akame Marukawa of Iyotono
 
Join Date: May 2013
Location: A place :D
Age: 25
Gender: Male
Nature: Docile
Posts: 408
Quote:
Originally Posted by bluedart View Post
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:
Code:
Attack Table:
0x250C04

False Swipe
206 0x0CE

Effect 101 0x65

12 bytes each

False Swipe Attack ID
0x250C04 + 0x9A8 = 0x2515AC

Orig: 65 28 00 64 28 00 00 00 33 00 00 00
Mod : FF FF FF FF FF FF FF FF FF FF FF FF

False Swipe Effect ID
0x250C04 + 0x4BC = 0x2510C0

Orig: 57 01 07 64 0F 00 00 00 32 00 00 00
Mod : FF FF FF FF FF FF FF FF FF FF FF FF


AttackData=900000

False Swipe Attack ID
0x900000 + 0x948 = 0x900948

Orig: 65 28 00 64 28 00 00 00 33 00 00 00
Mod : 1D 19 04 5A 0A 00 00 00 32 00 00 00

False Swipe Effect ID
0x900000 + 0x4BC = 0x9004BC

Orig: 57 01 07 64 0F 00 00 00 32 00 00 00
Mod : 57 01 07 64 0F 00 00 00 32 00 01 00

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.
__________________
"The human sacrificed himself, to save the Pokemon. I pitted them against each other, but not until they set aside their differences did I see the true power they all share deep inside. I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are." -Mewtwo
Reply With Quote
  #12   Link to this post, but load the entire thread.  
Old July 7th, 2018 (9:49 PM).
bluedart's Avatar
bluedart bluedart is offline
 
Join Date: Aug 2008
Gender: Male
Nature: Serious
Posts: 21
Quote:
Originally Posted by AkameTheBulbasaur View Post
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?
Reply With Quote
  #13   Link to this post, but load the entire thread.  
Old July 14th, 2018 (5:34 PM).
bluedart's Avatar
bluedart bluedart is offline
 
Join Date: Aug 2008
Gender: Male
Nature: Serious
Posts: 21
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!
Reply With Quote
  #14   Link to this post, but load the entire thread.  
Old July 15th, 2018 (12:13 AM). Edited July 15th, 2018 by BirdstarCat13.
BirdstarCat13 BirdstarCat13 is offline
 
Join Date: Nov 2017
Gender: Male
Posts: 476
Quote:
Originally Posted by bluedart View Post
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.
__________________
-------------------------
I hate signatures that are just a line of text without any clear division. You weirdos know who you are ;)
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 9:13 AM.