The Scripts panel
Watch and control the running game's scripts from the Studio, check them, generate neo.d.ts and neo.pyi, and use the matching commands.
On this page
The Scripts panel shows every script the running game is executing and lets you edit, reload, pause and unload them while the game runs. It also runs Check, which compiles your scripts, validates the [script] manifest and writes the type declarations your editor uses.
Open it from Project ▾ ▸ Scripts…. Esc, Close or a click outside closes it. It works the same in the browser Studio and on the desktop.
What the panel shows#
The header line shows the simulation tick, the world's script hash chain and how many scripts are running, for example tick 1200 · hash chain 3fa2… · 1 running.
Running#
One row per running script:
| Shown | Meaning |
|---|---|
| Name | The script, for example assets/scripts/twist.js. |
| Who it runs as | The creator (your game's own scripts), or a player and their roles. |
| State | Running or paused. |
| Fuel | fuel <used> / <budget> per tick (<percent>%): how much of its per-tick budget it used last tick. |
| Faults | How many times it has faulted, and the last fault's first line in red. |
| State hash | A hash of the script's state, which shows whether two runs agree. |
Each row has Edit, Reload, Pause or Resume, and Unload.
Script files (not running)#
Script files in the project's assets/scripts/ (.js and .py) that aren't running, each with Edit and Load.
Log#
Log (loads, reloads, moderation) lists every load, reload, refusal and moderation action.
If the game has no scripting, the panel says how to turn it on: the game needs the script plugin and a [script] section in neo.toml. Projects made from the GASP template have scripting on.
The controls#
| Button | What it does |
|---|---|
| Edit | Opens the script in Source mode. Saving it there hot-reloads it in the running game and keeps its this.state. |
| Reload | Reloads the script from its file. |
| Pause / Resume | Stops running the script's handlers, and starts them again. |
| Unload | Removes the script from the running game. |
| Load | Starts a script file that isn't running. |
| Check | Compiles and validates everything (below). |
| Live reload: on / off | Turns hot reload on save on or off. |
Hot reload on save is on by default. The Live reload: on button in the panel's header turns it off (it then reads Live reload: off), as does editor.scripts.live_reload {on}.
Check#
Check is the panel's test runner. It:
- compiles every script file in
assets/scripts/; - validates the
[script]section ofneo.tomlagainst the kinds and fields the game exposes; - writes the generated declarations next to your scripts:
assets/scripts/neo.d.tsfor JavaScript andassets/scripts/neo.pyifor Python; - runs the game's own script tests, if it has any.
The result shows at the top of the panel, green when everything passed and red with the problems when something didn't. The declaration files describe exactly what your scripts may touch (the kinds, fields and methods your manifest grants), so the code editor can check and complete your code against them. Run Check again after you change the manifest.
Commands#
Everything in the panel is also a command, so agents and tests can do the same:
| Command | What it does |
|---|---|
editor.scripts.panel {open} | Shows or hides the panel. |
editor.scripts.files | The project's script files and whether each is running. |
editor.scripts.edit {name} | Opens a script in Source mode. |
editor.scripts.check | Runs Check and returns its report. |
editor.scripts.live_reload {on} | Turns hot reload on save on or off. |
script.list | The running scripts, their fuel, faults and hashes, the hash chain and the log. |
script.load {name, source, ...} | Loads or hot-reloads a script. |
script.pause, script.resume, script.unload {name} | Pause, resume and unload a script. |
script.types {format} | The generated declarations, as ts, py, md or json. |
script.api | The creator's script API as JSON. |
The script.* commands and their options are covered in Script commands.