Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =============================================
- Introduction
- =============================================
- There are Action Replay codes available for Black 2 and White 2 that can do the following:
- * On any step, a "phenomenon" (https://bulbapedia.bulbagarden.net/wiki/Phenomenon), i.e. a rustling grass patch, ripping water, dust cloud or a shadow on a bridge will spawn near the player if possible.
- * After any step, a Hidden Grotto will generate a new Pokémon or item.
- * Hidden Grottoes will always generate a Pokémon instead of an item.
- This is a guide for how to bake these into the game directly.
- =============================================
- Before Starting
- =============================================
- You will need to get the overlay_0036.bin (or whatever it's called on your file explorer) out of the Black 2 or White 2 ROM and decompress it.
- For this tutorial, we'll be using blz to decompress and recompress the file. (This assumes Windows, you may need a different (de)compression method on other platforms!)
- Please also note that the content of the overlay differs somewhat between the two games, i.e. you can't edit just the Black 2 one and insert it into both games. You'll need the base from the version you intend to insert this into.
- blz can be obtained from the Google Drive link you get by using !startguide in the Kingdom of DS Hacking server.
- It's located in Hacking Tools -> Both -> NDS Compressers -> Nintendo_DS_Compressors_v1.4-CUE.zip. We want the blz.exe file inside this.
- To decompress the overlay_0036.bin, put both it and blz.exe in the same folder, open a terminal window focusing on that folder (you can right-click in the folder and open a terminal there), then type this command and press enter:
- .\blz.exe -d .\overlay_0036.bin
- (Or replace .\overlay_0036.bin with .\<your filename> if it differs)
- That should say it's decoding and then say Done shortly after. If the overlay_0036 file transformed from about 251 KB to 345 KB, that means it's been successfully decompressed.
- =============================================
- Spawn a Phenomenon on Every Step
- =============================================
- Apply these changes if you want a rustling grass patch, ripping water, dust cloud or a shadow on a bridge to spawn near the player when possible on any step they do.
- Please note that this still follows the rules of the normal game, which means:
- - You won't see any of these phenomena until you've received the first badge.
- - Only one of these phenomena can be active on the map at a time.
- These offsets are for both Black 2 and White 2's overlay_0036.
- 0x22B2A: 1D D0 -> C0 46
- 0x22B45: D3 -> E0
- =============================================
- Instant Hidden Grotto Regeneration
- =============================================
- Apply these changes if you want Hidden Grottoes to generate a new Pokémon or item immediately when the player takes a step outside a Hidden Grotto.
- Under normal circumstances, a Hidden Grotto has a 5% chance every 256 steps to generate something new, so this really speeds up the process.
- However, a Hidden Grotto cannot respawn unless it's already empty - any Pokémon must be defeated/caught/run away from, and any visible item or hidden item must be picked up first.
- You can also stack this with the Pokémon spawn change below so a new Pokémon will spawn in a Grotto immediately.
- These offsets are for both Black 2 and White 2's overlay_0036.
- 0x02F06: 19 D1 -> C0 46
- 0x02F2A: 04 D2 -> C0 46
- =============================================
- Hidden Grottoes Can Only Spawn Pokémon
- =============================================
- Apply this change if you want Hidden Grottoes to only be able to spawn a Pokémon, and never spawn a visible item or hidden item.
- Under normal circumstances, a Hidden Grotto chooses to spawn an item 80% of the time (40% visible, 40% hidden), so this can really speed up hunting for Hidden Ability Pokémon that are otherwise unavailable in B2W2.
- You can also stack this with the Pokémon spawn change above so a new Pokémon will spawn in a Grotto immediately.
- For Black 2, apply this change:
- 0x49660: 64 20 3C F6 71 FD 40 1C 00 06 -> 03 20 3C F6 71 FD 04 1C 13 E0
- For White 2, apply this change:
- 0x49658: 64 20 3C F6 55 FD 40 1C 00 06 -> 03 20 3C F6 55 FD 04 1C 13 E0
- =============================================
- Recompressing the Overlay
- =============================================
- After you've finished with any of the changes you want to make, you need to then recompress the overlay_0036.bin file.
- You can do this in the same way we decompressed it, except now it'll be with this command:
- .\blz.exe -en .\overlay_0036.bin
- (Or replace .\overlay_0036.bin with .\<your filename> if it differs)
- If the overlay_0036.bin file changed from 345 KB to about ~251 KB, then it's been compressed correctly.
- =============================================
- Editing the arm9/overlay Table
- =============================================
- After these changes, there's a good chance that your compressed overlay is a few bytes larger or smaller than it was before.
- If this is the case, the game needs to be adjusted so it knows the new size, else the game won't boot after you reinsert the edited overlay_0036.bin.
- First we need to find the new size of your compressed overlay_0036.bin after the changes.
- On Windows, you can do this by just checking the properties of the item and seeing the "Size" result (NOT the "size on disk").
- If you've applied all three changes, it should say something like:
- 250 KB (256,352 bytes) for Black 2's overlay36
- 250 KB (256,312 bytes) for White 2's overlay36
- But this may differ a bit depending on what has and what hasn't been implemented.
- Anyway, the number of bytes is what we want here. We then want to convert that to little endian hex, so:
- 256,352 = 0x03E960 -> 60 E9 03
- 256,312 = 0x03E938 -> 38 E9 03
- After that, we need to then go into the file where these file lengths are stored.
- This file can show up as a few different names, such as y9.bin, arm9ovltable.bin or overarm9.bin depending on what tool you're using.
- It should be around ~11KB.
- If using ndstool, it'll likely be found at the same location as the arm9.bin with whatever name you gave it.
- If using Tinke, it should be at the bottom of the "ftc" folder listed as y9.bin.
- If using crystaltile2, you should see it near the top of the file explorer list as arm9ovltable.bin.
- I'll call it the y9.bin from now on for explanation purposes.
- Export that y9.bin file for your version of the game (it differs between B2 and W2).
- Inside it, go to offset 0x49C. This is where the file size for the compressed overlay_36 is listed.
- If you haven't edited it previously, you should see "58 E9 03 03" here on Black 2 and "30 E9 03 03" on White 2.
- At this point we just change the first three bytes so it matches the amount of bytes we looked at above.
- So *using our example* (use bytes that correspond to YOUR overlay_0036's file size!!), we'd change the Black 2 y9.bin to say "60 E9 03" instead of "58 E9 03" at 0x49C, and the White 2 y.bin to say "38 E9 03" instead of "30 E9 03" at 0x49C.
- After that, that's all the changes we have to do!
- =============================================
- Finishing Up
- =============================================
- After doing the above, reinsert your compressed overlay_0036.bin and the edited y9.bin file into your Black 2 or White 2 ROM.
- After packing/building your ROM (whatever is necessary after file changes in your case), try and boot up the game. If it gets past the Continue screen to show the season and then the overworld, your changes have likely worked.
- If you just get a black screen, you may want to double check that you edited the y9.bin file correctly, as if you give it the wrong file size for your overlay_0036.bin the game just crashes when it tries to load (even on DeSmuME!).
- You should then see the effects you've implemented in the game. Remember that:
- - You can't get any phenomena before the first badge!
- - You need to empty a Hidden Grotto before it can regenerate (this can include a hidden item, so make sure you check first!).
- =============================================
- Credits
- =============================================
- Thanks to MrCheeze's tutorial on adding battle music per Trainer class in B2W2 for the info about needing to edit the y9.bin after editing an overlay.
- https://projectpokemon.org/home/forums/topic/36863-b2w2-mod-different-battle-music-for-each-trainer-class/
- Thanks to whoever made the following AR codes whose instructions were used so that we could apply these changes to the game directly.
- I've got no idea who made them originally but I believe they were originally found on GBAtemp!
- Instant Shaking Grass/Water Ripple/Dust Cloud/Shadow Spot:
- ---
- - Hold 'L' for an instant Shaking Grass/Water Ripple/Dust Cloud/Shadow Spot!
- Black 2:
- 521A2124 F9A2F000
- 121A212A 0000D01D
- 121A2144 0000D304
- 94000130 FDFF0000
- 121A212A 000046C0
- 121A2144 0000E004
- D2000000 00000000
- White 2:
- 521A2164 F9A2F000
- 121A216A 0000D01D
- 121A2184 0000D304
- 94000130 FDFF0000
- 121A216A 000046C0
- 121A2184 0000E004
- D2000000 00000000
- Hidden Grotto Instant Respawn
- ---
- Black 2:
- 52182524 F910F683
- 12182506 000046C0
- 1218252A 000046C0
- D2000000 00000000
- White 2:
- 52182564 F8F0F683
- 12182546 000046C0
- 1218256A 000046C0
- D2000000 00000000
- Hidden Grottoes Always Spawn Pokémon
- ---
- Black 2:
- 521C7C60 1C309000
- 521C8C60 F63C2064
- 121C8C68 0000E013
- 121C8C66 00001C04
- 121C8C60 00002003
- D2000000 00000000
- White 2:
- 521C7C98 1C309000
- 521C8C98 F63C2064
- 121C8CA0 0000E013
- 121C8C9E 00001C04
- 121C8C98 00002003
- D2000000 00000000
Advertisement
Add Comment
Please, Sign In to add comment