Libraries
The standard library#
TrigScript comes with nine modules written for programs, imported as
"trigscript/<name>". The TrigScript library guide has a page
for each, with an example and everything it holds.
| Module | What it is for |
|---|---|
trigscript/math |
Easing, distances, angles, and Vec |
trigscript/random |
chance, range, pick, weighted, shuffle, and a seeded Random |
trigscript/timers |
every, after, Cooldown, Countdown, Stopwatch, and loops spread over frames |
trigscript/signals |
Signal, events of your own |
trigscript/ui |
Meters, panels, menus and dialogs in the text area |
trigscript/cutscene |
A camera, units walking to their marks, portraits speaking |
trigscript/fog |
Pictures and videos drawn in the fog of war |
trigscript/screen |
A grid of pixels on the map and the minimap |
trigscript/music |
Instruments, patterns and songs |
fog, screen and cutscene each take one of the map's first 63 locations that the map
does not use, with reserveLocation(why). A script of your own can call it too: the
location is chosen when the script is built, and the reason shows with the map's
requirements.
Libraries from other plugins#
A plugin can provide a library of its own, which a script imports by the library's name:
import { spawnWave } from "waves". The map keeps a copy of each library it imports, so
it still builds where the plugin is missing or at another version. See Libraries from
other plugins.