Click or drag to resize
Mod Class
Main entry point for mods. Should be implemented by exactly one class per mod.
Inheritance Hierarchy
SystemObject
  spaar.ModLoaderMod

Namespace: spaar.ModLoader
Assembly: SpaarModLoader (in SpaarModLoader.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public abstract class Mod

The Mod type exposes the following members.

Constructors
  NameDescription
Protected methodMod
Initializes a new instance of the Mod class
Top
Properties
  NameDescription
Public propertyAuthor
Author of the mod. If there are serveral author, seperate them with commas.
Public propertyBesiegeVersion
The version of Besiege the mod is targeted at.

Versions follow the format used by the game itself, 'vMajor.Minor'. If this is not equal to the currently running game version, a warning will be printed, however the mod will still be loaded.

Default is the version the running mod loader is targeted at. Please only use this default if you are reasonably sure that a Besiege update will not break your mod!

Public propertyCanBeUnloaded
Whether the mod can be unloaded without a restart. Only set this to true if your mod undoes all its changes to the game in OnUnload(). Defaults to false since many mods are not able to do this by default.
Public propertyDisplayName
Display name of the mod.

Can contain any symbols and be changed freely. This is the name that's presented to users.

Public propertyName
Name of the mod.

Should be alphanumeric and all lowercase. If the name consists of multiple words, seperate them with hyphens, like 'my-mod'.

This name should not change once a mod was published. It should also be unique among all published mod as it is used for identification by the mod loader.

Public propertyPreload
Whether the mod should be loaded before all mods where this is set to false. This is useful for mods that provide an API to other mods but need to be initialized before users of the API.
Public propertyVersion
Current version of the mod. Any versioning scheme can be used, as long as it can be expressed in a Version object.
Public propertyCode exampleVersionExtra
An additional text part of your version. If it is overriden, it will be appended to Version when a version is printed, with a '-' in between.
Top
Methods
  NameDescription
Public methodOnLoad
Called when your mod is loaded. You can perform any initialization here, such as creating game objects to control your mod.
Public methodOnUnload
Called when your mod is unloaded. This occurs in two cases: The user unloads the mod or the game exits. Perform any clean-up work you need to here, such as saving configuration and reverting modifications to the game. If your mod is capable of reverting its changes at runtime, also set CanBeUnloaded to true to indicate that the mod can be unloaded by the user at runtime.
Public methodToString (Overrides ObjectToString.)
Top
See Also