Making a mod - theLeaxx/JaLoader GitHub Wiki
Introduction
So you've decided you want to make your own mod? Great decision! This guide will help you get started with modding using JaLoader.
Installation
Firstly, make sure you have JaLoader installed to test your mod while coding it. Follow the installation steps here or here.
Setting Up Your Project
Regardless of whether you're using Visual Studio, Rider, or any other IDE, you have two ways of creating your project:
1. Using Provided Templates
- Install templates from here.
- Create a new project in Visual Studio or Rider based on these templates.
2. Creating the Project
- If you're using the templates, create a new project based on the
JaLoader Mod Templatetemplate - If not using the templates, create a new empty project based on
Class Library (.NET Framework)for Visual Studio or.NET Framework - Class Libraryfor Rider. - Make sure to use .NET Framework 3.5!
Managing References
If you opted not to use the provided templates or your game is not installed in the default C:\Program Files (x86)\Steam\steamapps\common\Jalopy, you will need to manually add references to your project and include specific namespaces in your code. Follow these steps:
For Visual Studio
- Find the Solution Explorer and right-click on "References" then click on "Add Reference"
- Click on "Browse", then navigate to your Jalopy installation, then go into Jalopy_Data, and then finally in Managed
- Hold CTRL and select
JaLoader.dll,Assembly-CSharp.dll,Theraot.Core.dll,UnityEngine.CoreModule.dllto begin with, then click Add and then OK
For Rider
- Find the Explorer, right-click on an empty space or on "Dependencies", then click on "Reference"
- Click on "Add From...", then navigate to your Jalopy installation, then go into Jalopy_Data, and then finally in Managed
- Hold CTRL and select
JaLoader.dll,Assembly-CSharp.dll,Monomod.Backports.dll,UnityEngine.CoreModule.dllto begin with, then click Open.
Code primer & namespace inclusions
If you used the template, these steps are unnecessary. Otherwise, you will need to write the code below and also add the following namespaces:
using JaLoader;
using System.Collections.Generic;
using UnityEngine;
Final steps
You'll now need to:
- fill in all the required variables (ModID, ModName, ModAuthor, ModVersion (ModDescription & GitHubLink are optional))
- adjust WhenToInit, Dependencies and UseAssets to your specific use-case and you're done!