Gears

Gears Documentation

Give your 7 Days to Die mod a settings page in the Mods menu, save what the player chooses, sync per-world values from the server to every client, and read those values from XML patches or C#.

Gears is a mod settings framework for 7 Days to Die. These pages are for mod developers. If you installed a mod that uses Gears and want to change its settings, read Gears for Players instead.

Install Gears alongside your own mod and you can:

  • Give your mod a settings page in the game's Mods menu.
  • Save what the player chooses and restore it the next time the game starts.
  • Let the host pick per-world values and send them to every client that joins.
  • Read those values from your XML patches, from C#, or from both.

Upgrading from an older Gears?

This documentation replaces the older wiki, which described GearsAPI 2.x and the V1 ModSettings.xml schema. Neither one loads any more. If you have a mod built on either, start with Upgrade to GearsAPI 3.

ComponentVersion
Gears (the mod players install)8.0.0
GearsAPI.dll (the assembly mods reference)3.0.0

Terms these pages use

A mod setting is a setting that Gears defines for your mod. Mod settings come in two kinds, and the difference decides where the value is stored and who can change it.

TermMeaning
global settingA mod setting that belongs to the player. The player changes it from the main menu or the in-game menu, and the value applies in every world.
world settingA mod setting that belongs to one world. The host picks it when creating or continuing that world, and it cannot be changed while the world is running.

Choose how to declare your settings

Put a ModSettings.xml next to your ModInfo.xml and Gears builds the settings page from it. Read the values in your Config/*.xml patches with the modsetting() function. You write no C# and reference no Gears assembly, and your mod still loads for a player who does not have Gears installed. That player sees no settings page, and a patch that reads a setting fails and logs errors unless you guard it with mod_loaded('Gears'). See Read Settings in XML Patches.

Where to go next

Start here

Guides

Declare settings in XML

Read settings in C#

When something goes wrong

What Gears reads from your mod folder

FilePurpose
ModInfo.xmlThe game's own manifest. Gears uses <Name> as your mod's identity everywhere, and reads the optional <Icon> and <Banner> for the Mods menu.
ModSettings.xmlYour settings, in the mod root next to ModInfo.xml.
Config/Localization.csvThe game's localization file. Every display key you use in ModSettings.xml needs a row here.

Gears writes three files of its own, and you never author any of them by hand:

FileHolds
<user data folder>\Gears\ModSettings.xmlthe player's saved global values, shared by every mod
<save folder>\WorldModSettings.xmlone world's values, written when the world starts
<saves root>\newGameWorldModSettings.xmlthe values last used on the New Game screen's Mods World Settings, which the next new world starts with

On this page