Changes

Jump to navigation Jump to search
257 bytes added ,  18:05, 22 January 2021
no edit summary
Line 5: Line 5:  
= Setup =
 
= Setup =
 
== Debugging console ==
 
== Debugging console ==
Before you do anything, you should enable the in-game debugging console by binding the console key at the bottom of the key binding menu in the options window. This will help you debug your mod by giving you error messages and enabling the '''RELOAD_DLL_MOD''' and '''UNLOAD_DLL_MOD''' commands.
+
Before you do anything, you should enable the in-game debugging console by binding the console key at the bottom of the key binding menu in the options window. This will help you debug your mod by giving you error messages and enabling the '''RECOMPILE_DLL_MOD''', '''RELOAD_DLL_MOD''' and '''UNLOAD_DLL_MOD''' commands.
    
== Project setup ==
 
== Project setup ==
Line 50: Line 50:  
== Compile ==
 
== Compile ==
 
When you're done, you can either compile your mod and place it in the game's folder, in a subfolder called "DLLMods", or create a new subfolder in the "DLLMods" folder and put your .cs files in that subfolder, and the game will compile them for you. Note that if you let the game compile the C# files for you, you are limited to C# version 3, but '''using the game's compiler is required if you want to upload your mod to the Steam Workshop'''.
 
When you're done, you can either compile your mod and place it in the game's folder, in a subfolder called "DLLMods", or create a new subfolder in the "DLLMods" folder and put your .cs files in that subfolder, and the game will compile them for you. Note that if you let the game compile the C# files for you, you are limited to C# version 3, but '''using the game's compiler is required if you want to upload your mod to the Steam Workshop'''.
 +
 +
If you let the game compile your .cs files, note that it will inject error handling code into each function body, you can disable this behaviour while you are developing your mod using the launch paramater '''-DisableModErrors'''.
    
'''Please note that due to a bug in the compiler the game uses, you cannot use enums if you are using straight .cs files or the game will crash'''
 
'''Please note that due to a bug in the compiler the game uses, you cannot use enums if you are using straight .cs files or the game will crash'''

Navigation menu