Troubleshooting
Find the log line behind a missing or misbehaving setting, learn what each Gears log tag reports, and match a symptom to its cause.
Start here when a setting does not appear in the game or does not behave the way you declared it. Gears skips a bad setting rather than failing the whole file, so most problems show up only as a line in the game log.
Read the log
Every Gears line starts with [Gears], and most carry a second tag naming the component that wrote
it:
[Gears] [XmlSettingsParserV2] Slider 'fov' has no defaultValue; defaultValue is required, skipping.Search the log for [Gears]. On Windows, the log files are in %APPDATA%\7DaysToDie\logs. In the
game, press F1 to open the console, then press the button in its top-right corner to open the log
folder. You can also read the lines in the console itself.
Some lines are debug-only and hidden by default: the "does not contain a ModSettings.xml" notice,
the per-setting world values at world start, and the inline modsetting() expansions. Turn them on
with the console command:
gears debug onRunning gears debug on its own toggles the setting. The argument may be on, off, true,
false, 1 or 0, in any case. The command works in the main menu as well as in a world.
What each log tag reports
| Tag | Reports |
|---|---|
[ModSettingsFromXml] | Whole-file problems: no version, a version other than 2, malformed XML, the wrong root element, or no elements. The mod's entire ModSettings.xml was skipped. |
[XmlSettingsParserV2] | A single setting dropped, or a property ignored, while parsing: a missing type or defaultValue, an unknown or unsupported type, an unparseable increment, minValue, maxValue, allowedValues or preview value, and Color per-value previews. |
[GlobalModValueSetting] or [WorldModValueSetting] | An unparseable defaultValue or saved value. A bad saved value leaves the setting at its default. A bad defaultValue leaves it at its type's empty value: 0, false, empty, or black. |
[SelectorSetting] or [SelectorWorldSetting] | An <Incremental> on a string or enum selector, an increment of 0 or less, or a minValue above maxValue. Gears ignored the range. |
[SavedModSettingsFromXml] | A problem restoring the player's saved global values: a mod, tab, category or setting named in the file no longer exists, usually because it was renamed, or an element is missing its name or value. The setting kept its default. |
[WorldSettingsFromXml] | The same, for a world's WorldModSettings.xml. |
[GearsMod] | A problem with your IGearsModApi: a type with no public parameterless constructor, a constructor that threw, a callback that threw (Error thrown in <Callback>() by <Type> for <Mod>), the outdated-GearsAPI warning, or a settings class you bound and never synced. |
[Gears] with no second tag, on a listener or binding message | BindSettingsClass skipped a member: a bad path format, an unknown setting, an unsupported event, or a wrong method signature. For a [Setting] field or property, it may be readonly, const, non-static, missing a setter, or declared as the wrong type. For a [SettingPlayerAction] member, it may be non-static, null when binding ran, not declared as a PlayerAction, or aimed at a setting that is not a Binding. See Bind Settings with Attributes. |
An XML patch error mentioning modsetting | A modsetting() call with the wrong argument count, group, or path shape, or a mod, tab, category or setting name that does not exist. For an inline call, Gears also logs [Gears] XML.<file> (<attribute>, line <n> at pos <m>): … with no second tag. See Read Settings in XML Patches. |
An InvalidOperationException at startup, rather than a log line, means a [SettingParser] or
[SettingFormatter] method has the wrong signature. The message spells out the signature Gears
expects.
Match a symptom to its cause
My mod is in the Mods menu but has no Settings tab.
The whole file was rejected. Look for [ModSettingsFromXml]. The usual causes are a root with no
version="2", which means a V1 file, a file that is not at the mod root beside ModInfo.xml, or
XML that does not parse.
A rejected file removes your players' saved values
If the whole ModSettings.xml is rejected and your mod creates no global settings from C#, Gears
removes your mod's section from each player's saved settings file at that startup. Every saved
global value for your mod is lost, even after you fix the file. This keeps the saved file from
growing with entries for settings that no longer load. Test the file in the game before every
release.
One setting is missing.
Look for [XmlSettingsParserV2] lines naming it. In rough order of likelihood:
- No
defaultValue. - No
type, or a misspelled or unknown one. Name an enum declared inside a class asMyClass+MyEnum, notMyClass.MyEnum. See Name an enum declared inside a class. - A
stringorboolon aSlider. Sliders takeintandfloatonly. - A type that resolves but has no setting implementation, such as
double, or a custom struct with only a parser registered. - A
ColororBindingunder<World>. Gears drops these without a log line. - A setting placed directly under
<Tab>instead of inside a<Category>. Also silent. - Another setting with the same
nameearlier in the same<Category>element, or its whole category repeating a categorynameearlier in the same<Tab>element. Gears drops the second one without a log line. See How duplicate names merge.
A selector shows no values.
It is not an enum selector and declares neither <List> nor <Incremental>. Or one entry in allowedValues did not parse,
which drops the whole list. Or <Incremental> had a bad bound, a zero increment, or a minValue
above maxValue. Or the selector is a string with an <Incremental>.
A selector shows the wrong set of values.
It declares both <List> and <Incremental>. Gears applies the range last, so the range wins.
A switch shows False and True instead of my labels.
<Buttons> needs both left and right, and both must parse. With one missing, Gears applies
neither. For a bool switch, add a <LocalizationPrefix> and localize <prefix>True and
<prefix>False.
Text shows as a raw key such as myModHudScale.
The key is missing from your Config/Localization.csv, or its row lacks the UsedInMainMenu mark.
See Localize Your Settings.
The player's saved value comes back as the default after I renamed something.
Gears keys saved values by tab, category and setting name. Renaming any of them orphans the saved
value, and [SavedModSettingsFromXml] says which one.
The orphaned value is then deleted. At every startup Gears rewrites each loaded mod's section of the saved settings file from the settings that exist now, so a value with no setting left to match is dropped and cannot be recovered. If you rename something after release, expect your players to lose that setting's value.
My world settings never load while I am testing in the prefab editor.
Gears skips world settings entirely for the worlds named Empty and Playtesting. It writes no
WorldModSettings.xml and never calls OnWorldSettingsLoaded. Test in a real world.
After a world reloads, one world setting is back at its default and another has its value.
The two settings share a name in different world categories. Gears restores saved world values
by name alone, into the first setting with that name, so the second one never gets its value back.
A world setting's name must be unique across all of a mod's world categories, not only within one.
My IGearsModApi callbacks never run.
The class must be public, concrete and non-generic, with a public parameterless constructor, in an
assembly your mod lists. Look for [GearsMod] warnings. Gears also does not run
OnWorldSettingsLoaded for a mod with no world settings.
I see a TypeLoadException or an "outdated GearsAPI" line.
Your mod was compiled against a different GearsAPI.dll than the one Gears is running. Rebuild
against the current one.
My listener never runs at startup, only when the player changes the setting.
Binding subscribes a listener; it never calls one. Add includeInSync: true to the attribute and
call SyncSettingsToClass after BindSettingsClass. See
Sync settings to a class.
My [SettingOnValueChanged] on a world path never runs at all.
A world setting raises no OnValueChanged, so that listener is invoke-only: it needs
includeInSync: true and a SyncSettingsToClass call, or nothing will ever call it. Gears does not
warn about this. See
[SettingOnValueChanged] on a world path.
SyncSettingsToClass logs "has not been bound".
You called it for a type no BindSettingsClass ever saw — check for a typo in the typeof(...), or
a missing bind.
Gears says a class "was bound with BindSettingsClass … but SyncSettingsToClass … was not
called".
The class has a listener written with includeInSync: true, so it asked for the values Gears just
loaded, and nothing called SyncSettingsToClass for it in that callback. Add the call to
OnGlobalSettingsLoaded, or to OnWorldSettingsLoaded for a world class — that one fires again on
every world load and rejoin, and each load needs its own sync. See
Gears warns when the sync is missing.
modsetting() returns an empty string.
The setting is a Binding, which holds no value. Every other failure is an error, not an empty
string.
modsetting() inline in an attribute leaves the literal text in place, or the game logs parsing
errors.
Gears is not installed for that player, so nothing expands the call. Guard the patch with
mod_loaded('Gears'). See Read Settings in XML Patches.