Advertisement
DrayHackTutorials

[PtHGSS] Set Hidden Power's Base Power to a Fixed Value

Sep 19th, 2021 (edited)
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.83 KB | None | 0 0
  1. ================================================
  2. Set Hidden Power's Base Power to a Fixed Value
  3. ================================================
  4. Thanks to BluRose for the method and research and XLuma for some additional research. Write-up by Drayano.
  5.  
  6. =============================
  7. Short Explanation
  8. =============================
  9. 1) Get overlay_0016 (Pt) or a decompressed overlay_12 (HGSS).
  10. 2) In that file, go to 0xA9F4 (Pt) or 0xAC1C (HGSS).
  11. 3) Change "1E 30" to "3C 20" - this means Hidden Power will always be at base 60 power in battle calculations.
  12. 3a) If you want a different value, replace the '3C' with your base power of choice in hexadecimal, up to a max of 255 or FF.
  13. 4) Reinsert the modified overlay file into your game (recompress too if HGSS).
  14. 5) Edit Hidden Power's move data so the base power matches what you've set it to. That way it'll show the right number instead of "---" in the Pokémon summary screens.
  15.  
  16. =============================
  17. Full Explanation
  18. =============================
  19.  
  20. INTRODUCTION
  21. This short tutorial explains how to fix the base power of Hidden Power in place in Platinum or Heart Gold/Soul Silver.
  22.  
  23. In Gen 6 and beyond, Hidden Power has a fixed base 60 power. However, in the earlier generations, the power could range between 30 to 70, with the result depending on the IVs of the Pokémon using it.
  24. The power (and type) are calculated in a function that is called by a move script (a couple instructions that fire off for a particular move effect, including the damage and critical check parts).
  25. As this overwrites the normal base power that gets stored in memory, simply changing the base power in the move data won't be enough to get it actually working.
  26. But removing the function from the move script means the type won't change from Normal, so we need to edit the function that determines the type and power directly.
  27.  
  28. METHOD
  29. Inside the game code lies a function that calculates the base power and type of Hidden Power when a Pokémon uses it in battle.
  30. For the base power, the game calculates a number based off the Pokémon's IVs, and then adds a flat +30 to it to get the final base power.
  31. This is done with an ASM instruction that adds +30 to whatever number is in the register that's used to store the base power.
  32. Thanks to that, we can simply modify a couple bytes to change the instruction to instead set the register to a specific value, instead of adding +30 to it. The power calculation still happens, but the value will be *overwritten* with the base power we want.
  33.  
  34. WHAT FILE DO WE EDIT?
  35. For Platinum, the bytes we want to change are contained in the overlay_0016 file.
  36. For Heart Gold and Soul Silver, the bytes we want to change are contained in the overlay_0012 file. Please note that you need to decompress this file first using blz or crystaltile2 (blz recommended, available in the !startguide on the Kingdom of DS Hacking).
  37.  
  38. WHAT LOCATION IN THE FILE?
  39. For Platinum, you want to go to the offset 0xA9F4 in the overlay_0016 file. You should see the bytes "1E 30".
  40. For Heart Gold and Soul Silver, you want to go to the offset 0xAC1C in the decompressed overlay_0012 file. You should see the bytes "1E 30".
  41.  
  42. WHAT DO WE DO?
  43. The 1E 30 here is an instruction that adds +30 to a value in memory. Note that the '30' is the ADD part, and the '1E' is what will be added to the value - 0x1E is 30 in decimal.
  44. By changing the '30' to a '20', this instead becomes a MOV instruction, i.e. put this value in this place in memory.
  45. Then we can just pick what base power we want. Let's say 60 like the newer games, in which case instead of 0x1E, we want the hexadecimal for 60 which is 0x3C.
  46.  
  47. Therefore the method is simply replacing the "1E 30" with "3C 20". After doing that and reinserting the file into your game (remember to recompress if using HG/SS!), Hidden Power will now always be base 60 power!
  48. If you want to set it to a different base power, replace the '3C' with whatever value you like. As it's a single byte, you can do anywhere from 0 base power (0x0) to 255 base power (0xFF).
  49.  
  50. ANYTHING ELSE?
  51. Although this will fix the base power in battle, it won't actually show the base power value when viewing the move in a Pokémon's summary screen; by default it will still say "---".
  52.  
  53. To fix that, we need to edit the power parameter of Hidden Power in the game's move data (pl_waza_tbl.narc for Platinum, or the a/0/1/1 file for HG/SS). If you're using Pokéditor then you can set it in the move spreadsheet there, or alternatively you can use a hex editor.
  54.  
  55. For the hex editor option, assuming that your Hidden Power is still ID 237 as in the original (it probably is):
  56. 1) Open up the relevant move data NARC in a hex editor.
  57. 2) Go to offset 0x1DBF.
  58. 3) Change the 01 value here (the game shows --- instead when a move is set as 1 BP) to 3C.
  59. 4) Save and rebuild. It should now show as 60 ingame.
  60.  
  61. That's all there is to it!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement