These packages return a module value when required. Some use OpenMW clocks or context APIs after loading, but they are still consumed as ordinary module dependencies.
Choose by job
| Need | Packages |
|---|---|
| Model state or coordinate plain-Lua work | class, lazy, memoize, pool, result, signal, StateMachine |
| Poll time or spread work across updates | Budget, Debounce, oscillator, Timing Helpers |
| Normalize, hash, pair, or randomize data | normalizePath, randomGen, szudzik, tableHash |
| Inspect context, log, or evaluate gameplay state | isHostile, isOpenMW, LogMessage, ScriptContext, spellUtil |
| Build or inspect UI interaction | DragEvents, uiSnapshot, UI Components |
Constructor-style modules use capitalized exports such as Signal, Pool, and StateMachine; function and value modules generally use camelCase exports such as memoize, randomGen, and normalizePath. The public scripts.s3 module paths remain the stable entry points.
Budget
Spread measured work across frames using a wall-clock execution budget.
class
Define small plain-Lua classes with explicit single inheritance.
Debounce
Emit the latest value after a quiet interval, with caller-driven polling.
DragEvents
Add direct drag and resize behavior to menu and player UI layouts.
isHostile
Test whether an actor meets the engine's aggression threshold for a target.
isOpenMW
Detect whether the OpenMW Lua runtime is available.
lazy
Compute one value on demand and reuse it until explicitly reset.
LogMessage
Print diagnostic messages from local, player, global, and load scripts.
memoize
Cache function results with explicit key, expiry, and retention controls.
normalizePath
Normalize path spelling without resolving files or validating containment.
oscillator
Sample a smooth periodic value from real or simulation time.
Pool
Reuse short-lived objects with explicit ownership and release rules.
randomGen
Generate fast, independent pseudo-random values without consuming OpenMW's protected random stream.
Result
Represent success and failure explicitly without unchecked nil conventions.
ScriptContext
Identify the OpenMW script context in code shared across script types.
Signal
Synchronous listeners with priorities, explicit disconnection, and borrowed payloads.
spellUtil
Reuse OpenMW-derived spell, enchantment, potion, and casting calculations from Lua.
StateMachine
Represent named runtime states with explicit callbacks and transition timing.
szudzik
Map signed integer coordinate pairs to one integer key and recover them later.
tableHash
Derive a compact content hash for simple, acyclic Lua tables.
uiSnapshot
Capture deterministic, bounded text snapshots of OpenMW UI layouts.