Skip to main content

Built-in modules in WOS

This page is manually transcribed. Report any outdated info in issues!

coordinates

Used to create the coordinates class.

  • Coordinate: {UniverseCoordinates: Vector2, SolarCoordinates: Vector2, InPlanet: boolean, ...}
  • CoordinateBounds: {Vector2, Vector2, Vector2, Vector2}

Methods

  • new(number UniverseCoordinatesX, number UniverseCoordinatesY, number SolarCoordinatesX, number SolarCoordinatesY, boolean inPlanet) → Coordinate
  • fromVectors(Vector2 UniverseCoordinates, Vector2 SolarCoordinates, boolean inPlanet) → Coordinate
  • withBounds(CoordinateBounds CoordinateBounds, number UniverseCoordinatesX, number UniverseCoordinatesY, number SolarCoordinatesX, number SolarCoordinatesY, boolean inPlanet) → Coordinate
  • fromString(string CoordinateString, CoordinateBounds CoordinateBounds) → Coordinate

Values

  • CoordinateBounds DEFAULT_COORDINATE_BOUNDS: The universe's coordinate bounds.
  • CoordinateBounds NO_COORDINATE_BOUNDS: No bounds. Unlimited.

Example usage

local Hyperdrive = GetPart("HyperDrive")
local Coordinates = require("coordinates")
Hyperdrive.Coordinates = Coordinates.fromVectors(
Vector2.new(1, 1), -- sector coords
Vector2.new(1, 1), -- planet coords
false -- inside planet?
)

fs

Returns a table of all modules exposed to the WOS environment.

nature2d

Nature2D module. Learn more about it here

octree

Octree module. Learn more about it here

partdata

This module returns a table of components & parts. TBD

players

This module is used to convert roblox usernames to userids and the other way around.

Methods

  • :GetUsername(number userid) → string username
  • :GetUserId(string username) → number userid

promise

Promise module. Learn more about it here

repr

This module returns a function which when passed to it, it prints the table with formatting.

local repr = require("repr")
print(repr({"hi"})) -- {"hi"}

signal

Signal module. Learn more about it here

symbol

This module returns a function which converts a string to a symbol (internally a UserData)

local symbol = require("symbol")
print(symbol("MySignal")) -- Symbol<MySignal>

tableUtil

tableUtil module. Learn more about it here

trove

trove module. Learn more about it here

sift

sift module. Learn more about it here

tween

This module is used to tween values.

Methods

  • :GetValue(number Alpha, Enum.EasingStyle EasingStyle, Enum.EasingDirection EasingDirection) → number

ar_input

This modules types are currently too vague and hence documentation will not be written until I write better types for it. TBD.