Skip to main content

Root module

Import the root once with local traceless = require("traceless"). Signatures use [...] for optional arguments and ... for variadic values. number is a Lua number, integer is an integer-valued number, and none means no returned values. Unless stated otherwise, invalid required argument types raise a Lua error. Check each function's unavailable result: there is no single failure convention for every module.

Entity methods use entity:method(...); references and IDs are not interchangeable. Live entity methods revalidate the handle and normally return nil, reason for missing or stale objects. Returned tables and vectors are independent snapshots; their contents are editable in Lua but editing them does not update native state.

Namespacesโ€‹

The root table is shared by all active scripts. It contains vpk, console, notify, events, timer, engine, input, players, entities, schema, prediction, trace, weapons, render, materials, panorama, ui, storage, cvars, json, unsafe, and the vector and angle constructors. There are no compatibility globals for these custom namespaces.

vectorโ€‹

traceless.vector([x = 0 [, y = 0 [, z = 0]]])

Returns: Vector userdata.

Numeric components create an independent mutable vector. See vectors and angles.

angleโ€‹

traceless.angle([pitch = 0 [, yaw = 0 [, roll = 0]]])

Returns: Vector userdata.

This uses the same userdata and methods as vector; pitch, yaw, and roll are stored in x, y, and z. It is not a separate angle type.

Named archive assets use the VPK module.