Skip to content

Update project-zomboidmetaconfig.json - #1956

Draft
alelejo wants to merge 2 commits into
CubeCoders:mainfrom
alelejo:patch-1
Draft

Update project-zomboidmetaconfig.json#1956
alelejo wants to merge 2 commits into
CubeCoders:mainfrom
alelejo:patch-1

Conversation

@alelejo

@alelejo alelejo commented Aug 10, 2026

Copy link
Copy Markdown

Added config to allow AMP to edit {{servername}}_SandboxVars.lua file like it was editing the {{servername}}.ini file

alelejo added 2 commits August 9, 2026 23:48
Added config to allow AMP to edit {{servername}}_SandboxVars.lua file like it was editing the {{servername}}.ini file
Edited regex in .lua file to avoid nested values like
Map = {
        -- If enabled, a mini-map window will be available.
        AllowMiniMap = false,
        -- If enabled, the world map can be accessed.
        AllowWorldMap = true,
        -- If enabled, the world map will be completely filled in on starting the game.
        MapAllKnown = false,
        -- If enabled, maps can't be read unless there's a source of light available.
        MapNeedsLight = true,
    },


Same key Value in .lua and .ini can create conflicting updates.
@IceOfWraith

Copy link
Copy Markdown
Collaborator

I see that you added the metaconfig side but from a spot check I don't see that any settings are configured that exist in the lua file.

@alelejo

alelejo commented Aug 10, 2026

Copy link
Copy Markdown
Author

That's the thing this PR fixes, and I have a before/after for it.

project-zomboidconfig.json already declares settings whose ParamFieldName also exists as a top-level key in {servername}_SandboxVars.lua — MinutesPerPage, HoursForLootRespawn, MaxItemsForLootRespawn among them. On an unmodified b42 instance I changed MinutesPerPage from the UI and it updated the .ini only; the .lua was untouched, because there was no ConfigFile entry for it. After adding the metaconfig entry, the same change reaches both files.

So those settings are already silently not applying today. That's what the entry addresses.

It only works partially, though.

  1. A key that exists in both files gets written to both. For example Map is a plain value in the .ini and a nested table opener (Map = {) in the .lua — AutoMap overwrites the opener and corrupts the file.

  2. My workaround is a lookahead in ConfigFormatRegex that skips any line whose value starts with {, so table openers are never writable

  3. This protects the table structure but does not scope nested scalars — a key like ZombieLore.Speed still matches as a bare Speed. No current setting collides, but it's luck rather than design.

@IceOfWraith

Copy link
Copy Markdown
Collaborator

Gotcha. Let me look at it closer with those settings in mind then and see if this can be accepted.

@IceOfWraith

Copy link
Copy Markdown
Collaborator

Okay, I see what's going on with it now. The devs moved a few of the settings to the lua file but also changed the names of some other settings. I'm going to make some commits that include all the changes but keep backwards compatibility soon.

@IceOfWraith IceOfWraith reopened this Aug 11, 2026
@IceOfWraith IceOfWraith self-assigned this Aug 11, 2026
@IceOfWraith
IceOfWraith marked this pull request as draft August 11, 2026 01:14
@alelejo

alelejo commented Aug 11, 2026

Copy link
Copy Markdown
Author

Understood, thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants