Troubleshooting
My mod does not show up
- It must be a folder or a
.zipdirectly insidemods(notmods/something/mymod). - Open the Mods screen (main menu → MODS) and press Look again; check that it is ticked.
- Folders and files starting with
.are ignored.
My script mod does nothing
- Open the console (`): errors are red, with the file and line.
- F1 → Scripts shows failed with the error when
main.luacould not run at all. - Is the file called
main.lua(or named inmod.jsonas"main")? Is the mod ticked in the Mods screen? - Print something at the top of
main.luato see that it runs:print("loaded").
"attempt to index a nil value"
You used a field of something that is nil: often a creature that was not found (world.nearest returns nil when
there is none) or a function outside a hunt (world.spawn returns nil in the menus). Check before using it:
local rex = world.nearest("trex")
if rex then rex.scale = 2 end
"creature #12 no longer exists"
The creature was removed, or a new hunt began. Check c.valid before using a creature you kept from earlier.
"the script ran for too long"
A loop that never ends, or a lot of work in one handler. Mods cannot pause: use timer.after / timer.every and the
frame event instead of waiting in a loop.
"ui widgets go inside ui.window ..."
Widgets (ui.text, ui.button ...) only work inside a ui.window(title, function() ... end) called from a draw
handler, or inside a ui.panel function. draw.* works in draw handlers.
A handler stopped running
After 20 errors in a row a handler is removed (the console says so). Fix the error and press F9.
My replaced file has no effect
- File mods replace by file name: the name must match the game's file exactly (see The game's files).
- Lower mods in the Mods screen list win: another mod may replace the same file (the Mods screen shows conflicts).
- Some files are loaded once at start (menu art) or per hunt (maps, creatures): restart, or start a new hunt.
Where is the log?
Everything in the console is also written to the game's standard output: start the game from a terminal (Linux) or
a command prompt (Windows: carnivores.exe > log.txt) to keep it.