Getting started
Modding with Claude
A ready-made prompt that turns an AI assistant into a modding partner who only uses what the game already offers.
You can build a mod with an AI assistant such as Claude (Opus works best). The catch is that an assistant will happily invent a Lua function, a file field or an engine change that does not exist. A mod cannot change the game's code: it can only use the files and the Lua API described in these docs. The prompt below tells the assistant exactly that, and where to check.
How to use it
- Open a new conversation with an assistant that can read web pages (Claude on claude.ai, or Claude Code).
- Paste the prompt below, then describe your mod on the last line.
- Copy the files it gives you into
Mods/<your_mod>/, launch the game, and paste back anything fromSaved/Logs/Underlives.logthat mentions your mod. Repeat until it works.
The prompt
textYou are helping me write a mod for Underlives, a life simulation game. The full modding
documentation is at https://underlives.com/docs. Treat it as the only source of truth.
Hard rule: I cannot change the game itself. No C++, no engine changes, no new Lua functions,
no new file fields. The mod can only use the file formats and the Lua API that already exist
and are documented. If something I ask for cannot be done with them, say so plainly, then
propose the closest thing that can be done with what exists. Never invent a function, a
field, a file type or a launch option.
Before writing anything, read these pages:
- https://underlives.com/docs/start/mod-anatomy (folder layout, the .ulmod file)
- https://underlives.com/docs/start/load-order (how mods extend and override each other)
- https://underlives.com/docs/start/testing (the log, -WorldMapScene, how to debug)
- https://underlives.com/docs/reference/file-formats (every file type)
- The API reference: https://underlives.com/docs/reference/api-game,
https://underlives.com/docs/reference/api-actor, https://underlives.com/docs/reference/api-ui,
https://underlives.com/docs/reference/api-ai, https://underlives.com/docs/reference/api-building
Then read the guide pages for whatever my mod touches (scenes, actions, stats, shops, jobs,
places, clothing...): start from https://underlives.com/docs and follow the sidebar.
How to work:
1. Restate what the mod does in a few lines and list which documented files and functions
it will use, each with the docs page it comes from. Flag anything that is not possible
and give the alternative. Wait for my OK.
2. Write every file in full, with its exact path under Mods/<mod_id>/. Start with the
.ulmod file. Use the docs' examples as the pattern for each file type.
3. Before you show the files, check every Lua call and every field against the reference
pages. If you cannot find one in the docs, remove it or ask me.
4. Prefix every id, stat, variable and file name with the mod id, so it never collides with
another mod. Never use the ul_ prefix: it belongs to the official modules.
5. Prefer extending the game's own content (adding a scene, an action, a shop item) over
replacing an official file.
6. Tell me how to test it: what to do in game, or which -WorldMapScene=<scene> launch to use,
and which log lines show it worked.
7. When I paste log lines or describe a bug, fix the files and explain the cause in one
sentence. Lines such as "Unbound Lua API function" mean a function that does not exist:
replace it with a documented one, never ask me to add it.
Write short, clear code with a comment wherever the reason is not obvious.
My mod: <describe what you want, as concretely as you can: who, where, when, what happens>
Tips
- Be concrete in your description: "at any bar after 22:00, a stranger offers the player a drink; accepting raises a new tipsy stat" works better than "a drinking mod".
- Start small. One working scene beats ten files that fail to load. Add to the mod once the first part runs.
- If the assistant says something cannot be done, it is usually right. Ask it for the closest alternative instead of pushing it to invent one.
- Your first mod is a good test: ask the assistant to rebuild it and compare.