Click or drag to resize
spaar.ModLoader Namespace
Most APIs of the mod loader are located in spaar.ModLoader. This includes everything except GUI related things.
Classes
  ClassDescription
Public classCode exampleCommands
Commands is used for all things regarding commands. Mainly, you can register your own commands and help messages here.
Public classConfiguration
Utility class to store configuration values for your mod. This is a basic Key-Value store and supports only strings as keys and strings, ints, floats, doubles and bools as values. This class also provides the setConfigValue command to users. Configuration is stored in Mods/Config/<modname>.json.
Public classConfigurationEventArgs
EventArgs for the OnConfigurationChange event.
Public classGame
Provides convenient access to various parts of the game that are often needed by mods.
Public classKey
Public classKeybindings
Class that allows mods to register keybindings. They can be changed by the user in the keymapper window and are automatically saved and loaded again.
Public classMachineData
Allows mods to add data to machine save files.
Public classMod
Main entry point for mods. Should be implemented by exactly one class per mod.
Public classModConsole
Provides methods for interacting with the in-game console.
Public classOptionsMenu
OptionsMenu contains methods for adding an option (toggle button) to the options menu in the main menu of Besiege.
Public classSettingsMenu
SettingsMenu contains methods for adding a setting (toggle button) to the settings drop-down of Besiege.
Public classSingleInstanceT
Singleton for MonoBehaviours. Creates a game object for your component if no instance is found.
Public classTemplateAttribute
Use this to mark a class extending Mod as a template for other people to extend. This will cause the class to not be loaded as a mod and allows you to have more than one implementation of Mod.
Public classUtil
A collection of useful utility functions.
Public classZone
Represents a zone, which is an in-game level.
Delegates
  DelegateDescription
Public delegateCommandCallback
Delegate to use with registering commands.
Public delegateMachineDataLoadCallback
Called when a machine is loaded with the value that was loaded from the save file.

Please note you also have to handle the case that a save file that was created without your mod installed is loaded. In this case, a value of NOTFOUND will be passed.

Public delegateMachineDataSaveCallback
Called when the machine is saved to retrieve the value to be saved.
Public delegateOnKeymapperOpen
Handler delegate for Game.OnKeymapperOpen
Public delegateOnLevelWon
Handler delegate for Game.OnLevelWon
Public delegateOnSimulationToggle
Handler delegate for Game.OnSimulationToggle
Public delegateOptionsToggle
Callback delegate for an option toggle.
Public delegateSettingsToggle
Callback delegate for a toggle setting.
Enumerations
  EnumerationDescription
Public enumerationBlockType
All block types in the game. These values can be used as indices to AddPiece.blockTypes.
Public enumerationIsland
Represents an in-game island. The sandbox is counted as a seperate island.
Public enumerationPrefab
All block prefabs in the game. These values can be used as indices to MachineObjectTracker.AllPrefabs.