Getting Started

Note

See Installing Custom Content for details on code mod pathing.

Offical code mod examples are available here: https://github.com/bigsnake09/ExamplesNG

Library vs raw CS files

Code mods can be provided as either pre compiled libraries or by creating cs files in your code mods folder. The ingame C# compiler uses .NET 3.5 so it’s reccomended you create pre compile libraries as you’ll have access to the latest C# features with .Net 4.6.

Setup a development environment

Install Visual Studio

  • Download the Visual Studio Community Installer: https://visualstudio.microsoft.com/

  • Run the installer and make sure you tick .NET Desktop Development and Game development with Unity

  • Let Visual Studio install and then open it

Create Visual Studio Project

With Visual Studio installed and opened we can now create a project:

  • Navigate to File -> New -> Project

  • On the left hand side make sure you have Visual C# selected

  • In the middle make sure Class Library (.NET Framework) is selected

  • At the bottom make sure Framework is set to .NET Framework 4.6

  • Set your projects location and name and then click OK

Build/Install Code Mod

To build your code mod all you need to do is right click the project from the Solution Explorer and then click Build. This will output a DLL to the bin/Debug where the project is located.

To install the code mod, create a new folder in your BallisticNG/User/Mods/Code Mods folder with the same name as the DLL file and then copy the DLL into that folder. To update your mod, just replace the DLL file in that folder (make sure the game isn’t running when you do).