Ads keep us online. Without them, we wouldn't exist. We don't have
paywalls or sell mods - we never will. But every month we have large bills
and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3
This tutorial assumes you have intermediate knowledge of installing software and navigating common computer tasks, as well as navigating your hard drive. To be blunt, if these prerequisite skills are out of reach then perhaps using unreleased software is a bit irresponsible. Also, I of course do not take responsibility for any issues or damage to any of your equipment.
Also, right click images and open them in a new window to see them larger.
Step 1: Installing Visual Studio 2019 Do you know how to run an installer? Good. Do that.
Go to this page and download Visual Studio Community 2019. Not Visual Studio Code. When installing just go through the process like normal. If asked, all you need to install is this package:
Everything else can be left as default.
Step 2: Cloning the source code
Open Visual Studio 2019 and click on "Clone or check out code" on the right-hand side.
Enter this URL: https://github.com/kwsch/pkNX Keep all of the other options default, just click "Clone."
Step 3: Compiling the source code All of PPorg's software is dead-simple to compile. After the GitHub repo is finished being cloned by VS 2019, you will see a window similar to this:
On the right-hand side of the screen, right-click on "pkNX.sln"
Step 4: Finding your binary Depending on how fast your computer is, it will take a certain amount of time for the binary file to compile. When it is done, the bottom of the VS 2019 window will tell you "Build Succeeded" and also tell you where the actual .exe is.
Assuming that you kept all other options as default, the steps below will help you find it. Hit the Win+R keys on your keyboard to open the "Run" prompt. In it, type Source like so:
In Windows Explorer, open repos, then pkNX, then pkNX.WinForms, then bin, then Debug.
This is your pkNX binary. These files need to be kept together. You can move them wherever you want on your hard drive, but they need to be together.
Step 5: Setting up your game files for pkNX Obtain your Pokémon Sword or Shield romfs. Dump it yourself. Obtaining it is not in the scope of this guide.
When you have your romfs, you must structure them in a very specific way for pkNX to accept it. This is the best way to do it, using Sword as an example:
Have a top-level folder named Pokemon [Game]
Inside of that folder you put your clean, unedited romfs. In the same directory as the romfs folder, you need to have an exefs folder. It can be completely empty, but it needs to be there.
Step 6: Using pkNX Open your brand-new pkNX.exe and drag your top-level Pokemon Sword folder onto the window. It will load it in.
Using all of the actual elements of the tool is a bit complicated and outside of the scope of this guide, but what you need to know is this: When you make your edits, the tool is keeping track of everything you changed. When you close pkNX, the software writes a file with the titleID of the game next to the romfs and exefs folders from step 5
This file gets loaded in with Atmosphere LayeredFS and is all you need to use your mod. You never need to actually edit the romfs folder.
When opening pkNX, if this Title ID folder exists, it will use it and display the modifications from it. If it does not, it will just base it off of the vanilla game and write a new folder.
Troubleshooting Some users are having issues regarding an error message to the effect of project.assets.json' not found and/or A numeric comparison was attempted on "$(MsBuildMajorVersion)" that evaluates to "" instead of a number, in condition "($(MsBuildMajorVersion) < 16)".
This seems to happen when building on Windows 10. I was able to reproduce this in a clean VM with no variables and was able to fix it. Here is a video tutorial on how to fix these two issues:
If you prefer a typed-out fix instead of watching and following a video, here is the old version: In VS 2019, go to View -> Other Windows -> Package Manager Console and enter dotnet build When that finishes, if you still receive the numeric comparison issue, then follow these steps:
1. In the right-hand side of VS 2019, double click the pkNX.sln file 2. Go to Tools -> NuGet Package Manager ->Manage NuGet Packages for this Solution 3. Under Installed, find Costura.Foddy and click on it. 4. On the right-hand side of the pane that appeared, select all of the pkNX choices and hit "uninstall" 5. Accept all of the resulting warnings and dialogue boxes 6. When it finishes, in the NuGet Package Manager, go to Browse and find Costura.Foddy 7. Do the same as step 4 but Install instead. Accept all of the warnings.
Nice!!! Now after applying the fix and proving everything works once and for all, I am happy to finally reward you the full points for writing up this tutorial! Keep it up! I look forward to your next project! :D
that solution indeed did fix the issue. i was wondering about it when the installed Costura.Foddy was at like v6.1 and what you reinstall is some 4.x, but it worked and will not complain. thank you very much for this.
when trying to build pknx i get this error code below. doing some searching i found several possible fixes for getting the issue resolved. all of which so far has not worked. only causes 1k+ more errors to come up.
Assets file ~\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
any suggestion on trying to get it fixed? judging by trying to research a fix, this seems to be a very very common occurrence with visual studios when building files.