Skip to content

Mod

The Mod library contains wrapper methods for querying mod-related information.

The GUIDS table contains the GUIDs of various notable mods.

ModLib Class

Inherits from Library.

Methods

Get
function ModLib.Get()
   -> Module

Returns a mod by its guid.

GetCurrentContext
function ModLib.GetCurrentContext()
   -> "Client"|"Server"

Returns the context the caller script is running in.

GetLoadOrder
function ModLib.GetLoadOrder()
   -> Module[]

Returns a list of the currently loaded mods.

GetOverhaul
function ModLib.GetOverhaul()
   -> Module? -- `nil` if no overhaul is being played.

Returns the game overhaul being played.

In the case of there being multiple active, default behaviour is to return the first one loaded. The hook is fired afterwards and its module may be non-nil.

See the GAME_OVERHAULS table for extending.

GetStoryVersion
function ModLib.GetStoryVersion(guid)
   -> integer?, integer?, integer?, integer? -- Major, minor, revision, build version. Fails if the mod is not loaded.

Returns the story version of a mod.

@param guid GUID

IsLoaded
function ModLib.IsLoaded(guid)

Returns whether a mod is loaded.

@param guid GUID