๐Ÿ˜Basic Mod

Basic Mod is exactly class BasicMod. If you want these features, you should make your mod main class inherit from BasicMod instead of MonoBehaviour and IMod.

Mod Loading

BasicMod is different with IMod in modder's layer. BasicMod implements OnLoad in IMod, and call OnModLoad to initialize mod. You should implement OnModLoad in BasicMod instead of OnLoad.

Multilingual

BasicMod loads files under folder Locales automatically. cz.json is Simplified Chinese, en.json is English, ch.json is Tranditional Chinese.

The following is an example of localization for Simplified Chinese in JSON format.

// cz.json
{
    "Humans": "ไบบ็ฑป",
    "Orcs": "ๅ…ฝไบบ"
}

Except of .json file, you can also use .csv to make localization.

The following is an example lang.csv

key,cz,en,ch
Humans,ไบบ็ฑป,Humans,ไบบ้กž
Orcs,ๅ…ฝไบบ,Orcs,็ธไบบ

File name for .csv is not important.

Mod Configuration

BasicMod provides default mod configuration file(default_config.json under mod's folder) and consistent user's mod configuration.

You can write default_config.json refer to Mod Configuration

Default mod configuration file

It provides format of mod configuration and default values for them.

When add/remove configuration item(excluding modifying default value)

Consistent user's mod configuration will add/remove corresponding items with new default values.

Last updated