Development and debugging
A normal folder-module workflow takes only a few seconds:
- start a custom game session;
- enable the module;
- edit a file;
- save it;
- inspect the result and console.
Hot reload
Section titled “Hot reload”The game watches files inside folder modules and requests a reload after a save. This covers Lua code, configuration, and assets.
Some files also trigger additional work:
- changing
inputs.jsonrebuilds input actions; - changing
module.jsonrefreshes metadata and may reload client modules; - changing
scripts/server.luarefreshes the server side of the active Reflex module.
Hot reload replaces the previous Lua module instance. Initialize state, subscriptions, and windows as if the file were starting from scratch.
Console
Section titled “Console”Open the console with ~. It contains:
print()output;- Lua errors with file names and line numbers;
- load and hot-reload messages;
- invalid JSON and asset warnings.
When print is not visible
Section titled “When print is not visible”The icon next to Search controls message-category filters. The console also has a selected log section or source.
Check both:
- your module’s section is selected;
- informational messages are enabled in the filter.
Then look for lines such as:
[MyModule] [main.lua:12]: Module loadedA useful diagnostic template
Section titled “A useful diagnostic template”print("Module loaded")
local frames = 0
Scheduler:OnFrame(function() frames = frames + 1
if frames == 1 then print("First frame received") end
ImGui:DrawDebugText("Frames: " .. tostring(frames))end)The result narrows failures quickly:
- no first line: the module is not running or
main.luafailed to load; - first line but no second line: an error happened before
OnFrameregistration; - both lines but no on-screen text: inspect the ImGui call and current game context.
Common errors
Section titled “Common errors”Lua access failed for member
Section titled “Lua access failed for member”Lua access failed for member 'SomeProperty'The member is unavailable in the current context or does not support that operation. A read-only property cannot be assigned, and a client-only API cannot be called from server.lua.
Check the context and get/set information on the relevant API page.
attempt to call a nil value
Section titled “attempt to call a nil value”attempt to call a nil value (global 'type')The Lua sandbox does not expose that global function, or the name is incorrect. A module does not receive every function from standard Lua.
JSON does not load
Section titled “JSON does not load”Check the shape of the root value first. For example, config.json must contain an array:
[ { "label": "Enabled", "key": "Enabled", "type": "bool", "value": true }]An object such as { "Enabled": true } does not match the settings format.
Sharing violation
Section titled “Sharing violation”When a project is edited over a network share or an editor holds a file while writing, hot reload may report Sharing violation. Wait for the save to complete and save once more. Disable editor extensions or other software that holds the changed file open for too long.
Nothing runs in the menu
Section titled “Nothing runs in the menu”Client Lua starts after you enter a game session. You can manage modules in the main menu, but test main.lua on a loaded map.
Reflex code does not run
Section titled “Reflex code does not run”Verify that:
module.jsoncontains"IsReflex": true;scripts/server.luaexists;- this Reflex module is selected;
- another Reflex module is not occupying the single active slot.
When to restart completely
Section titled “When to restart completely”Normal code edits need only hot reload. Toggle the module off and on when its state seems inconsistent. Reserve a full game restart for a package that is not being re-read or a game session that has entered an invalid state.
Continue with module structure, editor and API completion, and organizing Lua code.