What do the external-tools wiki page, the example mod in .examples, and the docs say about mod folder layout, mod.json/metadata, Teal vs Lua, script entry points, logging/debugging, and recommended editor tooling (LuaLS/Teal LSP, VS Code extensions)? Also capture the wiki and script-doc into the repo so the AI can read them offline.
## Question
What do the external-tools wiki page, the example mod in .examples, and the docs say about mod folder layout, mod.json/metadata, Teal vs Lua, script entry points, logging/debugging, and recommended editor tooling (LuaLS/Teal LSP, VS Code extensions)? Also capture the wiki and script-doc into the repo so the AI can read them offline.
Part of #1
Resolved. Full write-up: docs/research/mod-tooling.md on branch research/mod-tooling (commit 0213e22, pushed; main untouched). Offline copies: docs/reference/wiki/ (14+ modding wiki pages as Markdown) and docs/reference/script-doc/ (api*, app, a few content modules; the other ~300 content modules were not saved).
Layout: a mod is a plain dir <author>_<modname>/ with mod.json, _metadata/modinfo.json (+ optional description.html, 0.png..), content/ (resources, mirror base-game structure, optional mod.script.tl), optional strings.json. Install by copying into staging_area/ in the userdata dir.
Teal vs Lua: everything is Lua; Teal (typed Lua, .tl) is the usual dialect. Locals only, no globals. ug_require for imports; script-doc signatures are Teal, so they serve as type defs.
Editor tooling: VS Code + Teal (teal-language/tl) + sumneko.lua + pdesaulniers.vscode-teal; Model Editor auto-creates workspace config in the Staging Area; Notepad++ is the fallback.
Gaps: contents of the auto-generated Teal workspace config, whether plain print hits stdout.txt, and how .tl is compiled are undocumented.
Resolved. Full write-up: `docs/research/mod-tooling.md` on branch `research/mod-tooling` (commit 0213e22, pushed; main untouched). Offline copies: `docs/reference/wiki/` (14+ modding wiki pages as Markdown) and `docs/reference/script-doc/` (api*, app, a few content modules; the other ~300 content modules were not saved).
- **Layout**: a mod is a plain dir `<author>_<modname>/` with `mod.json`, `_metadata/modinfo.json` (+ optional `description.html`, `0.png`..), `content/` (resources, mirror base-game structure, optional `mod.script.tl`), optional `strings.json`. Install by copying into `staging_area/` in the userdata dir.
- **mod.json**: `modId` (a-z0-9_), `revision`, `severityAdd/Remove` (None|Warning|Critical), `visible`, `cosmetic`, `dependencies`, `incompatibilities`, `params` (defaultIndex 0-based), script hooks. Example: `ug_tf3_config_change`, rev 1, `preRunScript` = `ug_tf3_config_change::mod.script@preRunFn`.
- **Teal vs Lua**: everything is Lua; Teal (typed Lua, `.tl`) is the usual dialect. Locals only, no globals. `ug_require` for imports; script-doc signatures are Teal, so they serve as type defs.
- **Entry points**: `preRunFn(configDict, allModParams, baseConfig)` mutates BaseConfig (example sets `trainAccelerationFactor = 0.5`); `runFn(configDict, allModParams)`; `postRunFn(configDict, allModParams)` uses `api.res.*` repositories. Own params via `allModParams[getCurrentModId()]`.
- **Logging/debugging**: `debugMode=true` in settings.lua (or Settings > Advanced); AltGr+D debug window; ingame console shows `stdout.txt` and runs Lua (`\clear`, `\stdout on|off`, `\history`); `debugPrint(table)`.
- **Editor tooling**: VS Code + Teal (teal-language/tl) + `sumneko.lua` + `pdesaulniers.vscode-teal`; Model Editor auto-creates workspace config in the Staging Area; Notepad++ is the fallback.
- **Gaps**: contents of the auto-generated Teal workspace config, whether plain `print` hits stdout.txt, and how `.tl` is compiled are undocumented.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Question
What do the external-tools wiki page, the example mod in .examples, and the docs say about mod folder layout, mod.json/metadata, Teal vs Lua, script entry points, logging/debugging, and recommended editor tooling (LuaLS/Teal LSP, VS Code extensions)? Also capture the wiki and script-doc into the repo so the AI can read them offline.
Part of #1
Resolved. Full write-up:
docs/research/mod-tooling.mdon branchresearch/mod-tooling(commit0213e22, pushed; main untouched). Offline copies:docs/reference/wiki/(14+ modding wiki pages as Markdown) anddocs/reference/script-doc/(api*, app, a few content modules; the other ~300 content modules were not saved).<author>_<modname>/withmod.json,_metadata/modinfo.json(+ optionaldescription.html,0.png..),content/(resources, mirror base-game structure, optionalmod.script.tl), optionalstrings.json. Install by copying intostaging_area/in the userdata dir.modId(a-z0-9_),revision,severityAdd/Remove(None|Warning|Critical),visible,cosmetic,dependencies,incompatibilities,params(defaultIndex 0-based), script hooks. Example:ug_tf3_config_change, rev 1,preRunScript=ug_tf3_config_change::mod.script@preRunFn..tl) is the usual dialect. Locals only, no globals.ug_requirefor imports; script-doc signatures are Teal, so they serve as type defs.preRunFn(configDict, allModParams, baseConfig)mutates BaseConfig (example setstrainAccelerationFactor = 0.5);runFn(configDict, allModParams);postRunFn(configDict, allModParams)usesapi.res.*repositories. Own params viaallModParams[getCurrentModId()].debugMode=truein settings.lua (or Settings > Advanced); AltGr+D debug window; ingame console showsstdout.txtand runs Lua (\clear,\stdout on|off,\history);debugPrint(table).sumneko.lua+pdesaulniers.vscode-teal; Model Editor auto-creates workspace config in the Staging Area; Notepad++ is the fallback.printhits stdout.txt, and how.tlis compiled are undocumented.