Script Mods โ
Script mods are class libraries written in C# and loaded into game by BepInEx loader. To make a script mod, you'd need the follow tools:
Code Editor/IDE โ
Pick your poison and make sure you have .NET development package installed for Visual Studio families.
Decompiler โ
To modify game code, you'd need to know what to modify first. You'll want a .NET decompiler to browse the game source code.
No, do not solely rely on your IDE's auto decompiling, use an actual decompiler from the following:
If you are using dnSpyEx, don't forget to turn off metadata tokens and RVA display, you won't need those info.
Simply open the Elin/Elin_Data/Managed/Elin.dll
in the decompiler and load its dependencies, now you can freely browse game source code, search for constants, and analyze usages.
C# Project โ
If you are already familiar with C# and bepinex modding/Unity, you can skip to Debugging.
Basic Plugin โ
We are making a BepInEx plugin, so it's all the same stuff. Create file MyElinMod.cs
at the project root:
using BepInEx;
using HarmonyLib;
namespace MyMod;
internal static class ModInfo
{
internal const string Guid = "dk.elinplugins.myelinmod";
internal const string Name = "My Elin Mod";
internal const string Version = "1.0";
}
[BepInPlugin(ModInfo.Guid, ModInfo.Name, ModInfo.Version)]
internal class MyElinMod : BaseUnityPlugin
{
private void Awake()
{
Logger.LogInfo("My mod...loaded?!")
}
}
Here we chose the same Guid as mod ID in package.xml
. This needs to be an unique identifier for your mod, so make it very unique.
After building the project and launching the game, you should see the message in the log output, either via BepInEx console or Player.log
at %localappdata%low\Lafrontier\Elin\Player.log
.
Enable BepInEx Console
Open the BepInEx config file at Elin\BepInEx\config\BepInEx.cfg
and change the following:
[Logging.Console]
## Enables showing a console for log output.
# Setting type: Boolean
# Default value: false
Enabled = true