Mod class structure - piotrulos/MSCModLoader GitHub Wiki

MSCLoader 1.2+

[!IMPORTANT] In ModSetup() only SetupFunction() is allowed, this is designed to only setup Mod class. Do not execute other code inside ModSetup(), follow strictly Order of execution in mod class otherwise you will break other mods or even loader itself (DO NOT guess how stuff work, read documentation and ask questions if you don't know the answer)

MSCLoader 1.2+ has new 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 Game SupportedGames => Game.MySummerCar; //Supported Games
    
    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

MSCLoader before 1.2 update

[!WARNING] This format is obsolete and do not use it in new mods (it's only there for legacy purpose, if you want to know how to upgrade from old format)

Before 1.2 update all fuctions was overrides (do not use in versions 1.2+)

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
    }
}