Skip to content

Module: Version

albion edited this page Jun 6, 2025 · 2 revisions

Important

Documentation has moved to the docs. This wiki will no longer be updated, and may be deleted in the future.

local Version = require("Starlit/Version")

The Version module contains information and utilities relating to the current version of Starlit. This module should be used to ensure the correct version of Starlit is running if your mod depends on a recent feature.

Functions

Version.ensureVersion(major: integer, minor: integer, patch: integer) -> compatibility: "toolow"|"toohigh"|"compatible"

Checks that the current running version of Starlit is compatible with the specified version. If not, the player will receive a popup informing them of the required version, and directing them to the update page.

Returns either "toolow", "toohigh", or "compatible" for self-explanatory reasons.

TEMP: this should be delayed until at least OnGameStart, or the popup will not appear.


Version.compareVersion(build: integer, major: integer, minor: integer, patch: integer) -> compatibility: "toolow"|"toohigh"|"compatible"

Compares the current running version of Starlit to the specified version. Returns either "toolow", "toohigh", or "compatible" for self-explanatory reasons.

Fields

Version.VERSION_STRING: string

String name of the current version, e.g. 42-1.2.3


Version.BUILD: integer

The major game build the current version of Starlit is designed for, e.g. 42


Version.MAJOR: integer

The major version of Starlit. Major versions are incremented when non-trivial breaking changes are made to the API.


Version.MINOR: integer

The minor version of Starlit. Minor versions are incremented when new features are added, and old features may be deprecated.


Version.PATCH: integer

The patch version of Starlit. Patch versions are incremented by bug fixes that don't change (intended) functionality.

Clone this wiki locally