2 items

File information

Last updated

Original upload

Created by

The Basemod Team

Uploaded by

mario1star

Virus scan

Safe to use

Documentation

Readme

View as plain text

1. Create a C# class library project using Visual Studio. The project's name must end with "MOD". (Thus, the name of the dll file you produce must end with "MOD" as well.)
2. Take a good look at the dll files in Lobotomy Corp's "Managed" folder and study them.
3. Write a code using class names and function names that the mod can detect. (Refer to "where_to_add.txt")

* Important things to note when naming classes and functions
- All classes, functions, and variables must be declared as 'public'.
- All called classes must inherit MonoBehavior.
- All calling functions must include the base function's superclass as a parameter.
- If the base function is 'static', do not treat the class as a parameter.
- If the base function is 'void', make a 'bool' function; if the base function has a 'return' value, make a 'object[]{value to return, bool}' function.
ex) To add or overwrite the function "void OnClick(AgentModel)" to the class "CommandWindow":
public A_CommandWindow {
public bool OnClick(CommandWindow, AgentModel){
//Code to add
return bool;
}
}
ex) To add or overwrite the function 'static string GetPercentText(float)' to the class 'UICommonTextConverter':
public A_UICommonTextConverter{
public object[] GetPercentText(float){
//code to add
return new object[]{return value, bool};
}
}

- If the return bool value of a mod's calling function is 'true', it completely overwrites (including other mods); if the value is 'false', it simply adds (loaded before the default codes)
- In an 'object[]{return value, bool}' function, if the bool is 'true', the return value acts as the return value of the base function; if the bool is 'false', then the return value is discarded.

* Note: A static function that lacks a parameter receives int(0) as a calling function parameter.

4. Build the code, and place the produced dll file in the "Managed" folder.
5. Test to see the mod works.
6. Complain to the author of BaseMod if it fails.