Editor setup
On this page
Thematic scripts (abilities, prefabs, guns, gun effects, HUDs, formations and programs) get autocompletion, hover documentation and type checks from thematic.d.ts, the script API of the
exact installed version.
Quick start#
- In game, as an operator (or in singleplayer):
/thematic pack export-types <pack>, where<pack>is a folder in<gameDir>/thematic/packs(or<gameDir>/resourcepacks). With no name it writes into<gameDir>/thematic/editor-types. - Open the pack folder in VS Code (File > Open Folder). Nothing else to install: plain JavaScript IntelliSense reads the
jsconfig.jsonfiles. - Run the command again after updating Thematic so the typings match the version.
A pack made with /thematic pack new already has a jsconfig.json pointing at ../../docs/thematic.d.ts, which works
as long as the pack stays in thematic/packs. Use the command when the pack lives elsewhere (a git checkout, a zip you
unpack) or when you want the typings to travel with it.
What is written#
| file | what |
|---|---|
typings/thematic.d.ts | the script API, copied from the jar (never generated at runtime, so it is exactly the version you run) |
jsconfig.json | type-checks data/*/abilities, ability_prefabs, guns, gun_effects and huds |
data/<ns>/formations/jsconfig.json, data/<ns>/programs/..., ... | one project per script family that exists in the pack, not type-checked. They declare same-named top-level functions (main, tick) that would collide in one project |
AGENTS.md | a primer for AI agents: where the typings and docs are. Written only when the pack has none |
README.md | one line pointing at the command (added once) |
A jsconfig.json you wrote yourself (one that does not mention thematic.d.ts) is left alone; the command says so. Add
typings/thematic.d.ts to its include.
What you get#
component(/gun(/hud(and every builder method with its documentation and typed options,use("thematic:armed", ...)for every shipped prefab, and the closed sets (events, visuals, target selections) as string unions.- Errors for a misspelt method or option while you type (ability family only; run
/thematic pack validatefor the rest). - In formation and program scripts, annotate callbacks to get completion:
ProgramScripts.Drone,FormationScripts.
Reference: docs/script-api.json is the same API as data; docs/addon-format.md has a section per content kind.