Troubleshooting

My mod does not show up

My script mod does nothing

"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

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.