Skip to content

Editor and API completion

A folder module can be edited in any text editor. Visual Studio Code with Lua support is the most convenient option because the game creates project settings and connects KILLSCRIPT API definitions.

The module menu provides two useful actions:

  • Folder opens the module directory;
  • VS Code opens that directory as an editor workspace.

Open the module root, not only main.lua:

Modules/
└── MyModule/ ← open this directory
├── module.json
├── scripts/
└── .vscode/

This lets the editor see .vscode/settings.json, assets, and all project entry points.

The game stores Lua API definitions in ModuleAPI next to the executable. The generated module settings add the appropriate language directory to the Lua workspace library.

After opening the project, the editor should complete globals such as Agents, Scheduler, and ImGui and their members.

If completion is missing:

  1. verify that Lua support is installed;
  2. open the module root containing .vscode;
  3. verify that ModuleAPI exists in the current game installation;
  4. restart the Lua language server or editor window.

Editor completion shows a known signature but does not change execution context. Scheduler:OnTick() remains a Reflex server method even if the editor suggests it in main.lua.

Use the API reference for runtime context, get/set access, and limitations.

  • save files as UTF-8;
  • use indentation consistently;
  • avoid formatters that rewrite JSON into an invalid shape;
  • over a network share, avoid extensions that hold files open during saves.

Continue with the development and debugging workflow and organizing Lua code.