This article is to give code of an Empty Mod in Visual Studio 2022.
Step 1 : Create an empty DLL project with latest .NET Framework (4.8).
Step 2: You need to add "references" to DLLs of the game that you use. Only few DLL are needed to get references & allow compilation to work.
--Directories should be like " F:\Going.Medieval.v0.14.23\Going Medieval_Data\Managed\Assembly-CSharp.dll" , then you need :
- AssemblyCSharp.dll
- UnityEngine & UnityEngine.CoreModule
- And DLLs from mod launcher & harmony with "F:\Going.Medieval.v0.14.23\Mods\GoingMedievalModLauncher.dll" :
- GoingMedievalModLauncher.dll
- 0harmony.dll (from Nuget Package, Lib.Harmony, reference should be automatic once package installed)
Screen of "References" when OK : https://prnt.sc/FEIq296NZT6k
Step 3 : Just create one C# file for your DLL. Here is the code :
- Pastebin link : https://pastebin.com/ujL84EER
Then you should be able to compile & run your MOD ! Well this code will just show mod running , and you can activate/desactivate it.
Everything is almost happening into "update" function.
With usage of References you ll get access to all Going Medival Unity Functions in intelliSense to help you coding :) You can also decompile & see sources of the game.
0 comments