Skip to content

Using EnginePatch in your mod

cech12 edited this page Dec 4, 2026 · 1 revision

Using EnginePatch in your mod

  1. Add the dependency to your config.json: "dependencies" : [ { "id" : "EnginePatch" } ]
  2. Add the file EnginePatch/mods/<YourModFolderName>.json to your mod. Use your mod folder name as file name so two mods never overwrite each other's file.
{
	"format" : 1,
	"description" : "MyMod: bigger barrows",
	"values" : {
		"transport.Schubkarren" : 10
	}
}

If the change should only happen with a mod setting, put the EnginePatch folder into an optional directory of your mod (the folder is copied into the game only if the condition is true):

"directories" : [
	{ "type" : "optional", "path" : "EnginePatch",
	  "condition" : { "type" : "variable", "id" : "GROUND_TEXTURES", "value" : true } }
]

Values from your mod settings

The mod manager replaces $print:VARIABLE in all files of your mod with the setting, also in this file. Keep it in quotes, so the file is valid JSON before the replacement; EnginePatch reads numbers in quotes, too.

"settings" : [
	{ "id" : "BARROW_SLOTS", "type" : "int", "default" : 6, "min" : 0, "max" : 30,
	  "name" : { "en" : "Extra slots of the barrow", "de" : "Zusätzliche Plätze der Schubkarre" } }
]
{ "format" : 1, "values" : { "transport.Schubkarren" : "$print:BARROW_SLOTS" } }

After installing, the game folder contains "transport.Schubkarren" : "10". Numbers may be decimal ("10", "-1") or hex with 0x ("0x10"). Bool settings become True/False, so use them only as condition of an optional directory. A complete example with settings: BiggerBaskets.

Rules

  • "format" : 1 is required. A file with a higher format is skipped.

  • "require" : [...] (optional) lists features your file needs. If the installed EnginePatch does not know one of them, the whole file is skipped instead of being applied halfway. Known features:

    feature since needed when
    values 1.0.0 always available
    catalog 1.0.0 your file has a "catalog" section (own values)
    occurrence 1.0.0 one of your own entries uses "occurrence"
    builds 1.0.0 one of your own entries uses "builds"

    New features of later versions will be added here. Listing them in require keeps older EnginePatch versions from applying your file halfway.

  • Unknown sections and unknown ids are ignored and logged. Invalid JSON is logged with its line number, the file is skipped.

  • "hooks", "tclCommands" and "calls" are reserved for a later version and ignored today.

  • If two mods set the same value differently, it is not changed at all. 10 and "10" are the same value.

  • Every value is checked against its vanilla value before writing. If anything does not fit, the value is not written and the game starts normally.

  • Limits: 64 mod files, file names and ids up to 63 characters, 128 catalog entries in total, anchors up to 255 characters, patterns up to 64 bytes.

Editor support

Add "$schema" to your file and editors like VS Code check it while you type. EnginePatch ignores this entry.

"$schema" : "https://raw.githubusercontent.com/DigglesMods/EnginePatch/HEAD/.tools/schema/mod.schema.json"

A value you need is not in the list of available values? See own values.

Clone this wiki locally