Config (CfgConvert)

Tutorial · 2:51

A DayZ mod declares what it adds to the game in a config (config.cpp): each item, weapon or vehicle is a class with properties, and most classes inherit from a class of the game. This page does two things. Convert & check finds the mistakes of your config.cpp and converts it to config.bin, the binary form the game loads, or turns a config.bin back into readable text; it replaces CfgConvert of DayZ Tools. Game config browser shows every class of the game with its inherited values, so you can see what a class is made of and start your own from it. The check also warns when your file redefines a class of the game (class WoodenCrate { … } in CfgVehicles): that changes the game's item on every server that loads the mod, so inherit a new class instead unless you mean it. The browser, the requiredAddons check and that warning need the DayZ folder set in Settings; checking syntax and converting need nothing.

The screen

First steps

  1. Open Config in the rail and click Game config browser. The first time, the configs of all the game's PBOs (its packed archives) are merged; this takes a few seconds.
  2. Type canteen in the search box.
  3. Click CfgVehicles/Canteen.
  4. Read the chain next to Inheritance: Bottle_Base → Edible_Base → Inventory_Base → …. Everything the canteen does not set itself comes from these parents.
  5. Read Addon: DZ_Gear_Drinks. A mod that inherits from Canteen lists this name in its requiredAddons[].
  6. Hover scope and itemSize in the properties to read what they mean.

Take the tour (in the app)

Common tasks

Check a config.cpp

  1. In Convert & check, pick your config.cpp as Input.
  2. Press Check.
  3. Click a problem to open the file at its line. Fix it, save: the check runs again by itself when the file changes on disk.

Tour: check and convert (in the app)

Convert config.cpp to config.bin

  1. Pick the config.cpp. Convert to is set to Binary (.bin) and Output to config.bin next to it.
  2. Press Convert. The line "Wrote …" confirms the file.

The PBO Packer can binarise the configs of a mod while it packs, so you rarely need to do this by hand.

Read a config.bin

  1. Pick a config.bin (for example one extracted from another mod you are allowed to study).
  2. Press Check to read it in the result area, or Convert to write a config.cpp.

Find what to inherit from

  1. In the browser, search something close to what you want to make (akm, barrel, hatchback).
  2. Open it and follow its parents: a …_Base class or a class with scope = 0 is usually the one meant to be inherited.
  3. Note the Addon for your requiredAddons[].

Create a class from a game class

  1. Select the parent class and press New class from this.
  2. Give the class a name (letters, digits and _).
  3. In Write to, choose a config.cpp of your mod (those of your workspaces are listed), Other file… or Copy to clipboard.
  4. Tick what the class should set. model path placeholder off keeps the parent's model (a retexture); on writes a path to replace with your own .p3d.
  5. Read the preview, then press Create and open. The class is added to its section, its name to the CfgPatches list, the parent's addon to requiredAddons[], and the file opens.

Examples

Concepts

Pitfalls

For agents

Tools of dzt that do the same work without the window:

Files: Convert & check reads the input and its includes (next to the file, and on the project drive set in Settings) and writes only the Output file. The browser reads the config.bin of every game PBO and writes nothing. New class from this writes the chosen config.cpp or the clipboard.

What the page tells the assistant: on Convert & check, the tab, the input file, the output path and the problems of the last check with their hints; it also offers the request "check this config". On the browser, the tab, the search text, the selected class path, its inheritance chain and the CfgPatches addon that defines it.

Examples reach the page as requests: req:class:<path> (class:CfgWeapons/AKM) selects a class in the browser; req:tab:convert and req:tab:browser show a tab.

Anchors for studio_guide: config-tabs, config-tab-convert, config-tab-browser, config-input, config-direction, config-output, config-check, config-convert, config-problems, config-explorer, config-search, config-sections, config-classes, config-detail, config-inheritance, config-properties, config-new-class.

See also