Hollow Knight Modding generally requires changing the game's code using an assembly editor such as dnSpy. While this works, it means that each time the game releases a new version, all mods had to be recoded by hand. The Hollow Knight API aims to remove this requirement by exposing hooks to perform most needed operations without having to rewrite decompiled code.
We use the MonoMod patcher to greatly reduce the effort in patching the assembly. Go check it out! https://github.com/0x0ade/MonoMod
Building the API is fairly straightforward.
- Clone this!
- Go to one of the directories listed below and copy it's contents to the
Vanilla
folder in this repository. (Create the Vanilla folder if it does not exist.)
- Windows:
%HollowKnightGameInstallPath%/hollow_knight_Data/Managed/
- Linux:
~/.steam/steam/steamapps/common/Hollow Knight/hollow_knight_Data/Managed/
- Mac:
~/Library/Application Support/Steam/steamapps/common/Hollow Knight/hollow_knight.app/hollow_knight_Data/Managed/
- Open the solution in Visual Studio 2017 or Rider (You can also just use msbuild/xbuild)
- Set the build configuration to Debug.
- The patched assembly should be in
RepoPath/OutputFinal/hollow_knight_Data/Managed/
(There is also a zip file inRepoPath/ModdingAPI.zip
ready to upload to Google Drive) - Copy
Assembly-CSharp.dll
to%HollowKnightGameInstallPath%/hollow_knight_Data/Managed/
To run msbuild:
- Navigate to the root of the project
- Run
msbuild -p:Configuration=Debug /restore
Disclaimer: The post build command failed for me mono PrePatcher.exe Assembly-CSharp.dll Assembly-CSharp-patched.dll
Instead I manually ran wine PrePatcher.exe Assembly-CSharp.dll Assembly-CSharp-patched.dll
, which worked then reran the msbuild command and everything worked
Original Authors:
MyEyes / Firzen
Seanpr
Contributors:
iamwyza
esipode
Kerr1291
5FiftySix6
natis1
Ayugradow
KayDeeTee