-
-
Notifications
You must be signed in to change notification settings - Fork 55
Mod class structure
piotrulos edited this page Apr 7, 2023
·
2 revisions
MSCLoader 1.2+ has new optional mod class structure, that is less likely to crash when references are missing. (It's much simpler on backend)
public class MyMod1 : Mod
{
public override string ID => "MyMod1"; //Your mod ID (unique)
public override string Name => "Testing"; //You mod name
public override string Author => "someone"; //Your Username
public override string Version => "1.0"; //Version
public override string Description => "This is test mod..."; //Short description of your mod
public override void ModSetup()
{
SetupFunction(Setup.OnLoad, Mod_OnLoad);
}
private void Mod_OnLoad()
{
// Called once, when mod is loading after game is fully loaded
}
}
Info
new override ModSetup()
that eliminates use of all old overrides and LoadInMenu
bool override
inside ModSetup()
you can setup any function(s) you want with custom names.
Example above setups OnLoad
with custon name Mod_OnLoad()
See all possible Setup options here
Before 1.2 update all fuctions was overrides
public class MyMod1 : Mod
{
public override string ID => "MyMod1"; //Your mod ID (unique)
public override string Name => "Testing"; //You mod name
public override string Author => "someone"; //Your Username
public override string Version => "1.0"; //Version
public override bool UseAssetsFolder => false;
public override bool LoadInMenu => false; //Enables OnMenuLoad() override
public override void OnLoad()
{
// Called once, when mod is loading after game is fully loaded
}
}
- How to install MSCLoader using MSCPatcher
- MSCPatcher explained
- How to install mods
- Official experimental linux support
- Unofficial tutorial for linux (wine/proton)
- Install Visual Studio for MSCLoader
- Install template for Visual Studio
- How to use templates
- Debugging your mods in Visual Studio
- Enable DevMode to help with debugging
- Uploading and creating Self update feature for your mod or reference
- All Playmaker Global Variables and Events
- How to create and use Asset Bundles