How to create a DLL mod with Humankind Mod Tool - Printable Version +- GAMECHANGE (https://gc2021.com) +-- Forum: Humankind Mod Tool (https://gc2021.com/forumdisplay.php?fid=1) +--- Forum: Humankind Mod Tool Tutorials (https://gc2021.com/forumdisplay.php?fid=3) +--- Thread: How to create a DLL mod with Humankind Mod Tool (/showthread.php?tid=13) |
How to create a DLL mod with Humankind Mod Tool - _A_ - 08-24-2021 This tutorial goes over how to create a shareable DLL mod for Humankind. You will need: 1. Humankind installed 2. BepInEx installed 3. Humankind Mod Tool installed with your game path configured. (Tutorial) 4. A C# editor. Visual Studio Code or Visual Studio is recommended. You can also use a text editor and the command line dotnet compiler. 1. Start HMT. 2. Click the "Create" tab. 3. If you haven't done so already, click Decompile Game Scripts. This will create a Visual Studio solution with all of the game dlls decompiled. You can use this as a reference to know what you want to change and see how the original code worked. 4. Click "Create New Project". It will create a C# project that references the game DLLs (from the references folder of Documents/Humankind Mod Tool) as well as BepInEx and Harmony which are needed to create mods. 5. If you have installed Visual Studio Code and set it up in your settings, click "Open" on your project in the project list. Otherwise, you will need to open the .csproj file manually with a C# editor of your choice. 6. Once you have opened your project, fill in the information about your mod in the BepInPlugin attribute in the generated C# file. 7. Using the decompiled source code, find a part that you want to change and copy it into the class generated for you. Depending on what you are replacing, the next steps may differ. Using Harmony patches, alter whichever part of the game that you wish. 8. Once you are done making your modifications, compile your project. If you are using VS Code, a build task is included in your project. The output path should already be set to go to your Humankind/BepInEx/plugins folder. 9. Your mod should now show on the "Manage" tab of HMT. Make sure that it is enabled, and test in game. Example code below: Code: using Amplitude.Mercury.Simulation; |