LuaModAutomator
A ZomboidForge mod that takes a
Project Zomboid server's mod list from a public Steam Workshop collection. At every start it
reads the collection and sets Mods=, WorkshopItems=, and Map= before the server uses
them, so the collection is the only place to maintain the mod list: change it on Steam,
restart the server, done. While the server runs, it checks the collection periodically and
logs when it no longer matches, or when items received updates on Steam.
Players keep the official, unmodified client; the mod runs on the server only.
Requirements
- ZomboidForge 0.4.0 or newer, Project Zomboid Build 42 (dedicated server)
- Steam mode (the default of the ZomboidForge image), which the Workshop download needs
- a Public Steam Workshop collection: unlisted, friends-only, and private collections are invisible to Steam's Web API
Installation
-
Download the newest release and unpack it into
<forge>/mods/, which gives<forge>/mods/lua_mod_automator/:curl --fail --location --output lua_mod_automator.zip \ https://git.security-command.org/Overlord/LuaModAutomator/releases/download/latest/lua_mod_automator.zip unzip -o lua_mod_automator.zip -d <forge>/mods/Every release also carries
lua_mod_automator-<version>.zipfor a fixed version. To update, removelua_mod_automator.jarandlib/from the mod's folder first and unpack the new zip;config.tomlis not part of the zip and stays. -
Create
<forge>/mods/lua_mod_automator/config.tomlwith at least the collection:collection = "https://steamcommunity.com/sharedfiles/filedetails/?id=<collection id>" -
Restart the server. The log lists the resolved mods.
With the ZomboidForge container image, leave MODS and WORKSHOP_ITEMS unset: the mod
replaces those values at every start anyway.
How the mod list is built
For every item of the collection, Steam's Web API returns its title, tags, and description.
- Mod IDs come from description lines such as
Mod ID: FooorModID = Foo; Bar. An item without one stays inWorkshopItems=(so the server downloads it) but is left out ofMods=, with a warning;[items.<id>] mod_idssupplies it. The same applies to items Steam returns no details for (private, unlisted, or removed items inside the collection). - Buckets decide the load order:
map(aMap Folder:line in the description),framework(the Steam tag Framework), ormisc. Buckets load in the order of[order] buckets, items within a bucket in collection order. - Order: the items of
[order] priorityload first, in that order; then items with apositionmove to that place, lowest position first. Map=: theMap Folder:folders of map items in load order, followed by[ini] base_map, each once.
Values go into the server's .ini ([ini] write), so showoptions and the file show what runs.
When Steam cannot be reached
The server always starts. The mod uses, in this order:
- the collection, resolved live from Steam;
- the last successful resolution of the same collection, cached in the world's
zomboidforge.db; - the values already in the
.ini.
Every fallback is logged as a warning. An invalid config.toml leaves the .ini as it is.
Settings
<forge>/mods/lua_mod_automator/config.toml overrides the defaults key by key; keys left out
keep their default. Every setting, with its default where it has one:
# The collection: its URL or numeric id. Empty (default): the mod does nothing.
collection = "https://steamcommunity.com/sharedfiles/filedetails/?id=1234567890"
[ini]
write = true # save the resolved Mods=, WorkshopItems=, Map= into the .ini
manage_map = true # false: Map= is left alone
base_map = ["Muldraugh, KY"] # Map= ends with these folders, after those of the map items
[steam]
timeout_s = 20 # seconds per Web API request
[drift]
interval_min = 30 # minutes between drift checks while running; 0 turns them off
[order]
buckets = ["map", "patches", "framework", "misc"] # default: ["map", "framework", "misc"]
priority = ["3543229299", "UnifiedCarryWeightFramework"] # default: []; workshop ids or Mod IDs
# Overrides per item (default: none). The key is a workshop id or a Mod ID of an item in the
# collection; Mod IDs with characters other than letters, digits, _ and - need quotes.
# Every field is optional.
[items.3790407759] # Steam returns no description for it
mod_ids = ["RconDataBridge"] # replaces the Mod IDs parsed from the description
title = "RCON Data Bridge" # name in the logged mod list
[items.2553809727]
bucket = "misc" # tagged Framework on Steam, but loads with the rest
[items.SomeFixPack]
bucket = "patches" # a custom bucket, listed in [order] buckets
[items.ISA] # addressed by Mod ID
position = 3 # place 3 of the final list (applied after priority)
[items."Better.Lights"] # quoted: the Mod ID contains a dot
mod_ids = ["BetterLights"] # the item ships BetterLights and BetterLights_Lite: load one
[items.2345678901]
exclude = true # left out of Mods=, WorkshopItems=, and Map=
Problems that do not stop the mod are logged as warnings: [items] keys or priority
entries that match no item, two keys naming the same item (the workshop-id key wins field by
field), Mod IDs named by two items (Mods= lists them once), unknown keys. An item that lands
in a bucket missing from [order] buckets is an error: the mod then falls back as if Steam
could not be reached.
While the server runs
Every [drift] interval_min minutes the mod resolves the collection again and logs, once per
change:
- how the collection differs from what the server runs: items or Mod IDs added, removed, or in
another order, a different
Map=; - items that were updated on Steam after the server started. Clients that download the new version may not be able to join until the server restarts and downloads it too.
The mod never restarts the server; changes apply at the next start.
/collection
An admin command for the in-game chat, the server console, and RCON (capability
ManipulateMods, like vanilla's checkModsNeedUpdate):
| Command | Does |
|---|---|
/collection |
where the running mod list comes from, its counts, and the last drift check |
/collection check |
starts a drift check now; the result goes to the log and the next /collection |
Building
Needs JDK 25 and the ZomboidForge Gradle plugin, which Gradle downloads. The game jar comes from a local Steam installation of Project Zomboid or its dedicated server, or from a steamcmd download (see ZomboidForge's mod development guide).
./gradlew build # compiles, tests, checks the mod against the game, and packs build/distributions/
./gradlew runServer # a ZomboidForge server in a container with the mod (default settings: idle)
runServer mounts the mod read-only, so it runs with the default settings, in which the mod
is idle. To try it with a collection, copy build/mod/lua_mod_automator/ into a server's mods
directory (or set zomboidForge.deployDirectory and run ./gradlew deployMod) and add a
config.toml there.
Pushing a tag v<version> that matches version in build.gradle.kts builds the mod and
publishes it as a release (.gitea/workflows/release.yml, ci/release.sh). Tags containing
- (e.g. v0.2.0-rc.1) are built and tested but not released.