Skip to content

Hot reload and assets

Development uses a generated folder directly inside the game’s Modules directory. The CLI watches the TypeScript project, builds into a private local directory, and synchronizes only after the whole build succeeds.

source save → type-check and compile → complete local build → game folder sync
error ────────────────────────────────┘ keeps previous game folder
Terminal window
npx killscript@0.1.2 link "/path/to/KILLSCRIPT/Modules"
npm run install:game
npm run dev

link stores the machine-specific path in .killscript/local.json. The file is ignored by Git, so another developer can link a Windows path, macOS SMB mount or another installation without changing project files.

install:game performs one build and sync. dev performs the same safe process after each relevant change and keeps watching.

The watcher observes:

  • TypeScript reachable from client and Reflex entries;
  • killscript.config.json;
  • top-level settings and control declarations;
  • files under public/.

A client script change is picked up by the game’s folder-module reload. A real change to scripts/server.lua also requests a Reflex reload for the current match and prints a notice. Do not disable and re-enable the module only to apply server code: some game builds restart only the client when toggled from the module list.

If a compiler error occurs, the incomplete output is never copied. Fix the first diagnostic and save again; the game continues running the previous successful version meanwhile.

Place files in public/ using the relative paths expected by the native API:

public/
├── images/
│ └── Icon.png
├── sounds/
│ └── Toggle.ogg
├── ui/
│ └── Hud.uxml
└── localization.csv

Everything below public/ is copied to the module root with the same relative path. For example:

const icon = Textures.GetTexture("images/Icon.png");
const sound = Sounds.GetSound("Toggle.ogg");

Generated names module.json, config.json, inputs.json and scripts/ are reserved. Symbolic links are rejected so a release cannot accidentally include files outside the project.

For a Windows game folder mounted over SMB, the CLI prefers a single rename for changed files and retries transient sharing violations. Filesystems that cannot overwrite by rename use a recoverable backup-and-replace fallback, so a very short replacement gap is still possible there.

The target folder must be absent, carry the same module UUID, or contain this project’s ownership marker. A different module is never overwritten or removed automatically.

Do not edit generated Lua on the share. The next successful build owns and replaces it. If synchronization stops, run npm run doctor and check Troubleshooting.