dd2d7a3abefb522295818a34a45b898ba5d0254a
Opinionated Firearms
Project Zomboid B42 patch mod + tooling for managing GaelGunStore firearm/attachment spawn distribution.
Workflow
- Use CLI
extractto build a JSON catalog from GGS source (loot.lua+ scripts). - Load that catalog JSON in the webapp.
- In the webapp, choose per item:
- spawn enabled/disabled
- where it should spawn (distribution list)
- spawn rate weight
- Export a profile JSON from the webapp.
- Use CLI
applyto convert the profile JSON intoOFSpawnProfile.lua. - Start Project Zomboid with this mod +
GaelGunStore_ALPHA.
CLI
Script: tools/ggs-dist-cli.js
Extract catalog
node tools/ggs-dist-cli.js extract --ggs-root source/GaelGunStore/42 --out data/ggs-spawn-catalog.json
Output contains:
- all firearms/attachments from GGS scripts
- where they spawn (
list) - base spawn weight (
weight) - sandbox key (
sv) used by GGS spawn multipliers
Apply webapp profile
node tools/ggs-dist-cli.js apply --profile data/of-spawn-profile.json --out common/media/lua/shared/OFSpawnProfile.lua
This writes the Lua profile the mod reads at runtime.
Webapp
Path: webapp/index.html
Serve locally (recommended):
python -m http.server 8080
# open http://localhost:8080/webapp/
Features:
- import extracted catalog JSON
- import existing profile JSON
- filter/search full item list
- toggle per-item spawn enabled
- edit per-list placements and weights
- export profile JSON for CLI
apply
Runtime mod behavior
Main patcher: 42/media/lua/server/distribution/OFDistributionBlocker.lua
- loads block rules (
OFBlockConfig) and spawn profile (OFSpawnProfile) - removes blocked/managed entries from distributions
- re-adds managed item placements with chosen weights from spawn profile
- reparses ItemPicker after patching
Files
mod.info42/mod.info42/media/lua/server/distribution/OFDistributionBlocker.luacommon/media/lua/shared/OFSpawnProfile.luacommon/media/lua/shared/OFBlockConfig.luacommon/media/lua/shared/OFBlockRules_Default.luacommon/media/lua/shared/OFBlockRules_User.luacommon/media/lua/shared/OFSourceCatalog.luatools/ggs-dist-cli.jswebapp/index.htmlwebapp/styles.csswebapp/app.js
Description
Languages
Lua
100%