Pokemon Sun and Moon Randomizer Help

Discussion in '3DS - Homebrew Development and Emulators' started by PKMWM1, Jan 11, 2017.

  1. PKMWM1
    OP

    PKMWM1 Member

    Newcomer
    33
    1
    Sep 6, 2015
    United States
    I've been wanting to create a Sun and Moon randomizer for fun and also to be able to modify some trainers teams. Ie elite four have level 70s and 80s instead of 60s. However, I can't seem to acquire the necessary files in order to start doing this. I have a CFW 3ds with A9LH and Luma as well as homebrew with HANS. However, I don't know how to go about extracting the romfs and exefs for Pokemon Sun or Moon and get them into PK3ds. I am in 11.2 and Decrypt9, Hourglass9 and braindump all have problems.

    Braindump never seems to work with sun or moon at all. It always goes to a red or black screen and just freezes there.

    Hourglass9 and Decrypt9 seem to yield a .3ds file or .cia if I request it. However, these aren't the files I want. the files that I need are decrypted exefs and romfs and I don't know how to make either program generate those files. Plus, after modifying them, I don't know how to implement them with luna (as Hans functionality seems to be inconsistent). I have the cartridge versions of both of them if that helps. Any help would be greatly appreciated.
     
  2. RustInPeace

    RustInPeace Samurai Cop

    Member
    3,381
    2,637
    Oct 13, 2014
    United States
  3. PKMWM1
    OP

    PKMWM1 Member

    Newcomer
    33
    1
    Sep 6, 2015
    United States
    I finished trying it and it eventually just throws me an error during the extraction and I'm only left with the following files:
    DecryptedPartition0
    DecryptedPartition1
    DecryptedPartition6
    DecryptedPartition7
    HeaderNCCH

    None of these give me a RomFs, exefs and the code.bin that everyone keeps requiring and that is apparently easy to compile. What am I doing wrong?
     
  4. KunoichiZ

    KunoichiZ GBAtemp Guru

    Member
    8,536
    3,600
    Mar 16, 2012
    United States
    Make sure the .3DS/.CIA is decrypted otherwise HackingToolkit3DS won't extract all that it needs to. Re-decrypt the file. You're better off using a decrypted CIA.
     
  5. PKMWM1
    OP

    PKMWM1 Member

    Newcomer
    33
    1
    Sep 6, 2015
    United States
    I thought I did this. I had the Pokemon Moon Cartridge inserted, loaded up Decrypt9, Went to cart dump options, clicked on Dump and Decrypt (trim). Let it finish, then I went to the Options and attempted to re-decrypt it twice and it said that it succeeded. Then I tried to exract it and it gave me these errors and an incomplete extraction. I'm currently trying a Dump and Decrypt (full) which is being dumped rght now, but I don't know how to tell or know if a file is encrypted.
     
  6. RustInPeace

    RustInPeace Samurai Cop

    Member
    3,381
    2,637
    Oct 13, 2014
    United States
    You're supposed to use dump and decrypt (full), the output file will have "dec" or "decrypted" on it, indicating that it's a decrypted dump. I used dump and decrypt cia, same end result.
     
  7. PKMWM1
    OP

    PKMWM1 Member

    Newcomer
    33
    1
    Sep 6, 2015
    United States
    Will it also work with a decrypted .3ds file or will it only work on .cia files?
     
  8. RustInPeace

    RustInPeace Samurai Cop

    Member
    3,381
    2,637
    Oct 13, 2014
    United States
    Both.
     
  9. PKMWM1
    OP

    PKMWM1 Member

    Newcomer
    33
    1
    Sep 6, 2015
    United States
    So I've gone through the whole process of extracting the files, using PKK3DS to apply the desired changes, rebuilt a ROMFS, and named it "00175E00.romfs" and placed it in the HANS folder. But when I try to launch it with HANS, it simply kicks me back to the homebrew menu. I have A9LH, LUMA, Homebrew v2.8, and firmware 11.2. If I can't launch it with HANS, could someone explain how to do it with LUMA or another source
     
  10. KunoichiZ

    KunoichiZ GBAtemp Guru

    Member
    8,536
    3,600
    Mar 16, 2012
    United States
    More specifically, follow this post, but use the IPS patches that I attached instead of the ones in this post, since these files work with Sun & Moon v1.1.

    1. Once you have patched the code.bin file with the IPS patches above, rename it to the title ID of Sun/Moon.
    2. Go to your luma folder and make a folder called code_sections in that folder. In the code_sections folder, place your .bin file.
    3. On the root of your SD card, make a folder called saltysd. Inside of that folder, make a folder called SunMoon. Place your randomized files in SunMoon.
    4. Open your luma settings and make sure that Enable region/language emu. and ext. .code is enabled.
    5. Launch Sun/Moon to see if the changes have been made.
     

    Attached Files:

    Last edited by KunoichiZ, Jan 11, 2017
  11. RustInPeace

    RustInPeace Samurai Cop

    Member
    3,381
    2,637
    Oct 13, 2014
    United States
    Make the directory luma/titles/"titleid"/ where "titleid" is that of the game, in your case 0004000000175E00, rename the romfs to "romfs.romfs" and it should work. I did the SaltySD way because it's simply copy/pasting edited files and their directories into a designated saltysd directory.

    Edit: ninja'd by a better explanation.
     
  12. PKMWM1
    OP

    PKMWM1 Member

    Newcomer
    33
    1
    Sep 6, 2015
    United States
    What do you mean by "randomized files"? Do you mean that a simple romfs will suffice, if so what do I need to name and place it? If not, what types of files should I copy over?
     
  13. KunoichiZ

    KunoichiZ GBAtemp Guru

    Member
    8,536
    3,600
    Mar 16, 2012
    United States
    The files that the randomizer made. Put them in saltysd/SunMoon. Follow the same folder structure as the romfs.
     
  14. PKMWM1
    OP

    PKMWM1 Member

    Newcomer
    33
    1
    Sep 6, 2015
    United States
    What romfs structure? That was never told to me. Also, there are literally hundreds of files in the Pokemon Moon extraction that Pk3ds loaded. Do I have to copy over absolutely everything that was extracted, only the contents of the ExtractedROMFS folder? I don' t understand exactly what files are needed or where exactly to put them or name the directory. Also, once I do figure that out and I'm ready to start playing, how do I actually apply it on the 3ds?

    I tried to just copy over all the code from the ExtractedROMFS directory. But when I tried to launch the game, it just lead to an endless "Nintendo 3ds" loading screen and now I can't play Pokemon Moon at all/
     
    Last edited by PKMWM1, Jan 11, 2017
  15. KunoichiZ

    KunoichiZ GBAtemp Guru

    Member
    8,536
    3,600
    Mar 16, 2012
    United States
    Open the ExtractedRomFS folder. That's the romfs structure I was talking about. Follow that same structure in saltysd/SunMoon. If any of the files were touched by the randomizer, place them in the SunMoon folder, following the romfs folder structure.

    1. Make sure that you have the latest version of Luma3DS (v6.6)
    2. Open your Luma3DS configuration and make sure that "Enable region/language emulation and ext. .code" is enabled.
    3. Make sure you have patched the code.bin from the 1.1 update and placed it in luma/code_sections/<title ID of Sun/Moon>.bin.
    4. Make sure you have the romfs in saltysd/SunMoon.
    5. Start your game and see if any changes were made.
     
  16. PKMWM1
    OP

    PKMWM1 Member

    Newcomer
    33
    1
    Sep 6, 2015
    United States
    Do I need both the romfs.romfs file AND all the contents of the extractedRomFS folder? Its just not clear. I can't tell exactly what files were touched by the randomizer. When I copied the contents of the extractedROMFS folder to the SumMoon folder ,when I launch the game it just leads to an endless ""Nintendo 3ds loading screen and now I can't play Pokemon Moon at all. I don't know what I'm doing wrong.
     
  17. KunoichiZ

    KunoichiZ GBAtemp Guru

    Member
    8,536
    3,600
    Mar 16, 2012
    United States
    No you do not need the romfs.romfs file. Did you patch the code.bin file from the update? It sounds like you didn't.

    Follow this to get the update as a decrypted CIA and to get the code.bin file from the update. It will be found in the ExtractedExeFS. Patch it with the IPS Patches I gave you earlier.

    I'm not sure how the randomizer even works with game updates like this or if it even works with the update.
     
  18. PKMWM1
    OP

    PKMWM1 Member

    Newcomer
    33
    1
    Sep 6, 2015
    United States
    So I have to dump the Pokemon Moon update v1.1 instead of the cartridge and edit all those files all over again?! Could I just try to delete the update and run the base game?
     
  19. KunoichiZ

    KunoichiZ GBAtemp Guru

    Member
    8,536
    3,600
    Mar 16, 2012
    United States
    You have to to get the code.bin. You could use the base game but you won't be able to use the online features.
     
  20. PKMWM1
    OP

    PKMWM1 Member

    Newcomer
    33
    1
    Sep 6, 2015
    United States
    Ok so I can keep all my modified romfs files but should build then dump a decrypted .cia file and then use its code.bin, patch it with the tools you gave me, then place that patched code.bin in the code_sections and the copied contents of the ExtractedRomfs are in place, which is the G:\saltysd\SunMoon\(Extracted RomFS contents) then I have the luma settings which enable custom code and then I can launch the game it it should work? I just finished extracting the new code.bin file. Should I name the patched file after the Pokemon Moons title key (0004000000175e00) or the update's title key (0004000e00175e00)?

    Also Thank you so much for sticking with me for this long. I really appreciate it.

    — Posts automatically merged - Please don't double post! —

    I did everything but it just gives a grey screen upon launch at it still doesn't work.