mod.GetRegisteredMod

Name

mod.GetRegisteredMod – get the Lua table provided by another mod

Synopsis

M = mod.GetRegisteredMod(mod_name)

M = mod.GetRegisteredMod(mod_name, min_version)

Description

This returns the namespace table of the given mod, or nil if either:

Version strings are compared in the expected way, e.g. "1.9" is considered less than "1.10", and "2.2" is less than "2.2.1".

A mod that registered without a version is considered to have no version, and will fail any min_version check.

Errors

Errors are raised if argument 1 is not a string, or if min_version is provided but is not a valid version string. (Valid version strings consist of numeric digits separated by dots.)

Notes

min_version is useful for basic version checking, but if you want something more specific (e.g. accepting only a particular version, or a particular range of versions) then you can call mod.GetModVersion and inspect the returned version string directly.

require can be used if you want to throw an error when the other mod is not present.

See Also

mod.GetAllMods

mod.GetModVersion

mod.IsModRegistered

mod.RegisterMod

require