Adding Features Outside of Lethe

This section is for more advanced modding stuff that cannot be done with Lethe alone, for example adding a new SkillAbility script. These things would require you to make your own BepInEx mod, and this thread briefly documents our methods for decompiling the game and making a BepInEx mod.

Note: This section requires basic coding knowledge, primarily C#.

Template

The version of BepInEx we use is 6.x #577, which is an older version of BepInEx, but it's the last version of BepInEx that doesn't crash on MacOS/Whisky. We have a template of a BepInEx 6.x #577 mod here that you can use to base your mod of:

https://github.com/LEAGUE-OF-NINE/BasePlugin/

Reverse Engineering

To actually find out what methods you're supposed to hook into, you can check out the mono build of the game from launch. Do note, the launch code is completely outdated, but it is good enough as a reference to understand the game's code structure. You can use any conventional C# decompiler like dnSpy to view the game's (Assembly-CSharp.dll). You can download it here.

To decompile the most recent version of the game, I recommend you use cpp2il to decompile the assembly, I used these flags to decompile it:

cpp2il --experimental-enable-il-to-assembly-please \
  --throw-safety-out-the-window \
  --analysis-level 0 \
  --parallel \
  --run-analysis-for-assembly "Assembly-CSharp" \
  --game-path "/home/carra/.steam/steam/steamapps/common/Limbus Company/"

It will generate a bunch of assembly dump and pseudocode into cpp2il_out/types/Assembly-CSharp/method_dumps/. You can try to make sense of what's happening in the method dumps, and you can also use dnSpy to view the generated .dll files to figure out what's happening. Do note, this often fails to be coherent for complicated methods.

Unity Explorer

As a general debug tool, Unity Explorer is very useful. It allows you to inject harmony hooks while the game is running and provides GUI for a REPL and also inspecting the content of objects. Make sure you downloaded the BIE 6.X IL2CPP (NOT CoreCLR) version.

Tips

  • Do note that because Limbus is in il2cpp there are some quirks that makes modding the game very annoying. You can check out the MelonLoader note on this. While MelonLoader and BepInEx are different mod loaders, a lof of the same tips still apply.
  • Adding custom passives or skill abilities is currently done in a very weird way because the game crashes when you try to inject a new class for them. You can use dnSpy to decompile the Lethe mod to see how we implemented them.