Manual:Debugging

There are two effective ways to debug mods, either by using Lua print statements or by converting a release build of to a debug build.

Print to Console
Printing to console can assist with debugging, as printing will output to a log file. In Windows, it's located at. For UNIX-like OSs, the log file is located at.

dnSpy
was developed in Unity Engine version 2018.4.15, which is composed of .NET assemblies. By using a .NET debugger such as dnSpy, one can debug and edit assemblies.

By replacing certain game files with existing files, Unity will change the game's meta functionality. Unity games requires all overwritten files to have a matching version number. There is two ways to add debugger support for more comprehensive debugging. One is through debugging a release build and the second is converting a build to a debug build.

Known Limitations
As of v6.0.4, dnSpy cannot directly step into C# closures, or lambda functions. Locals are still inspectable.

Release Builds
Replacing  with a patched that allows for debugging support allows .NET debuggers to hook into the game.

Note that as of 6/13/2020, 0xd4d has not added the .dll to the repository's release page. A community-provided .dll is temporarily available here, in the patched folder.

After the .dll file is replaced, dnSpy can read the game's memory by navigating to, connecting to localhost and setting the port to 55555.

Debug Build Conversion
Backing up the game is heavily recommended.

A release build of Unity games can be converted to a development build by replacing certain files contained from their Unity Editor of their respective version.

Note that step over support is broken and requires the patched file in in the section prior. Additionally, all console prints will be displayed in-game with a development build.

Instructions

 * In, rename   to.
 * Copy,   and   to the  directory.
 * Copy all files in  into.
 * In, append the following line of text:

After booting up, a notice in the bottom-right-hand corner will appear saying 'Development Build', stating that the patch was successful. Open OSFE.exe with dnSpy, and hook into the debug build with.