Every modder spends more time fixing things than making them. The difference is knowing where to look.
Where the errors are
Zomboid/console.txt: the log from the last time you launched the game. Search for your mod's name,ERRORorException.Zomboid/Logs/: one folder per session with more complete logs. If the game crashes while loading a save,console.txtsometimes gets cut off and the real error is here, in the file ending inDebugLog.txt.- Debug mode (
-debug) shows Lua errors on screen as soon as they happen.
Typical problems
| Symptom | Likely cause | Fix |
|---|---|---|
| The mod doesn't show up in the mod list | Wrong folder structure or mod.info | Check Contents/mods/<id>/42/mod.info and that id= matches the folder name |
| "World loading could not proceed, there are script load errors" | An item in a recipe written without its module | Write MiMod.MiItem, not MiItem, in craftRecipe |
| The item shows up with a question mark | Missing icon or the name doesn't match | Icon = X looks for textures/Item_X.png |
You see Tooltip_MiMod_Algo on screen instead of the text | Translation in .txt or broken JSON | B42 only reads .json; check the commas and that the key is exact |
attempted index of non-table or tried to call nil | A function or table that doesn't exist (often from Build 41) | Search for it in the game's .lua files before using it |
| The item doesn't show up in any container | Misspelled loot list name, or containers already opened | Check the name in ProceduralDistributions.lua and test in a new game |
| Worn clothing has holes | Body masks applied over a custom UV | <m_MasksFolder>none</m_MasksFolder> (Clothing) |
| The vehicle is just a shadow | Model without a module in the vehicle script | file = MiMod.MiModelo (Vehicles) |
| The item isn't visible in the hand when equipped | Missing grip pose | primaryAnimMask / secondaryAnimMask (Items) |
A method that works
- Change one thing at a time. If you change ten and something breaks, you won't know which one it was.
- Reproduce the error with the bare minimum: disable your other mods. A lot of the time the problem is a clash between two of them.
- Look for an example in the base game. If the game does something similar, copy how it does it.
- Read the whole error. The first line that mentions your file usually gives the exact line number.
- Before publishing, test in a new game and in an existing save if you say it can be added mid-playthrough.
Before calling a mod finished
- The "vanilla" models and textures you use actually exist in the base game, not in another mod.
- The loot code checks that the list exists and runs inside
pcall. - Recipes use names with their module.
- There's a translation in at least English and Spanish, in JSON.
- If it can be equipped in the hand, it shows up in the hand.
- Clothing with a custom model was tested worn, with pants and socks on top.
console.txtshows no errors with your mod's name.