dayzmake
DayZ modding tools written in Rust: PBO packing and unpacking, config preprocessing and rapification, model inspection and binarization, PAA conversion, signature handling and navigation mesh (navmesh) generation for terrain mods.
History
dayzmake is a fork of armake2
itself the successor to armake, diverged from it for DayZ modding: Arma 3
targets are no longer the focus, while DayZ-specific behaviour (binarization
through DayZ Tools under Proton, product=dayz header extensions and similar)
is maintained here.
Building from source
The build requires cargo, Rust’s package manager. No system libraries are needed: everything, including the RSA
code for sign and keygen, is pure Rust.
To compile and run, use:
cargo run
To build a release, use:
cargo build --release
Verifying downloads
Every release lists SHA256SUMS and SHA512SUMS of its archives, each with a detached GPG signature
(SHA256SUMS.asc, SHA512SUMS.asc). The signing key is
dayzmake release signing key (https://github.com/bzed/dayzmake)
ed25519, expires 2029-11-15
6624 41B3 6A57 85AD 18FB 8667 DF75 3D99 D064 EB7E
The public key is a release asset (dayzmake-release-key.asc) and is published at
https://bzed.github.io/dayzmake/release-key.asc. Get it from the site or from a release, and compare the
fingerprint with the one above (and with the one in the repository’s AGENTS.md) before you trust it.
Download the archive you want together with the checksum files and the key, from the release page or with the GitHub CLI (without a tag it downloads the latest release):
gh release download -R bzed/dayzmake -p '*debian-trixie*' -p 'SHA*' -p 'dayzmake-release-key.asc'
On Linux or macOS, in the folder with the downloaded files (the Linux archive is named like dayzmake-v3.2.0-debian-trixie-x86_64.tar.gz):
gpg --import dayzmake-release-key.asc
gpg --fingerprint 662441B36A5785AD18FB8667DF753D99D064EB7E
s=$(gpg --status-fd 1 --verify SHA256SUMS.asc SHA256SUMS 2>/dev/null)
[ "$(grep -c '^\[GNUPG:\] NEWSIG' <<<"$s")" = 1 ] &&
grep -q '^\[GNUPG:\] GOODSIG DF753D99D064EB7E ' <<<"$s" &&
grep -q '^\[GNUPG:\] VALIDSIG 662441B36A5785AD18FB8667DF753D99D064EB7E ' <<<"$s" &&
! grep -Eq '^\[GNUPG:\] (EXPSIG|EXPKEYSIG|REVKEYSIG|BADSIG|ERRSIG) ' <<<"$s" &&
echo 'signature OK'
sha256sum -c --ignore-missing SHA256SUMS
The check must print signature OK. Do not rely on the Good signature text or the exit status of a plain
gpg --verify: gpg prints that text, and exits with 0, for a signature of a key that has expired since. Only the
GOODSIG status line means that the signature is good and its key is neither expired nor revoked, and VALIDSIG
names the key that made it. The check also demands that the file holds exactly one signature and that no
EXPSIG, EXPKEYSIG, REVKEYSIG, BADSIG or ERRSIG line appears, so a second, bad signature cannot hide behind a good one. The warning that the key is not certified with a trusted signature is expected as long
as you have not signed it yourself, so the check ignores it; the fingerprint is what counts. sha256sum -c --ignore-missing checks
the archives you downloaded and ignores the ones you did not (on macOS use shasum -a 256 -c --ignore-missing).
SHA512SUMS works the same way with sha512sum.
On Windows, in PowerShell with Gpg4win installed, check the signature and compare the
hash of your download with its line in SHA256SUMS:
gpg --import dayzmake-release-key.asc
$s = @(gpg --status-fd 1 --verify SHA256SUMS.asc SHA256SUMS 2>$null)
(@($s | Select-String -Pattern '^\[GNUPG:\] NEWSIG').Count -eq 1) -and
[bool]($s | Select-String -Quiet -Pattern '^\[GNUPG:\] GOODSIG DF753D99D064EB7E ') -and
[bool]($s | Select-String -Quiet -Pattern '^\[GNUPG:\] VALIDSIG 662441B36A5785AD18FB8667DF753D99D064EB7E ') -and
-not ($s | Select-String -Quiet -Pattern '^\[GNUPG:\] (EXPSIG|EXPKEYSIG|REVKEYSIG|BADSIG|ERRSIG) ')
$file = 'dayzmake-v3.2.0-windows-x86_64.zip'
$expected = ((Select-String -SimpleMatch $file SHA256SUMS).Line -split '\s+')[0]
(Get-FileHash -Algorithm SHA256 $file).Hash -eq $expected.ToUpper()
The signature check and the last line must each print True.
A first mod, from folder to signed PBO
This guide builds a small script mod from an empty folder, signs it and lays it out the way DayZ servers and the Steam Workshop expect. It takes five minutes and needs only dayzmake. Every command below was run on a clean folder; the output is what dayzmake printed.
1. The source folder
A mod addon is a folder. Its name, or the line in $PBOPREFIX$, becomes the prefix: the path under which the
game sees the files. Create this layout:
mymod/
$PBOPREFIX$
config.cpp
scripts/4_world/player.c
$PBOPREFIX$ has one line, the prefix:
mymod
config.cpp registers the addon and its script module:
class CfgPatches
{
class MyMod_Scripts
{
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
requiredAddons[] = {"DZ_Data"};
};
};
class CfgMods
{
class MyMod
{
dir = "MyMod";
name = "My Mod";
type = "mod";
dependencies[] = {"World"};
class defs
{
class worldScriptModule
{
value = "";
files[] = {"MyMod/scripts/4_world"};
};
};
};
};
scripts/4_world/player.c is the script:
modded class PlayerBase {}
2. Build
build rapifies config.cpp to config.bin, packs the scripts and writes the PBO:
$ dayzmake build mymod mymod.pbo
$ dayzmake inspect mymod.pbo
Header extensions:
- prefix=mymod
# Files: 2
Path Method Original Packed
Size Size
================================================================================
config.bin 0 291 291
scripts\4_world\player.c 0 27 27
The prefix came from $PBOPREFIX$; config.cpp is stored as config.bin. If build printed warnings,
read them: they point at real mistakes (see Warnings). Building the same folder
again gives the same bytes.
3. Make a key pair
A key pair belongs to you, not to a mod: use the same one for all your mods, so that servers need only one
.bikey of yours.
$ dayzmake keygen mykey
$ ls mykey.*
mykey.bikey mykey.biprivatekey
mykey.biprivatekey is the secret half and is created readable by you only. Never commit it, never upload it.
mykey.bikey is public; it goes to servers and into your mod.
4. Build and sign in one step
$ dayzmake build -k mykey.biprivatekey -f mymod mymod.pbo
$ ls mymod*
mymod.pbo mymod.pbo.mykey.bisign
The signature file is named after the PBO and the key. It must stay next to the PBO under that name. (-f
overwrites the PBO of step 2.) You can also sign an existing PBO: dayzmake sign mykey.biprivatekey mymod.pbo.
5. Check it
$ dayzmake verify mykey.bikey mymod.pbo
$ echo $?
0
verify prints nothing when the signature is valid. After any change to the PBO the signature is wrong, so sign
again after every rebuild; build -k does that for you.
6. The Workshop and server layout
A mod folder, as it is uploaded to the Steam Workshop and as servers load it with -mod=@MyMod, looks like
this:
@MyMod/
addons/
mymod.pbo
mymod.pbo.mykey.bisign
keys/
mykey.bikey
$ mkdir -p @MyMod/addons @MyMod/keys
$ cp mymod.pbo mymod.pbo.mykey.bisign @MyMod/addons/
$ cp mykey.bikey @MyMod/keys/
Upload tools may add a meta.cpp with the mod’s name and Workshop id to this folder; you do not need to write one,
and dayzmake only reads its name line, if there is one, to show a name in dayzmake api mods.
A server owner copies mykey.bikey into the keys folder of the server; the server then accepts clients that
load PBOs signed with mykey. A client without a matching signature is rejected with a signature error.
With a mod laid out like this you can ask dayzmake about its scripts: dayzmake api -m @MyMod class PlayerBase
(see Looking up the script API).
7. Looking inside
$ dayzmake cat mymod.pbo 'scripts\4_world\player.c'
modded class PlayerBase {}
$ dayzmake unpack mymod.pbo out
$ find out -type f
out/config.bin
out/$PBOPREFIX$
out/scripts/4_world/player.c
config.bin in the unpacked folder is rapified; read it with dayzmake derapify out/config.bin.
Where to go next
- Configs with includes and macros: Config files and the preprocessor.
- Models and textures: Textures and model checks and Binarizing models on Linux.
- All options of the commands used here: PBOs and Keys and signatures.
Config files and the preprocessor
DayZ configs (config.cpp, .rvmat, model.cfg) are written in a C-like language with a preprocessor. This
guide shows what the preprocessor does, how includes are found and how to convert between the text and binary
forms. The example has this layout:
cfg/config.cpp
cfg/inc/common.hpp
shared/$PBOPREFIX$ # contains one line: shared
shared/lib/defs.hpp
cfg/inc/common.hpp:
#define ITEM_SIZE 4
#define LABEL(x) #x
shared/lib/defs.hpp:
#define BASE_WEIGHT 100
cfg/config.cpp:
#include "inc/common.hpp"
#include "\shared\lib\defs.hpp"
class CfgVehicles
{
class Inventory_Base;
class MyItem: Inventory_Base
{
scope = 2;
displayName = "My item";
itemSize[] = {ITEM_SIZE, __EVAL(2*2)};
descriptionShort = LABEL(Spare part);
weight = BASE_WEIGHT;
absorbency = 0.5;
};
};
Two kinds of include
- Relative includes (
"inc/common.hpp") are looked up next to the file that contains the#include. Forward and backward slashes both work. - Absolute includes (
"\shared\lib\defs.hpp", starting with a backslash) name a path inside a PBO. The folders given with-iare searched for a file whose path ends in that path, taking$PBOPREFIX$into account: the foldersharedhas the prefixshared, so\shared\lib\defs.hppisshared/lib/defs.hpp. The current directory is only checked for the exact path, never searched, so it is safe to run dayzmake in a big folder.
Without -i, the absolute include is not found, and the error names file and line:
$ cd cfg
$ dayzmake preprocess config.cpp
error: File "\shared\lib\defs.hpp" included from "config.cpp:2" not found.
With -i:
$ dayzmake preprocess -i ../shared config.cpp
class CfgVehicles
{
class Inventory_Base;
class MyItem: Inventory_Base
{
scope = 2;
displayName = "My item";
itemSize[] = {4, __EVAL(2*2)};
descriptionShort = "Spare part";
weight = 100;
absorbency = 0.5;
};
};
ITEM_SIZE and BASE_WEIGHT were replaced, LABEL(Spare part) became a quoted string through #x, and the
two include lines left blank lines. __EVAL(2*2) is only evaluated when the config is parsed.
If an include matches only when case is ignored, dayzmake uses it and warns (include-case), because the game
treats those names case-insensitively but your Linux file system does not:
$ dayzmake rapify inc.cpp /dev/null -f
warning: Include "Inc/Common.HPP" only matched "…/inc/common.hpp" ignoring case. [include-case]
Rapify and derapify
$ dayzmake rapify -i ../shared config.cpp config.bin
$ dayzmake derapify config.bin
class CfgVehicles {
class Inventory_Base;
class MyItem: Inventory_Base {
scope = 2;
displayName = "My item";
itemSize[] = {4, 4};
descriptionShort = "Spare part";
weight = 100;
absorbency = 0.5;
};
};
__EVAL has been calculated, the macros are gone and comments are not kept. derapify is how you read the
config.bin of any PBO (dayzmake cat some.pbo config.bin | dayzmake derapify). Both commands read standard input
and write standard output when the file arguments are left out, so they work in pipelines.
You rarely need rapify yourself: build rapifies every .cpp and .rvmat in the folder and passes the
include folders on (dayzmake build -i ../shared mymod mymod.pbo).
Mistakes the parser reports
An unquoted value is accepted with a warning, and delete and += are supported:
$ dayzmake rapify warn.cpp w.bin # class A { name = hello; z = ; };
In file warn.cpp:1: warning: String value "hello" is not quoted properly. [unquoted-string]
In file warn.cpp:1: warning: Entry "z" has no value; it is stored as an empty string. [empty-value]
$ dayzmake rapify -w unquoted-string -w empty-value warn.cpp -f w.bin
A real syntax error stops the command:
$ dayzmake rapify bad.cpp # class A { x = 1 (no final newline)
error: In line bad.cpp:1:
class A { x = 1
^
Unexpected token "\n", expected: one of ".", ";", ['0'..='9'], ['e' | 'E'], [_]
A macro called with the wrong number of arguments is a warning that names the line:
$ dayzmake rapify mac.cpp -f /dev/null # #define M(a,b) a+b / class A { x = M(1); };
In file mac.cpp:2: warning: Macro "M" expects 2 argument(s), got 1 [macro-arg-count]
In file mac.cpp:2: warning: Entry "x" has no value; it is stored as an empty string. [empty-value]
See the reference for every option.
Binarizing models on Linux
DayZ models are authored as editable .p3d files (MLOD) and must be converted to the binary format (ODOL)
before they are packed into a mod for release. The converter is Bohemia’s binarize.exe, which only runs on
Windows. On Linux dayzmake runs it for you under Proton, the compatibility layer of Steam.
Without any setup, dayzmake build still works on Linux: it copies .p3d and .rtm files as they are and warns
with non-windows-binarization. This guide sets up real binarization.
The commands that start
binarize.execould not be run for this manual, because it needs DayZ Tools and Proton, which are not part of the repository. The failure messages shown below are real; the description of a successful run follows the program’s source and README.
What you need
- Steam with the DayZ Tools app installed (Steam app 830640, in the Tools category of your library).
- Proton, installed through Steam: any of Proton Hotfix, Proton - Experimental, Proton Experimental, or a numbered Proton. Start any Windows game with it once, or install it from the Steam Tools list.
- dayzmake finds both through the Steam folder. If your Steam is in a usual place (
~/.steam/steam,~/.steam/debian-installation,~/.local/share/Steam) nothing needs to be set.
First try
$ dayzmake build --proton-binarize mymod mymod.pbo
The first model needs a Wine prefix, which is created in a temporary sandbox and takes up to a few minutes
on a cold start (dayzmake says so: Creating a Wine prefix for binarize.exe (the first run takes a while)...).
Later models in the same run are quick. The sandbox is removed at the end of the run and nothing in the Steam
folder is changed.
For a single model:
$ dayzmake binarize mymod/model.p3d model_binarized.p3d
binarize treats the folder of the model as the addon and its name as the prefix. That is right only for a model
in the root of a single-component addon. For a model in a subfolder (data\) or an addon with a prefix like
my\mod, use build --proton-binarize, which reads the prefix from $PBOPREFIX$.
Telling dayzmake where things are
The variables are all optional; set them in your shell or in front of the command.
| Variable | Use |
|---|---|
STEAM_ROOT | The Steam folder, if it is not in a usual place. It must contain steamapps/common. |
DAYZ_TOOLS | The DayZ Tools folder, if it is not <steam>/steamapps/common/DayZ Tools. It must contain Bin/Binarize/binarize.exe. |
PROTON | The Proton folder (the one with the proton script). Default: Proton Hotfix, then Proton - Experimental, then Proton Experimental, then the alphabetically last Proton* folder. |
BIOUTPUT=1 | Show what binarize.exe and Proton print. Use it when a model fails. |
The error messages name what is missing and the variable that fixes it:
$ STEAM_ROOT=/nonexistent HOME=/nonexistent dayzmake binarize t21/small.p3d -f x.p3d
error: No Steam installation found (set STEAM_ROOT, or DAYZ_TOOLS to the DayZ Tools folder).
$ DAYZ_TOOLS=/nonexistent dayzmake binarize t21/small.p3d -f x.p3d
error: binarize.exe not found in "/nonexistent". Install DayZ Tools (Steam app 830640) or set DAYZ_TOOLS.
$ dayzmake binarize t21/small.p3d -f x.p3d # DayZ Tools present, no Proton installed
error: No Proton found under "…/steam/steamapps/common". Install one in Steam or set PROTON.
Textures: why paths matter
binarize.exe resolves texture and material paths such as my\mod\data\x_ca.paa relative to a project root and
sets a model’s alpha flags only if it can read the texture. dayzmake therefore gives the sandbox a P: drive with
your addon linked at its prefix (P:\my\mod points at your source folder) and runs binarize.exe from P:\.
Paths outside your addon (vanilla dz\...) stay unresolved, and binarize.exe’s complaint about them is shown
as the warning binarize-missing-texture. The model is still produced.
The source folder is linked, not copied, so binarize.exe could in principle write into it. Its output goes to
the sandbox, and dayzmake does not change your source folder.
Models that are already binarized
A model that is already binarized (ODOL, or BMTR for animations) never reaches binarize.exe. It is copied
unchanged with the warning prebinarized-file, which names the format and version (for example ODOL v58).
Any version is accepted; dayzmake cannot know which ones the game loads.
Checking a build
build checks every editable model for textures and materials that are missing from the addon, with or without
--proton-binarize (see Textures and model checks). A good routine on Linux:
dayzmake build mymod mymod.pbowhile you work: fast, copies models, reports missing files.dayzmake build --proton-binarize -k mykey.biprivatekey -f mymod mymod.pbofor the release.dayzmake inspect mymod.pboto see what was packed and how big it is.
See binarize and Environment and files for details.
Textures and model checks
DayZ textures are PAA files. dayzmake converts them from and to ordinary images and checks that the models in your addon do not reference textures that are missing.
From an image to a PAA and back
Start from a PNG, tex.png, 64 by 64 pixels:
$ dayzmake img2paa tex.png t21/data/a_co.paa
$ dayzmake img2paa -t dxt1 tex.png t21/data/b_co.paa
$ dayzmake img2paa -t rgba tex.png t21/data/c.paa
$ ls -l t21/data
-rw-r--r-- 1 me me 5577 a_co.paa
-rw-r--r-- 1 me me 2849 b_co.paa
-rw-r--r-- 1 me me 21945 c.paa
The -t option chooses the pixel format:
| Type | Use it for | Size of 64 by 64 |
|---|---|---|
dxt1 | no alpha or 1-bit alpha; the smallest | 2849 bytes |
dxt3 | explicit 4-bit alpha | not measured here |
dxt5 (default) | interpolated alpha | 5577 bytes |
rgba | uncompressed 8-bit RGBA, no loss | 21945 bytes |
dayzmake builds the mipmap chain itself (down to 4 pixels on a side). It does not resize your image, so make it
a power of two before. Mipmaps wider than 128 pixels of the DXT types are LZO-compressed automatically, so -c does not change the file.
To look at a PAA from a mod or the game, convert it to an image; the format follows the extension:
$ dayzmake paa2img t21/data/a_co.paa back.png
$ file back.png
back.png: PNG image data, 64 x 64, 8-bit/color RGBA, non-interlaced
paa2img also reads the 16-bit formats ARGB4444, ARGB1555 and AI88 (grey with alpha) that the game uses for
noise and detail maps. A .paa that is really a PNG file gets an error that says so; convert the image with
img2paa.
Checking the textures of your models
dayzmake inspect on a model lists its textures and materials:
$ dayzmake inspect t21/small.p3d
Format: MLOD (editable model)
Version: 257
LODs: 2
# LOD Points Faces Normals UV sets
0 Resolution 1 4 3 2 2
1 Memory 4 0 2 0
Textures:
- #(argb,8,8,3)color(0.5,0.5,0.5,1,CO) (1 faces)
- t21\data\a_co.paa (1 faces)
- t21\data\gone_co.paa (1 faces)
Materials:
- t21\data\m.rvmat (2 faces)
Properties:
- LOD 0: class = house
- LOD 0: autocenter = 0
- LOD 1: x = y
Selections:
- LOD 0 (Resolution 1): body, old
- LOD 1 (Memory): start
A binarized ODOL v56 model is listed as well (LODs, textures, materials, proxies, selections, animations); for other ODOL versions and for BMTR only format and version are shown.
build goes further: it checks every editable model it is about to pack, with or without
--proton-binarize, against the files in the addon:
$ dayzmake build t21 t21.pbo
In file small.p3d: warning: Model references texture "t21\data\gone_co.paa", which is not in the addon. [missing-texture]
In file small.p3d: warning: Model references material "t21\data\m.rvmat", which is not in the addon. [missing-material]
In file small.p3d: warning: On non-Windows systems binarize.exe is only used with --proton-binarize; file will be copied as-is. [non-windows-binarization]
How references are judged:
- A reference that starts with the addon’s prefix (
t21\...) is looked up in the source folder, ignoring case. If it is not there, it is reported. Herea_co.paaexists (the model uses it),gone_co.paadoes not. - Other references (vanilla
dz\..., other mods) are only checked if they exist below an-ifolder or the current directory. If they do not, they are not reported, because there is no way to tell whether they are wrong. - Procedural textures such as
#(argb,8,8,3)color(...)are skipped. - Mute the checks with
-w missing-textureand-w missing-materialif you must.
A file with the .p3d extension that is not a model is not fatal; it is reported once and copied:
In file data/broken.p3d: warning: Cannot check textures and materials: not an MLOD model [model-unreadable]
See Warnings for every message and Textures for the options.
Looking up the script API
DayZ scripts (Enforce Script) have no official reference that stays current. dayzmake api reads the scripts of
the game you have installed, dta/scripts.pbo, indexes the classes, members and enums once and answers lookups in
milliseconds, without extracting anything. It can also index the scripts of mods, so that you see vanilla and
mod declarations side by side.
The examples use a tiny stand-in game so that the output is short and reproducible. It has Entity, ItemBase,
PlayerBase and Apple, the enum EStatTypes, and the stand-in is selected with --dayz dz. With your real
Steam install leave --dayz out: dayzmake finds the game itself (see Environment and files).
Who calls this?
api find matches declarations only. To find call sites and other usages, search the script bodies with
api grep; the lines are matched as they are in the source, comments included:
$ dayzmake api grep 'GetGame\(\)\.GetMission\(\)' --max 2
scripts\3_Game\Sandstorm.c:95: \t\t\tGetGame().GetMission().GetWorldData().WeatherSandstormStart(continuedSession);
scripts\3_Game\Sandstorm.c:115: \t\t\tGetGame().GetMission().GetWorldData().WeatherSandstormStop(calledByWeather);
... 4 more lines (raise --max or narrow the query)
Add --ignore-case for a case-insensitive match and -m cf to search a mod’s scripts too. See
api grep.
Reading the game sources
For everything the index does not answer, extract the sources once and use your editor and grep. extract unpacks
every PBO of an install under its prefix and derapifies the configs, so dz\scripts ends up in dz/scripts
and every config.bin is a config.cpp:
$ dayzmake extract --derapify --only '*.c' --only '*.bin' --only '*.cpp' --only '*.h' ~/DayZ game-sources
game-sources/pbo-map.tsv tells which PBO a prefix came from. Run it again with -f after a game update: the old
tree is replaced in one step and files that no longer exist are gone. A mod folder (@Foo) or a single PBO works
the same. See extract.
What does this class have?
$ dayzmake api --dayz dz class PlayerBase
class PlayerBase : Entity
bool IsAlive() // Returns true while the player is alive.
void OnRPC(PlayerIdentity sender,int rpc_type,ParamsReadContext ctx)
The first line is the class and its base. Members are sorted; documentation comments (//!) from the source
follow the member. class shows the class itself; add --inherited to see the members of the base classes too,
and --max to see more than 120 lines.
$ dayzmake api --dayz dz class --inherited ItemBase
class ItemBase : Entity
int m_Quantity
static const int MAX_STACK=100
int GetQuantity() // Quantity of the item in its stack.
void SetQuantity(int value,bool destroy_config=true)
class Entity
protected float m_Health
float GetHealth() // Current health of the entity.
void OnRPC(PlayerIdentity sender,int rpc_type,ParamsReadContext ctx)
void SetHealth(float value)
What does this config class inherit?
api config is the same lookup for configs (config.bin and config.cpp): what does CfgVehicles/Hatchback_02
inherit, and what is its resolved displayName? It merges the configs of the game and of the mods in load order,
as the engine does, so the answer includes what mods change.
$ dayzmake api config CfgVehicles/Hatchback_02 --max 6
CfgVehicles/Hatchback_02
chain: Hatchback_02 : CarScript : Car : Transport : All
defined in (2):
[vanilla] Addons/vehicles_wheeled.pbo
[vanilla] Addons/sounds_hpp.pbo
properties (77):
... 80 more lines (raise --max or narrow the query)
Every property is tagged with the class it comes from (displayName = "..." (from Hatchback_02)), and the lines
after the properties list the classes declared inside the class and its subclasses. Add -m <mods> to see a class
as the mods leave it, --json for a structured object. The first run builds one cached index per source, which
takes a moment for the game; later runs read the cache. See api config.
Where is it, and what derives from it?
$ dayzmake api --dayz dz chain Apple
Apple > ItemBase > Entity
$ dayzmake api --dayz dz sub Entity
ItemBase PlayerBase
$ dayzmake api --dayz dz sub --all Entity
ItemBase PlayerBase Apple
$ dayzmake api --dayz dz src PlayerBase
[vanilla] dta/scripts.pbo scripts\4_world\player.c:1
$ dayzmake api --dayz dz src --cat Apple
// ==== [vanilla] dta/scripts.pbo scripts\4_world\player.c:8
class PlayerBase extends Entity
…
src tells you the PBO, the path inside it and the line; src --cat prints the files, with a header line for
each, so you can read the code around a declaration.
Search
find takes a case-insensitive regular expression and searches member names, signatures, doc comments, class
names and enum items. Anchor it to look for names:
$ dayzmake api --dayz dz find '^OnRPC'
Entity: void OnRPC(PlayerIdentity sender,int rpc_type,ParamsReadContext ctx)
PlayerBase: void OnRPC(PlayerIdentity sender,int rpc_type,ParamsReadContext ctx)
$ dayzmake api --dayz dz find --class ItemBase quantity
ItemBase: int m_Quantity
ItemBase: int GetQuantity() // Quantity of the item in its stack.
ItemBase: void SetQuantity(int value,bool destroy_config=true)
enum shows the values of an enum, computed the way the compiler does (an item without a value continues from
the previous one):
$ dayzmake api --dayz dz enum EStatTypes
enum EStatTypes
HEALTH = 0
BLOOD = 1
SHOCK = 10
WATER = 11
Adding mods
A mod is selected with -m. Without it only vanilla is queried, so a query never mixes in mods by surprise.
$ dayzmake api --dayz dz class -m @MyMod PlayerBase
class PlayerBase : Entity [vanilla 4_world]
bool IsAlive() // Returns true while the player is alive.
void OnRPC(PlayerIdentity sender,int rpc_type,ParamsReadContext ctx)
class PlayerBase [_MyMod 4_world] [modded]
void Heal(float amount) // Added by MyMod.
The mod’s modded class adds Heal. --mods-only shows only the mod’s part. What -m accepts:
- a folder, such as
@MyModabove (it needs anaddonsfolder with PBOs); - a Steam Workshop id, or the name of an installed mod (
-m "my mod", a unique part is enough); - the aliases
cf,cot,dabs,expansionfor the well-known frameworks, oraliasesfor all four; allfor every installed mod that has scripts.
dayzmake api mods lists what is installed:
$ dayzmake api mods
1234567890 My Mod …/steamapps/workshop/content/221100/1234567890 scripts
The first query with a mod indexes its PBOs, which can take a while for big mods; the result is cached, and a
query with -m all indexes each mod only once. To pay that cost ahead of time, for example after a game update:
$ dayzmake api -m all update
vanilla-stable: 4 classes, stable build 17000000
mod-My_Mod-stable-ceb44f75: 2 classes, stable
Compile-time defines of mods (the defines[] of CfgMods and #define in scripts) are listed with defines:
$ dayzmake api --dayz dz defines -m @MyMod 'MYMOD|SERVER'
[_MyMod] mymod: MYMOD
Branches
The stable branch is the default. --experimental queries the experimental branch, whose install the same Steam
libraries are searched for; if it is not installed you get an error that tells you to pass --dayz <dir>.
JSON for scripts and tools
Every query takes --json, and then prints one line of JSON: {"result": {...}, "truncated": N}. Pipe it into
jq:
$ dayzmake api --dayz dz find --json OnRPC | jq -r '.result.Matches[] | [.scope, .member.decl.path, .member.decl.line] | @tsv'
Entity 3_Game\\entity.c 15
PlayerBase 4_world\\player.c 5
$ dayzmake api --dayz dz enum --json EStatTypes | jq -c '.result.Enums[0].en.items[] | {name, value}'
{"name":"HEALTH","value":0}
{"name":"BLOOD","value":1}
{"name":"SHOCK","value":10}
{"name":"WATER","value":11}
$ dayzmake api --dayz dz src --json -m @MyMod PlayerBase | jq -r '.result.Sources[] | "\(.index) \(.pbo) \(.path):\(.line)"'
vanilla dta/scripts.pbo 4_world\player.c:1
_MyMod addons/mymod.pbo 4_world\mymod.c:1
The key inside result names the kind: Classes, Matches, Names, Enums, Chain, Sources, Defines.
truncated is the number of items that --max cut off. The text output of the same commands is the stable thing
to read for humans; the JSON is the stable thing to program against.
The cache
Indexes are cached as JSON files, so later queries are instant. A cache is rebuilt by itself when a PBO changes
(size or modification time). --refresh rebuilds it by force, api update rebuilds without answering a query,
and deleting the folder is always safe. Where it lives: Environment and files. If
the folder cannot be written, queries still work, slowly, with the warning api-cache.
The same lookups are available to AI assistants as tools: see Using dayzmake from an MCP client.
Navigation meshes for a terrain mod
A custom terrain needs a navmesh so that infected, animals and AI can walk on it. The game cannot compute one
from the terrain files alone: it asks a running DayZDiag_x64.exe for the geometry of the world, and
dayzmake navmesh generate does that and builds the .nm file. This guide goes from a built terrain mod to a navmesh
in the mod. The reference lists every command and option.
The generator has been compared with the navmeshes shipped with DayZ 1.30 (see Validation at the end). Check the first mesh you build in the game before you ship it all the same.
The
dayzmakeoutputs shown here are real: they were produced against a test server that serves a small synthetic world. The Linux command line that starts the game was run with DayZ 1.30 under GE-Proton11-1 (the example below namesProton - Experimentalas a generic path; any Proton build should do, GE-Proton11-1 is the one tested). The Windows command line has the same options but was not run on Windows. Neither is part of the automated tests, because they need DayZ.
What you need
- A built terrain mod: the PBOs of your world (see A first mod for building PBOs). It already loads in the game, only without a navmesh, or with an old one.
- DayZ (the client, Steam app 221100), which contains
DayZDiag_x64.exe, the diagnostic build that has the navmesh data server. - On Linux, Proton (see Binarizing models on Linux for installing it through Steam).
- A few gigabytes of free memory for the game and, for a large map, time: the tiles of a big world take minutes to hours (see Speed below).
1. Start the data server
DayZDiag_x64.exe is started like a dedicated server with the extra option -startNavmeshDataServer. It loads
your world and then listens on TCP port 36533 for requests for geometry. The port is fixed by the game; the
normal game port is not, and must not be the default, so that a real server on the same machine is not disturbed.
The server files (both systems)
Keep the files of the data server in a folder of your own, outside the game installation: here C:\dayz-navmesh
on Windows and ~/dayz-navmesh on Linux. It holds
serverDZ_navmesh.cfg: a copy of the stockserverDZ.cfgthat does not check signatures and does not start BattlEye, so it has the linesverifySignatures = 0;andBattlEye = 0;, and whose missiontemplatenames your mission, for exampletemplate="dayzOffline.mymap";;- the mission, in the folder
mpmissionsof that folder: a complete copy of a mission folder, in which onlyinit.cis replaced by an emptymain(). For a stock map this is a copy of its own stock mission under its own name (DayZServer/mpmissions/dayzOffline.enoch,dayzOffline.nasdara); for your terrain it is a copy of your mod’s own full mission (dayzOffline.<yourworld>):
void main()
{
}
Do not shorten the mission to the init.c alone: a folder that contains only init.c makes the server log
[Server] :: termination in: 10 and exit about 7 seconds after the start, before the data server opens.
On Windows
Start the server from the DayZ folder, with full paths, your mod and a game port that is not 2302:
DayZDiag_x64.exe -server -startNavmeshDataServer -config=C:\dayz-navmesh\serverDZ_navmesh.cfg -mission=C:\dayz-navmesh\mpmissions\dayzOffline.mymap -profiles=C:\dayz-navmesh\profiles -port=2402 -dologs -adminlog -nosplash -nopause "-mod=@MyTerrain"
@MyTerrain is the folder of your mod in the DayZ folder. -profiles= puts the RPT and the script logs into that
folder. A stock DLC map such as Badlands (dayzOffline.nasdara) needs no -mod. Keep the window open while you
generate, and wait for the data server before you use it (see Check the connection below).
On Linux, under Proton
The Windows program runs through Proton, from the client installation (steamapps/common/DayZ), which has
DayZDiag_x64.exe. Run it the way Steam would, with the environment of the game. The program is a Windows program:
it sees the Linux file system as drive Z:, so /home/you/dayz-navmesh/serverDZ_navmesh.cfg is written
Z:\home\you\dayz-navmesh\serverDZ_navmesh.cfg.
export STEAM_ROOT="$HOME/.local/share/Steam" # your Steam folder
export STEAM_COMPAT_CLIENT_INSTALL_PATH="$STEAM_ROOT"
export STEAM_COMPAT_DATA_PATH="$STEAM_ROOT/steamapps/compatdata/221100"
export STEAM_COMPAT_INSTALL_PATH="$STEAM_ROOT/steamapps/common/DayZ"
export STEAM_COMPAT_APP_ID=221100 SteamAppId=221100 SteamGameId=221100
cd "$STEAM_COMPAT_INSTALL_PATH"
"$STEAM_ROOT/steamapps/common/Proton - Experimental/proton" run ./DayZDiag_x64.exe \
-server -startNavmeshDataServer \
"-config=Z:\home\you\dayz-navmesh\serverDZ_navmesh.cfg" \
"-mission=Z:\home\you\dayz-navmesh\mpmissions\dayzOffline.mymap" \
"-profiles=Z:\home\you\dayz-navmesh\profiles" \
-port=2402 -dologs -adminlog -nosplash -nopause "-mod=@MyTerrain"
For a stock map such as Badlands leave out -mod.
Some points that are easy to get wrong:
- The mod must be inside the DayZ folder. A
-mod=path outside it fails withCannot open file. Make a symbolic link@MyTerraininsteamapps/common/DayZthat points to your mod folder, and remove it when you are done. Do not change or delete any other file of the installation. - The server files stay in your own folder (see above); give
-config=,-mission=and-profiles=asZ:\paths, as shown. A plain Linux path does not work for the Windows program. With-profiles=the RPT and the script logs end up in that folder. - Use a game port other than the default 2302 (
-port=2402above). The data server port 36533 cannot be changed. - Start only one game at a time, and stop
DayZDiag_x64.exewhen you have your navmesh.
2. Check the connection with probe
The data server opens port 36533 about 25 seconds after the start. A connection made while the world is still
loading can be reset (Connection reset by peer), so run probe until it answers instead of connecting as soon as
the port shows up.
dayzmake navmesh probe connects, asks for the world parameters and prints them. If it works, the data server is up
and the world is the one you expect (the size and the tile grid):
$ dayzmake navmesh probe
world 150.0 x 150.0 m, tiles 3 x 3 of 50.0 x 50.0 m
deep sea height 0.75, deep water depth 1.50, contour error 0.300, obstacles 1, block 4
filter islands 1, seed (60.0, 10.0, 60.0)
agent: stand 1.50 crouch 1.00 prone 0.50 diameter 0.60 step 0.45 slope 45.0
cell class 0: 200 cells over 50.00 m (cs 0.250) [unk 200 0]
cell class 1: 500 cells over 50.00 m (cs 0.100) [unk 500 0]
link 0: typeId -1 len 1.80 height 1.20 centre 0.40 dropdown 0.00..0.00 agent h 1.50 step 0.45 r 0.30 flags 0x100 area 48
(This is the synthetic test world; a real map is much larger, for example 15360 by 15360 m.) The game may be on
another machine: dayzmake navmesh probe --server 192.168.1.20. --tile 1,1 also fetches one tile, which shows
that the geometry arrives.
When the server is not running the answer tells you what to do:
$ dayzmake navmesh probe --server 127.0.0.1:9
error: cannot connect to 127.0.0.1:9: Connection refused (os error 111); start DayZDiag_x64.exe with -server -startNavmeshDataServer
3. Generate
First try a few tiles to see that everything works, then the whole world:
$ dayzmake navmesh generate --range 0,0,2,0 test.nm
$ dayzmake navmesh generate mymap.nm
--range x0,z0,x1,z1 limits the run to a block of tiles (columns and rows from 0). --record <file> also saves
the geometry that arrives (see Regenerating). Progress goes to standard error; the summary of a run on the
synthetic world looks like this:
$ dayzmake navmesh generate --capture world.dzgeo --threads 2 mymap.nm
built 9 tiles, 0 empty, 0 failed in 0.4 s
island filter: seed (60.0 10.0 60.0) -> 84 reachable, 1 isolated polys
wrote mymap.nm
What the lines say: tiles built have walkable ground; empty ones have none (open sea, for example); failed
ones could not be built or fetched and are listed (the first twenty) and exit status 1 is the result. The island
filter flags polygons that cannot be reached from the world’s seed position (a spot that must be walkable, like
the middle of a town) as isolated, so that the AI does not wander onto separate pieces. --seed x,y,z chooses
another spot, and --no-island-filter switches it off.
info shows what you got:
$ dayzmake navmesh info mymap.nm
navmesh version 9, grid 3 x 3 tiles of 50.0 x 50.0 m, max tiles 9
tiles 9, polys 85, verts 159, off-mesh connections 12
An existing target is never overwritten without -f; this is checked before the first tile is fetched, so you do
not lose a long run to it:
$ dayzmake navmesh generate --capture world.dzgeo mymap.nm
error: Target file "mymap.nm" already exists. Use --force to overwrite.
Options that change the mesh: --doors closed|open|enabled (the door state that is baked in; the default is
closed), --no-links (no jump, climb or ladder links) and --sea-level <m>. Leave them alone unless you know
you need them.
Speed
Tiles are fetched and built in parallel: --threads builder threads (the default is the number of cores minus one)
and one connection per --server (--connections changes that; keep it at one per DayZDiag_x64.exe, which serves
one client at a time). If fetching is the slow part, start DayZDiag_x64.exe on several machines and give
--server a --server b --server c; they must load the same world.
The output does not depend on the number of threads, connections or servers.
When a run is interrupted
The mesh is written even when the run was partial, and --checkpoint <n> writes it after every n tiles, so a
long run can be killed without losing much. Each checkpoint rewrites the whole file, so give a large n (hundreds
or thousands of tiles), not a small one. To continue, give the file as the base and skip what it has:
$ dayzmake navmesh generate --server 127.0.0.1:36533 --range 0,0,2,0 --threads 2 --record rec.dzgeo part.nm
warning: island filter skipped: no polygon near the seed (60.0 10.0 60.0) [navmesh-seed]
built 3 tiles, 0 empty, 0 failed in 0.1 s
wrote part.nm
$ dayzmake navmesh generate --server 127.0.0.1:36533 --base part.nm --skip-existing --threads 2 -f part.nm
built 6 tiles, 0 empty, 0 failed in 0.3 s
island filter: seed (60.0 10.0 60.0) -> 84 reachable, 1 isolated polys
wrote part.nm
The second run built only the six tiles the first did not, and filtered islands over the whole mesh. The result is the
same as an uninterrupted run. When a run is stopped (a checkpoint or --record file that cannot be written) or
some tiles could not be fetched (and none failed to build), the summary ends with the command to continue, for
example to continue: dayzmake navmesh generate --base mymap.nm --skip-existing -f --server a --range 0,0,9,9 mymap.nm.
It repeats every option of the first run (--doors, --sea-level, --no-links, --seed, …) except --record
and --base: the options must stay the same, or the rest of the mesh would be built differently from the first part,
and a repeated --record with -f would overwrite the first recording. A tile that failed to build is not offered
for a retry, because it would fail again; look at the error that was listed for it. A short run before the full
one (--range) shows a warning that the island filter was skipped when the seed is not in the built tiles: that is
expected, and the full run does it.
4. Put the file into the mod and rebuild
The world’s config names its navmesh with navmeshName in its CfgWorlds class. Copy mymap.nm to the path that
property gives, inside the mod’s folder tree (for example, with the prefix mymap and
navmeshName = "mymap\navmesh\mymap.nm"; that is
navmesh/mymap.nm in the addon folder), and build the PBO again:
$ dayzmake build mymap mymap.pbo
.nm files are copied into the PBO as they are. Sign the PBO as usual (see
Keys and signatures).
Load the mod in a server and check that the log has no Unable to load navmesh.
Regenerating
After a change of the terrain (new roads, objects, buildings, heightmap) the navmesh is out of date: generate it
again from a fresh DayZDiag_x64.exe that loads the new mod. To change only an area, build only its tiles into the
old file:
$ dayzmake navmesh generate --base mymap.nm --range 10,20,14,24 -f mymap.nm
The new tiles replace those of their cells; the other tiles stay, and a tile that became empty is removed.
Regenerating offline. With --record the geometry that came from the game is saved in a .dzgeo file. Later you
can build again from it without starting the game, for example with another door state or after an update of dayzmake:
$ dayzmake navmesh generate --server 127.0.0.1:36533 --record mymap.dzgeo mymap.nm
$ dayzmake navmesh generate --capture mymap.dzgeo --doors open -f mymap-open.nm
A capture holds the geometry of a whole world, so it is large; keep it with your mod’s sources, not in the PBO. A
capture of a whole map can be tens of gigabytes; building a --range from it reads only the tiles of that range, so a
small range stays fast and small.
Good to know
- On x86 and x86_64 computers the generator uses the same approximate reciprocal square root as DayZ, so the mesh is what DayZ itself would make. On other processors (ARM) it uses an exact division instead: a slope that is almost exactly the maximum slope can then be classified differently, and the file differs in a few polygons. The approximate instruction itself can also give different results on Intel and AMD CPUs, so two x86 machines can differ in such a polygon too. All of them are valid meshes.
- Objects with moving parts (for example the top of a tall tower that turns slowly) are sent in the pose they have
when the tile is requested, so the same object has a different pose in each tile, and in a mesh that
shipped with the game it had yet another one. The tiles around such an object can differ in a few polygons and in
the height bound in their header (
bmaxy); this is a property of the data, and the mesh is valid. The same goes for the order of several door objects in one tile, which the game does not always send in the same order, and which decides which of two overlapping door footprints a cell belongs to. - The generator never modifies the game, the server or your mod: it only reads from the data server and writes the files you name.
- Warnings are explained in Warnings:
navmesh-tile-failed,navmesh-stray-partandnavmesh-seed.
Validation
The generator was compared with the navmeshes that ship with DayZ 1.30, using captures made from a live
DayZDiag_x64.exe (GE-Proton) on Livonia and on Badlands. Only the inner tiles can be compared, one tile in from
the edge of what was built: an off-mesh connection (jump or climb link) into a neighbouring tile has its far end
snapped to that tile’s mesh only when the neighbour exists, and the tiles at the edge of a block have neighbours
outside the capture. Two parts of a tile are left out of every comparison and are not errors: the polygon flags (they
come from the island filter, which was off) and the Detour link array between polygons and its size, which stock
Detour builds when a tile is added to the mesh, so what is stored is not meaningful for a comparison.
-
The central half of Badlands. Tiles 48-278 on both axes were rebuilt from one live capture (DayZ 1.30, recorded 2026-11-18) with the island filter off: 53,358 tiles built, none failed, in 1124 s on 24 cores. Of the 52,441 inner tiles (49-277) 52,381 are byte-identical to the shipped mesh. The other 60 all have a known cause:
- 44 lie in the area of the animated towers (171-178 x 210-230). Objects with moving parts are sent in the pose they have at the moment of the request, so the same object has a different pose in each tile and in the shipped mesh: this is a property of the data, not of the generator;
- 8 differ in the order of door objects within a tile, which the game does not always send in the same order and which decides which of two overlapping door footprints a cell belongs to (data as well);
- 8 have one off-mesh connection whose hide-part membership differs from the shipped mesh: six are listed in a part where the shipped mesh lists none, one is missing and one is in another part of the same object (open issue #127; doors never hold off-mesh polygons, so this is not a door matter). These are the counts on the 949 tiles that were analysed in detail, which include these tiles;
- 1 (146,83) differs in the order of two tree obstacles, which is data as well: tree obstacles come in the input order of the tree parts, which holds on the other 19,875 tiles of the half with two or more of them, and no sort key (radius, size, position, …) reproduces both (#128).
(One tile, 171,213, is both in the tower area and one of the #127 cases.) The three tiles of the first row that were fetched again without
--recordare not in the capture and are outside the comparison. -
Earlier blocks, all inner tiles identical: on Livonia, tiles 128-131 x 128-131 (open terrain) and 128-131 x 220-223 (a dense town); on Badlands, a dense block (136-139 x 100-103) and two blocks with the irrigation tunnels (180-183 x 186-189 and 183-186 x 198-201), whose floors are walkable below the surface.
So the claim is exact and limited: the inner tiles of the central half of Badlands and of five earlier blocks, with the polygon flags and the link array excluded, and with the 60 tiles above as the known differences. It does not cover the edge tiles, the outer parts of Badlands, whole maps or other maps, so the first mesh of your own terrain is still worth a look in the game.
You can repeat the comparison with your own copy of the game data. The test is ignored by default, because it needs
files that are not part of the repository: DAYZ_NAVMESH is the shipped .nm, DAYZ_NAVMESH_CAPTURE a capture
(--record) of the same world and DAYZ_NAVMESH_INNER the inner tile range x0,z0,x1,z1 to compare. A capture that is
too big to build whole can be limited with DAYZ_NAVMESH_RANGE (x0,z0,x1,z1): only that range is built, so it must
reach one tile beyond DAYZ_NAVMESH_INNER on each side:
DAYZ_NAVMESH=navmesh.nm DAYZ_NAVMESH_CAPTURE=world.dzgeo DAYZ_NAVMESH_INNER=128,128,131,131 \
cargo test -p dayzmake-core --test navmesh_live -- --ignored
Using dayzmake from an MCP client
The Model Context Protocol (MCP) lets an AI assistant call tools on your machine. dayzmake mcp is an MCP server
that offers the script API index and the file commands of dayzmake as tools, so that an assistant can look up
real DayZ classes and members instead of guessing them, and can inspect, build and sign PBOs for you.
Register the server
With Claude Code:
$ claude mcp add dayzmake -- dayzmake mcp
The command after -- is run by the client; it must be on the PATH of the client, or you give the full path
(-- /home/me/.cargo/bin/dayzmake mcp). For another MCP client, configure a server of the stdio kind with the
command dayzmake and the argument mcp. A typical JSON configuration looks like this:
{
"mcpServers": {
"dayzmake": { "command": "dayzmake", "args": ["mcp"] }
}
}
The server speaks newline-delimited JSON-RPC on standard input and output and ends when the client closes them. It has no network access and needs no configuration.
A safety note
The tools take file paths as given, relative to the folder the server was started in, and act with your
permissions. They can read your files, create files and, when the assistant passes force, overwrite them.
No tool overwrites anything without force, but pbo_unpack, pbo_build and the others do create files.
Register the server only with a client you trust to do that, and prefer to start the client in your project
folder.
What to ask
The tools are described to the assistant, so ordinary requests work:
- “Which methods does
PlayerBasehave that are calledOnRPC?” (api_find,api_class) - “What do
Entity’s subclasses override?” (api_subclasses,api_class) - “Show me the values of
EStatTypes.” (api_enum) - “Where is
Appledeclared? Show me the file.” (api_source, withcat) - “Which of my installed mods add to
PlayerBase?” (api_mods,api_classwithmodsset toall) - “What is in
mymod.pbo? Isconfig.binin it?” (pbo_inspect,pbo_cat) - “Build the folder
mymodand tell me the warnings.” (pbo_build) - “Sign
mymod.pbowithmykey.biprivatekeyand verify it.” (pbo_sign,pbo_verify) - “Rapify this config and show me what it turned into.” (
config_rapify,config_derapify) - “Convert
a_co.paato PNG so I can look at it.” (paa_to_image) - “Build the navmesh of
mymapfrom my capturemymap.dzgeointomymap.nmand tell me how many tiles it has.” (navmesh_generatewithcaptureandtarget, thennavmesh_info; a whole map from a live server takes many minutes, so ask for arangefirst)
The script API tools are vanilla-only by default. Say “including my mods” (the assistant passes mods=all) or
name a mod (“with CF”) to include them. The first run with mods=all builds the caches and can take a while;
api_update with mods=all does it ahead of time.
What the assistant sees
Each call returns text. Warnings come first (warnings: and one line each), then the output. Long output is cut
at 200000 bytes with a note that tells the assistant which offset continues. A failure is a result marked as
an error, so the assistant sees the message and can correct the call; the server keeps running.
A real exchange of one request and its reply, as the client sends it (see the reference for a full session and every tool):
> {"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"api_class","arguments":{"name":"PlayerBase","mods":"My Mod"}}}
{"id":2,"jsonrpc":"2.0","result":{"content":[{"text":"class PlayerBase : Entity [vanilla 4_world]\n bool IsAlive() // Returns true while the player is alive.\n void OnRPC(PlayerIdentity sender,int rpc_type,ParamsReadContext ctx)\nclass PlayerBase [My_Mod 4_world] [modded]\n void Heal(float amount) // Added by MyMod.","type":"text"}],"isError":false}}
Trying it by hand
You do not need a client to see what the server does:
$ printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | dayzmake mcp | jq -r '.result.tools[].name'
api_class
api_find
…
(jq is only used to print the names.) Use dayzmake mcp -v to lift the ten-warnings-per-name limit in the tool
results.
Command line
dayzmake <command> [options] [arguments]. The commands fall into groups; each group has its own page with one
section per command.
| Group | Commands | Page |
|---|---|---|
| Configs | rapify, preprocess, derapify | Configs |
| Models | binarize | Models |
| PBOs | build, pack, inspect, unpack, extract, cat | PBOs |
| Keys and signatures | keygen, sign, verify | Keys and signatures |
| Textures | paa2img, img2paa | Textures |
| Script API | api class, api find, api sub, api enum, api chain, api src, api grep, api defines, api update, api mods | Script API |
| Navigation meshes | navmesh probe, navmesh generate, navmesh info | Navigation meshes |
| MCP server | mcp | MCP server |
Global options
| Option | Meaning |
|---|---|
-h, --help | Print the usage text and exit with status 0. |
--version | Print the version (for example v3.2.0) and exit with status 0. |
An unknown command or option prints Invalid arguments. followed by the usage text and exits with status 1.
Options that many commands share
| Option | Meaning |
|---|---|
-v, --verbose | Lifts the limit of ten warnings per warning name. api also prints a # <index>: <build> line per index. |
-f, --force | Overwrite the target if it exists. Without it, an existing target is an error: Target file "x" already exists. Use --force to overwrite. |
-w <name>, --warning <name> | Mute the warning with this name. Repeatable. See Warnings. |
-i <folder>, --include <folder> | A folder that is searched for absolute includes. Repeatable. See Config files and the preprocessor. |
-w and -i are accepted only by the commands whose synopsis names them.
Input and output
Commands that take [<source>] read standard input when it is omitted, and commands that take [<target>]
write standard output when it is omitted. This works for rapify, preprocess, derapify, inspect, cat,
build and pack (the PBO goes to standard output). build and pack with -k need a real target, because a
signature cannot be made of a stream: error: Cannot sign a pbo that is piped to stdout.
Targets are written atomically: dayzmake writes a temporary file next to the target and renames it when the command succeeded, so a failed command leaves no half-written file.
Exit status and messages
0: the command succeeded. Warnings do not change the status.1: the command failed. The message iserror: <what failed>on standard error. Invalid arguments also give 1.- A reader that closes standard output early (
dayzmake inspect big.pbo | head) ends the command quietly with status 0.
Warnings go to standard error as [In file <file>:<line>: ]warning: <message> [<name>]. A warning name is shown
at most ten times; the rest is summarised at the end with a hint to mute it with -w or to use -v. Colours are
used when standard output is a terminal (the messages themselves go to standard error); NO_COLOR=1 and
CLICOLOR=0 switch them off and CLICOLOR_FORCE=1 forces them (see Environment and files).
Help text
The usage text is the source of truth for the grammar and is printed by dayzmake --help:
dayzmake (-h | --help)
dayzmake --version
Configs: rapify, preprocess, derapify
Config files (config.cpp, .rvmat, model.cfg) are text that DayZ reads in a binary form called rapified.
These three commands convert between the two and run the preprocessor on its own. The examples use this layout
(see Config files and the preprocessor for the files):
cfg/config.cpp
cfg/inc/common.hpp
shared/$PBOPREFIX$
shared/lib/defs.hpp
dayzmake rapify
Preprocess a config and write it in the binary format.
dayzmake rapify [-v] [-f] [-w <wname>]... [-i <includefolder>]... [<source> [<target>]]
Arguments:
| Argument | Meaning |
|---|---|
<source> | The config text. Standard input when omitted; includes are then resolved against the current directory. |
<target> | The rapified file. Standard output when omitted. |
Options:
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Show every warning instead of ten per name. |
-f, --force | off | Overwrite an existing <target>. |
-w <wname>, --warning <wname> | none | Mute a warning by name. Repeatable. |
-i <includefolder>, --include <includefolder> | none | Folder searched for absolute includes (#include "\x\y.hpp"). Repeatable. The current directory is only checked for the exact include path, never searched. |
An enum { A, B = 5, C }; block is accepted at any class level. It is no class entry: its names go, lowercase and
in source order, into the enum table of the rapified file. Values start at 0 and count up from the last explicit
one, as in C. A name that occurs twice is accepted without a warning, like CfgConvert; the last value counts.
Values are computed in f32, as CfgConvert does. A literal is rounded to f32 and a value outside i32 is
-2147483648 (so are 2147483647, 2147483648, 99999999999999999999 and -2147483649); hex keeps its low 32
bits at any length (0x1FFFFFFFFF is -1) and 0X works. An implicit value is the last explicit value plus its
distance, added in f32: A = 16777217, B, C gives 16777216, 16777216, 16777218. __EVAL of large numbers
keeps its exact floats; CfgConvert’s imprecise low bits are not copied.
Behaviour:
- Reads
<source>, runs the preprocessor (#include,#define,#ifdef,__EVAL,__EXEC, macros), parses the result as a config and writes it rapified. - Relative includes (
#include "inc/common.hpp") are resolved against the folder of the file that contains the directive. Absolute includes (starting with\) are searched in the-ifolders by path suffix and$PBOPREFIX$. A missing include is an error naming the file and line. - A source that is already rapified is copied unchanged with the
prerapified-filewarning. - Syntax errors name the line and the token that was expected. Warnings the failed parse raised on the error’s own line are dropped, those of earlier lines are kept. Values that are not quoted are accepted with the
unquoted-stringwarning and an entry without a value withempty-value. - A value entry (not an array or a class) may end at the line end instead of
;, as in CfgConvert:x = 1.5keeps its number type,"s"and__EVAL(...)values are evaluated as with;(1e999is an infinity, see below), and an integer that overflows is handled as with;(next bullet). An entry on the last line of a file that has no line end after it is a syntax error, because CfgConvert rejects it too. - A decimal integer is stored by size, as in CfgConvert: an
i32is a 32-bit integer, one that fits 64 but not 32 bits (2147483648) is a 64-bit integer entry (entry subtype 6;derapifyandapi configread it), one that does not fit 64 bits (99999999999999999999) is a float (1e20). Arrays have no 64-bit element type: there a decimal that does not fit 32 bits (3000000000) is a float. Followed by text the value stays an unquoted string. - A hex literal without a sign keeps its low 32 bits at any length (
0x1FFFFFFFFFis-1,0x100000000is0);0Xworks like0x. With a sign it is a float (-0x10is-16.0). - A float that does not fit an f32 (
1e999,-1e39) becomes an infinity, as in CfgConvert; one that underflows (1e-999) becomes 0.derapifywrites an infinity as1e999or-1e999, soderapifyfollowed byrapifykeeps the value bit for bit. Followed by text (1e999x) the value stays an unquoted string. delete,class X: Y, forward declarations and+=array appends are supported.
Examples:
$ dayzmake rapify -i ../shared config.cpp config.bin
$ dayzmake derapify config.bin
class CfgVehicles {
class Inventory_Base;
class MyItem: Inventory_Base {
scope = 2;
displayName = "My item";
itemSize[] = {4, 4};
descriptionShort = "Spare part";
weight = 100;
absorbency = 0.5;
};
};
A macro argument that is used as an array element is not evaluated by the preprocessor:
$ dayzmake rapify -i ../shared config.cpp -f config.bin # with {ITEM_SIZE, DOUBLE(2)}
In file config.cpp:10: warning: String array element "((2)*2)" is not quoted properly. [unquoted-string]
Use __EVAL(2*2) for arithmetic, as in the config above.
Existing targets are protected:
$ dayzmake rapify -i ../shared config.cpp config.bin
error: Target file "config.bin" already exists. Use --force to overwrite.
A syntax error:
$ dayzmake rapify bad.cpp # contains: class A { x = 1 (no final newline)
error: In line bad.cpp:1:
class A { x = 1
^
Unexpected token "\n", expected: one of ".", ";", ['0'..='9'], ['e' | 'E'], [_]
See also: derapify, preprocess, Config files and the preprocessor, Header extensions and prefixes.
dayzmake preprocess
Run only the preprocessor and print the result.
dayzmake preprocess [-v] [-f] [-w <wname>]... [-i <includefolder>]... [<source> [<target>]]
Arguments and options are those of rapify: <source> defaults to standard input, <target>
to standard output, and -v, -f, -w and -i mean the same.
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Show every warning. |
-f, --force | off | Overwrite an existing <target>. |
-w <wname>, --warning <wname> | none | Mute a warning by name. |
-i <includefolder>, --include <includefolder> | none | Folder searched for absolute includes. |
Behaviour:
- The output is the text after includes, macros and conditionals. Leading indentation is removed and the directives leave blank lines behind.
__EVALis not evaluated here; it is evaluated when the config is parsed byrapify.- The
include-casewarning is raised when an include only matches ignoring case, andmacro-arg-countwhen a macro is called with the wrong number of arguments. A//comment may end at the end of the file without a line end, and an unterminated/*runs to the end of the file, as in CfgConvert, with the warningunterminated-comment.
Example:
$ dayzmake preprocess -i ../shared config.cpp
class CfgVehicles
{
class Inventory_Base;
class MyItem: Inventory_Base
{
scope = 2;
displayName = "My item";
itemSize[] = {4, __EVAL(2*2)};
descriptionShort = "Spare part";
weight = 100;
absorbency = 0.5;
};
};
Without -i, the absolute include cannot be found:
$ dayzmake preprocess config.cpp
error: File "\shared\lib\defs.hpp" included from "config.cpp:2" not found.
See also: rapify, Config files and the preprocessor.
dayzmake derapify
Convert a rapified config back to text.
dayzmake derapify [-v] [-f] [-d <indentation>] [<source> [<target>]]
| Argument | Meaning |
|---|---|
<source> | The rapified config (a config.bin). Standard input when omitted. |
<target> | The text file. Standard output when omitted. |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Verbose output. |
-f, --force | off | Overwrite an existing <target>. |
-d <indentation>, --indent <indentation> | four spaces | The string written once per nesting level. Only spaces and tabs are accepted, at most 64 characters; an empty string gives unindented output. Anything else is an error and nothing is written. |
Behaviour:
- The input must be a rapified config; anything else is an error
Failed to read rapified config:. - Macros and includes are already expanded in a rapified config, so the text is the expanded result. Comments are not stored and cannot be restored.
- The enum table of the file is printed first, as an
enum { name = value, ... };block, with the names as stored (lowercase). A table that is empty, missing or damaged produces no block and no error. - Class nesting depth and entry counts are limited when reading, so a hostile file cannot exhaust memory.
Examples:
$ dayzmake derapify config.bin
class CfgVehicles {
class Inventory_Base;
class MyItem: Inventory_Base {
scope = 2;
displayName = "My item";
itemSize[] = {4, 4};
descriptionShort = "Spare part";
weight = 100;
absorbency = 0.5;
};
};
delete and += survive the round trip:
$ dayzmake derapify t.bin
class CfgFoo {
class A {};
class B: A {
x = 1;
};
delete A;
arr[] += {1};
};
See also: rapify, unpack (to get config.bin out of a PBO).
Models: binarize
Models (.p3d) and animations (.rtm) are authored in an editable format (MLOD) and converted to the game’s
binary format (ODOL, BMTR) by Bohemia’s binarize.exe from DayZ Tools. dayzmake does not reimplement that
conversion: it runs binarize.exe, directly on Windows and under Proton on Linux. The guide
Binarizing models on Linux walks through the setup; the environment variables are
listed in Environment and files.
dayzmake binarize
Binarize one model.
dayzmake binarize [-v] [-f] [-w <wname>]... <source> <target>
| Argument | Meaning |
|---|---|
<source> | The model to binarize. |
<target> | The file to write. |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Show every warning. |
-f, --force | off | Overwrite an existing <target>. |
-w <wname>, --warning <wname> | none | Mute a warning by name. |
Behaviour:
- A file that is already binarized (an
ODOLmodel or aBMTRanimation) is copied unchanged with theprebinarized-filewarning, which names the format and version (for exampleODOL v58). Any version is accepted; dayzmake does not know which ones the game loads.binarize.exeis not started for it. - Otherwise
binarize.exeis started. On Windows it is found through the registry keyHKEY_CURRENT_USER\Software\Bohemia Interactive\binarize, valuepath, filebinarize_x64.exe. On Linux it runs under Proton from DayZ Tools (Steam app 830640); a missing DayZ Tools, Steam or Proton is an error that names what is missing and the variable to set (STEAM_ROOT,DAYZ_TOOLS,PROTON). - The model’s folder is treated as the addon and its name as the prefix. This only works for a model in the
root of a single-component addon. For a model in a subfolder (
data\), or an addon whose prefix has several components (my\mod), use build with--proton-binarize, which takes the prefix from$PBOPREFIX$. - The first model of a run is slow on Linux because a Wine prefix is created in a temporary sandbox; the sandbox is removed when the command ends. Nothing in the Steam installation is modified.
BIOUTPUT=1shows the output ofbinarize.exeand Proton; otherwise it is shown only when the run fails.
Examples:
$ dayzmake binarize t21/small.p3d x.p3d
error: binarize.exe not found in "…/steam/steamapps/common/DayZ Tools". Install DayZ Tools (Steam app 830640) or set DAYZ_TOOLS.
$ DAYZ_TOOLS=/nonexistent dayzmake binarize t21/small.p3d -f x.p3d
error: binarize.exe not found in "/nonexistent". Install DayZ Tools (Steam app 830640) or set DAYZ_TOOLS.
$ STEAM_ROOT=/nonexistent HOME=/nonexistent dayzmake binarize t21/small.p3d -f x.p3d
error: No Steam installation found (set STEAM_ROOT, or DAYZ_TOOLS to the DayZ Tools folder).
With DayZ Tools present but no Proton in the Steam library:
$ dayzmake binarize t21/small.p3d -f x.p3d
error: No Proton found under "…/steam/steamapps/common". Install one in Steam or set PROTON.
These examples fail on purpose, because the test machine for this documentation has no DayZ Tools; a successful
run writes the binarized model to <target> and prints the progress notes of the Proton sandbox.
See also: Binarizing models on Linux, build, Environment and files.
PBOs: build, pack, inspect, unpack, extract, cat
A PBO is the archive format of DayZ: a header with the prefix and other header
extensions, a list of entries and a checksum. build makes the PBO of a mod folder the way
the game needs it, pack only archives, and inspect, unpack and cat read PBOs. PBO contents are treated as
untrusted: entry names with .., drive letters or absolute paths are never written outside the target folder.
The examples use the folder mymod/ from A first mod.
dayzmake build
Build a PBO from a folder: rapify configs, binarize models, check model textures, pack.
dayzmake build [-v] [-f] [--proton-binarize] [-w <wname>]... [-i <includefolder>]... [-x <excludepattern>]... [-e <headerext>]... [-k <privatekey>] [-s <signature>] <sourcefolder> [<target>]
| Argument | Meaning |
|---|---|
<sourcefolder> | The folder to pack. Its $PBOPREFIX$ (or its name) is the prefix. |
<target> | The PBO to write. Standard output when omitted (not allowed together with -k). |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Show every warning. |
-f, --force | off | Overwrite <target> and an existing signature file. |
--proton-binarize | off | Linux: binarize .p3d and .rtm files with DayZ Tools’ binarize.exe under Proton. Without it models are copied as they are. See Binarizing models on Linux. On Windows binarize.exe is always used. |
-w <wname>, --warning <wname> | none | Mute a warning by name. |
-i <includefolder>, --include <includefolder> | none | Folder searched for absolute includes in configs and for textures of other mods when checking models. The current directory is only checked directly. |
-x <excludepattern>, --exclude <excludepattern> | none | Glob pattern of files to leave out. Repeatable. See below. |
-e <headerext>, --headerext <headerext> | none | Header extension key=value. Repeatable. See Header extensions and prefixes. |
-k <privatekey>, --key <privatekey> | none | Sign the PBO with this .biprivatekey after writing it. |
-s <signature>, --signature <signature> | <target>.<keyname>.bisign | Where -k writes the signature. |
Behaviour:
- Files are visited in sorted order, so the same folder always gives the same bytes. No timestamps are stored.
config.cppis rapified and stored asconfig.bin. Every other.cppand every.rvmatis rapified and keeps its name. A config that is already rapified is copied with theprerapified-filewarning..p3dand.rtmfiles are binarized (with--proton-binarizeon Linux). A model that is already binarized (ODOL, BMTR) is copied withprebinarized-file. A.p3dofile is packed as.p3d. Without--proton-binarizeon Linux, models are copied and each one raisesnon-windows-binarization.- Every editable (MLOD) model is checked for textures and materials that are not in the addon
(
missing-texture,missing-material). See Textures and model checks. - A file named
$NOBIN$or$NOBIN-NOTEST$in the source folder switches rapification and binarization off for the whole folder; the files are packed as they are. $PBOPREFIX$(or$PREFIX$) is read and not stored as an entry; its first bare line is the prefix and itskey=valuelines become header extensions.- Files that are not regular files (FIFOs, devices, sockets) are skipped with
unsupported-file. Names that are not valid as PBO entry names are skipped withunsafe-path. Names that collide ignoring case giveduplicate-entryand the first in sorted order wins, except that a generated entry (the rapifiedconfig.bin) wins over a plain file of the same name. - Exclude patterns use
*as the only wildcard; it also matches\. A pattern is matched against the whole path inside the PBO written with\, before theconfig.cpptoconfig.binrename and case-sensitively:-x '*.psd'leaves out every.psd,-x 'data\*.png'every PNG belowdata. Excluded files are skipped silently. - The target and the temporary files next to it are never packed into themselves.
- With
-kthe PBO is signed with a version 3 signature after it was written (see sign).
Examples:
$ dayzmake build -x '*.psd' -x 'data\*.png' m2 m2.pbo
$ dayzmake inspect m2.pbo
Header extensions:
- prefix=m2
- product=dayz
# Files: 4
Path Method Original Packed
Size Size
================================================================================
config.bin 0 291 291
data\note.cpp 0 31 31
data\x.rvmat 0 88 88
scripts\s.c 0 2 2
-e overrides what $PBOPREFIX$ says:
$ dayzmake build -e author=bzed -e product=dz m2 -f m2.pbo
$ dayzmake inspect m2.pbo | head -4
Header extensions:
- prefix=m2
- product=dz
- author=bzed
Signing needs a target:
$ dayzmake build -k mykey.biprivatekey t21
error: Cannot sign a pbo that is piped to stdout.
Warnings of a model that references files outside the addon (here t21 contains the test model small.p3d):
$ dayzmake build t21 t21.pbo
In file small.p3d: warning: Model references texture "t21\data\gone_co.paa", which is not in the addon. [missing-texture]
In file small.p3d: warning: Model references material "t21\data\m.rvmat", which is not in the addon. [missing-material]
In file small.p3d: warning: On non-Windows systems binarize.exe is only used with --proton-binarize; file will be copied as-is. [non-windows-binarization]
See also: pack, Header extensions and prefixes, Warnings.
dayzmake pack
Pack a folder into a PBO without rapifying or binarizing anything.
dayzmake pack [-v] [-f] [-x <excludepattern>]... [-e <headerext>]... [-k <privatekey>] [-s <signature>] <sourcefolder> [<target>]
| Argument | Meaning |
|---|---|
<sourcefolder> | The folder to pack. |
<target> | The PBO to write. Standard output when omitted (not allowed together with -k). |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Show every warning. |
-f, --force | off | Overwrite <target> and an existing signature. |
-x <excludepattern>, --exclude <excludepattern> | none | Glob pattern of files to leave out, as for build. |
-e <headerext>, --headerext <headerext> | none | Header extension key=value. |
-k <privatekey>, --key <privatekey> | none | Sign the PBO afterwards. |
-s <signature>, --signature <signature> | <target>.<keyname>.bisign | Signature path for -k. |
Behaviour: the same rules as build for prefixes, exclusion, ordering and unsafe names, but file contents are
copied unchanged: config.cpp stays config.cpp, models stay as they are, and there are no model checks and no
include handling. Use it to repack a folder that was already built, or for PBOs that hold plain data.
Example (the folder w contains a name that is not allowed, a name that differs only in case, a FIFO and a
prefix with slashes):
$ dayzmake pack . ../w.pbo -f
warning: Removed leading/trailing slashes from prefix "/leading/". [prefix-slash]
warning: Skipping "data/a.txt": an entry named "data\A.txt" was already packed. [duplicate-entry]
warning: Skipping "data/bad:name.txt": unsafe entry name. [unsafe-path]
In file data/pipe: warning: Skipping a file that is not a regular file (FIFO, device or socket). [unsupported-file]
A missing folder is named in the error:
$ dayzmake pack nonexist x.pbo
error: Failed to read source folder "nonexist":
No such file or directory (os error 2)
dayzmake inspect
List what a PBO contains, or describe a model.
dayzmake inspect [-v] [--json] [<source>]
| Argument | Meaning |
|---|---|
<source> | A PBO or a .p3d model. Standard input when omitted. |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Verbose output. |
--json | off | PBOs only: print the header as one JSON object (see below). |
Behaviour:
-
A file that starts with a model header is described as a model; anything else is read as a PBO.
-
For a PBO: the header extensions, the number of files, and a table with name, packing method (0 stored, compressed entries are listed with their packed size), original size and stored size.
-
For an editable MLOD model: format and version, the LODs with point, face, normal and UV-set counts, textures and materials with the number of faces that use them, properties and named selections.
-
For a binarized ODOL v56 model: format and version, the skeleton and bone count, the property class and damage, mass, bounding box, the LODs with vertex and face counts, textures and materials with the number of LODs that use them (a built-in material without a name is listed as
(none)), proxies, properties, named selections and the animation classes. A v56 model that cannot be read is an error. For another ODOL version, or a BMTR file, only the format and version are shown (ODOL adds a note that only v56 is decoded). -
Nothing is written; the command only reads.
-
--jsonprints one JSON object on one line, with the fields in this order:header_extensions: an ordered array of{key, value, key_hex, value_hex};prefixandprefix_hex: the prefix, or bothnullwhen the PBO has none;entries: an array of{name, name_hex, packing, original_size, data_size, timestamp}in header order.
key,value,prefixandnameare the bytes decoded lossily as UTF-8 and only JSON-escaped (no control-character escaping of the text output); the*_hexfields are the lowercase hex of the raw bytes. A parser reads the hex, because the text of a name with a byte that is not UTF-8 has lost it. For a model,--jsonis an error:--json is only supported for PBOs.
Examples:
$ dayzmake inspect --json mymod.pbo
{"header_extensions":[{"key":"prefix","value":"mymod","key_hex":"707265666978","value_hex":"6d796d6f64"}],"prefix":"mymod","prefix_hex":"6d796d6f64","entries":[{"name":"config.bin","name_hex":"636f6e6669672e62696e","packing":0,"original_size":291,"data_size":291,"timestamp":0}]}
$ dayzmake inspect mymod.pbo
Header extensions:
- prefix=mymod
# Files: 2
Path Method Original Packed
Size Size
================================================================================
config.bin 0 291 291
scripts\4_world\player.c 0 27 27
$ dayzmake inspect t21/small.p3d
Format: MLOD (editable model)
Version: 257
LODs: 2
# LOD Points Faces Normals UV sets
0 Resolution 1 4 3 2 2
1 Memory 4 0 2 0
Textures:
- #(argb,8,8,3)color(0.5,0.5,0.5,1,CO) (1 faces)
- t21\data\a_co.paa (1 faces)
- t21\data\gone_co.paa (1 faces)
Materials:
- t21\data\m.rvmat (2 faces)
Properties:
- LOD 0: class = house
- LOD 0: autocenter = 0
- LOD 1: x = y
Selections:
- LOD 0 (Resolution 1): body, old
- LOD 1 (Memory): start
Something that is not a PBO:
$ dayzmake inspect notpbo
error: Failed to read PBO:
failed to fill whole buffer
See also: Textures and model checks.
dayzmake unpack
Extract a PBO into a folder.
dayzmake unpack [-v] [-f] [--use-prefix] [-x <excludepattern>]... [--only <pattern>]... <source> <targetfolder>
| Argument | Meaning |
|---|---|
<source> | The PBO. |
<targetfolder> | The folder to extract into; it is created when missing. |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Show every warning. |
-f, --force | off | Overwrite files that already exist in the target folder. |
--use-prefix | off | Extract into <targetfolder>/<prefix>/ instead of directly into <targetfolder>. |
-x, --exclude <excludepattern> | none | Glob pattern of entries to leave out. Repeatable. |
--only <pattern> | none | Glob pattern: write only the entries that match one. Repeatable. |
Behaviour:
- The header extensions are written to
$PBOPREFIX$in the extracted folder, so thatbuildorpackof the folder gives the same prefix again. Control characters in extensions are replaced with spaces (unsafe-header). - Entry names are validated before use. Absolute paths, drive letters,
.., empty names and names that are not valid file names are skipped with a warning (unsafe-path); names with a leading\are extracted without it (leading-separator). A name that is not UTF-8 is extracted as Windows-1252 (non-utf8-filename), and a second entry with the same path ignoring case is skipped (duplicate-entry). Nothing is ever written outside the target folder, and a symbolic link in the way is never followed. - Without
-f, extraction stops with an error when the target folder already contains a file of the PBO, and names the first one. Nothing is overwritten. --onlyand-xselect the entries to write: an entry is written when it matches at least one--onlypattern (or none is given) and no-xpattern, so-xwins.*stands for any run of characters, as in the-xofpack. Patterns are matched against the entry path with/separators, without the prefix, ignoring case.$PBOPREFIX$is always written, and the conflict check without-fcovers only the selected entries.dayzmake unpack --only '*.c' --only '*config.bin' scripts.pbo outextracts scripts and configs, not models and textures.- Compressed entries are decompressed. A rapified
config.binstays rapified; use derapify to read it. - With
--use-prefixan unsafe prefix is an error. An empty prefix means no prefix directory.
Examples:
$ dayzmake unpack mymod.pbo out
$ find out
out
out/scripts
out/config.bin
out/$PBOPREFIX$
out/scripts/4_world
out/scripts/4_world/player.c
$ dayzmake unpack mymod.pbo out2 --use-prefix
$ find out2 -type f
out2/mymod/config.bin
out2/mymod/$PBOPREFIX$
out2/mymod/scripts/4_world/player.c
$ dayzmake unpack mymod.pbo out
error: Target folder "out" already contains files of this PBO (first: "$PBOPREFIX$"). Use --force to overwrite.
A PBO with an entry name that starts with a separator and a header extension that contains a line break:
$ dayzmake unpack odd.pbo odd-out
warning: Header extension "note" contains control characters; replaced them with spaces. [unsafe-header]
warning: Entry "\scripts\hello.c" starts with a path separator; extracting it as "scripts/hello.c". [leading-separator]
See also: cat, Header extensions and prefixes.
dayzmake extract
Unpack a whole DayZ install, a mod or a single PBO into one tree organised by prefix, optionally derapified, with a map from prefix to PBO.
dayzmake extract [-v] [-f] [--derapify] [--only <pattern>]... [-x <excludepattern>]... <source> <targetfolder>
| Argument | Meaning |
|---|---|
<source> | A DayZ client or server folder, a mod folder (@Foo or a workshop folder) or a single .pbo. |
<targetfolder> | The folder for the tree; the parent is created when missing. |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Print a summary (files, PBOs). |
-f, --force | off | Replace an existing target folder. |
--derapify | off | Write every rapified *.bin as text, with the extension .cpp. |
-x, --exclude <excludepattern> | none | Glob pattern of entries to leave out. Repeatable. |
--only <pattern> | none | Glob pattern: write only the entries that match one. Repeatable. |
Behaviour:
- For a folder, every
*.pbodirectly in itsdtaandaddonssubfolders is read; the folder names match in any case (DayZ usesAddons), other folders and deeper levels are not searched, and a folder without PBOs is an error. PBOs are processed in sorted order of their path relative to<source>, so the result is deterministic. - The entries of a PBO go to
<targetfolder>/<prefix>/<entry>. An empty prefix means the file name of the PBO without.pbo. Entry names are validated like those of unpack: unsafe names are skipped with a warning (unsafe-path), and so is a PBO whose prefix is not a safe folder name or ispbo-map.tsv;$PBOPREFIX$is not written, the map holds the prefixes. - When two PBOs write the same path, ignoring case, the later one in sorted order wins and the warning
duplicate-pathnames both PBOs. Two entries of one PBO with the same path giveduplicate-entry. When one PBO has a file where another (or the same one) has a folder, the first in that order is written and the later entry is skipped with the warningextract-path-clash; the extract does not fail. --derapify: a*.binthat starts with the rapified signature (config.binor any other) is written as.cppof the same name, in the text that derapify prints. One that cannot be read stays a.bin, with the warningderapify-failed.--onlyand-xmatch the entry name in the PBO (config.bin), as forunpack.- The tree is written to a staging folder next to
<targetfolder>(same parent, named.<name>.extract-<pid>-<n>) and replaces<targetfolder>with a rename when everything succeeded, then the old tree is removed. A re-run therefore drops files that no longer exist, and a failure (a PBO that cannot be read) leaves the old tree untouched and removes the staging folder. - Without
-f, an existing<targetfolder>is an error. With-fit is replaced and deleted after the swap, but only when it is an empty folder or holds apbo-map.tsvat its top level, that is, looks like the result of an earlierextract; any other folder is refused with an error that names it, so a wrong target cannot wipe a home folder. It must also be a real folder (not a file or a symbolic link), must not contain the source and must not lie inside it:extract -f m m/addonsis refused, so the PBOs are never deleted. A new<targetfolder>inside the source (extract m m/out) is refused as well, without-f, before anything is created; the paths are compared with symbolic links resolved. A new<targetfolder>with a..after a folder that does not exist (elsewhere/missing/../x) cannot be resolved and is refused with the errorInvalid target folder "<path>": cannot resolve ".." after a folder that does not exist. - Everything that goes wrong with a PBO is an error that leaves the old tree alone: a PBO or entry that cannot be
read (truncated, a compressed entry that does not decompress) and a file that cannot be written. Only unsafe names,
a path clash across entries and a
.binthat cannot be derapified are skipped, with a warning. <targetfolder>/pbo-map.tsvhas one line per PBO that was read,prefix<TAB>path of the PBO relative to <source>with/separators, sorted by prefix (then by path). A PBO without prefix is listed with its file name without.pbo. The prefix is written with/instead of\(like the folders of the tree), and then\, TAB, CR and LF in either column are written as\\,\t,\rand\n, so every\in the file starts an escape and a line reads back unambiguously (a prefixdz\gear\navigationisdz/gear/navigation). The prefix as stored is ininspect --json. The PBOs whose files were skipped because of their prefix are listed too.- Memory: an entry that is stored uncompressed is copied from the PBO to its file in pieces. Only compressed entries
and, with
--derapify,*.binfiles that start with the rapified signature are read into memory, up to 512 MiB each (a compressed entry over that is an error), so the largest PBOs extract in a small amount of memory.
Example:
$ dayzmake extract --derapify --only '*.c' --only '*.bin' --only '*.cpp' ~/dayz-server game
$ cat game/pbo-map.tsv
dz/gear/camping addons/gear_camping.pbo
dz/scripts dta/scripts.pbo
$ ls game/dz/scripts
3_game 4_world 5_mission config.cpp
$ dayzmake extract install out
error: Target folder "out" already exists. Use --force to replace it.
See also: unpack, derapify, Looking up the script API.
dayzmake cat
Write one entry of a PBO to standard output or to a file.
dayzmake cat [-v] [-f] <source> <filename> [<target>]
| Argument | Meaning |
|---|---|
<source> | The PBO. |
<filename> | The entry name exactly as inspect prints it, with \ as separator (quote it in a shell: 'scripts\4_world\player.c'). |
<target> | The file to write. Standard output when omitted. |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Verbose output. |
-f, --force | off | Overwrite an existing <target>. Without a <target> (standard output) it has no effect. |
Behaviour: the entry is decompressed when it is stored compressed. The name must match exactly (including the
case the PBO uses); a name that is not in the PBO is an error. An existing <target> is not overwritten unless
you pass -f.
Examples:
$ dayzmake cat mymod.pbo 'scripts\4_world\player.c'
modded class PlayerBase {}
$ dayzmake cat mymod.pbo scripts/4_world/player.c
error: File "scripts/4_world/player.c" not found in PBO.
Keys and signatures: keygen, sign, verify
DayZ servers accept a PBO from a client only when it carries a signature (.bisign) made with a private key
whose public key (.bikey) is in the server’s keys folder. dayzmake uses Bohemia’s file formats: a 1024-bit RSA
key pair and version 2 or 3 signatures. Everything is implemented in Rust, with no system libraries.
Key files and signatures are untrusted input like every other file: dayzmake checks their lengths and the key name before it writes a file name from it.
dayzmake keygen
Generate a key pair.
dayzmake keygen [-v] [-f] <keyname>
| Argument | Meaning |
|---|---|
<keyname> | The path of the key without extension. The file name part is the name of the key (it is stored in both files and appears in signature names), so use a name such as mymod_1 or your own handle. |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Verbose output. |
-f, --force | off | Overwrite existing key files. |
Behaviour:
- Writes
<keyname>.biprivatekeyand<keyname>.bikeynext to each other; the folder of<keyname>must exist. - The private key is created readable by its owner only (mode
0600). Keep it out of version control and never publish it; publish the.bikeywith the mod. - Without
-f, an existing file of either name is an error and nothing is written. - The key size is 1024 bits, which is what DayZ expects.
Examples:
$ dayzmake keygen release
$ ls -l release.*
-rw-r--r-- 1 me me 160 Nov 16 15:39 release.bikey
-rw------- 1 me me 608 Nov 16 15:39 release.biprivatekey
$ dayzmake keygen release
error: Target file "release.biprivatekey" already exists. Use --force to overwrite.
See also: sign, A first mod.
dayzmake sign
Sign a PBO with a private key.
dayzmake sign [-v] [-f] [--v2] <privatekey> <pbo> [<signature>]
| Argument | Meaning |
|---|---|
<privatekey> | The .biprivatekey. |
<pbo> | The PBO to sign; it is only read. |
<signature> | The signature file to write. Default: next to the PBO, <pbo name>.<keyname>.bisign (mymod.pbo signed with mykey gives mymod.pbo.mykey.bisign). |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Verbose output. |
-f, --force | off | Overwrite an existing signature file. |
--v2 | off | Write an older version 2 signature instead of version 3. |
Behaviour:
- A version 3 signature covers the script and text-like entries (
.c,.sqf,.hpp,.cfg, …), which is what current DayZ versions check. A version 2 signature covers everything except textures, models and sounds, and is only needed for old servers or tools. - A key name that is not usable as a file name part (path separators,
:, control characters) is refused; pass<signature>explicitly then. - The signature is written atomically.
build -kandpack -kdo the same after packing.
Examples:
$ dayzmake sign mykey.biprivatekey mymod.pbo
$ ls mymod*
mymod.pbo mymod.pbo.mykey.bisign
$ dayzmake sign mykey.biprivatekey mymod.pbo
error: Target file "mymod.pbo.mykey.bisign" already exists. Use --force to overwrite.
$ dayzmake sign -f --v2 mykey.biprivatekey mymod.pbo
$ dayzmake sign nokey.biprivatekey sg.pbo
error: Failed to open private key "nokey.biprivatekey":
No such file or directory (os error 2)
dayzmake verify
Check the signature of a PBO.
dayzmake verify [-v] <publickey> <pbo> [<signature>]
| Argument | Meaning |
|---|---|
<publickey> | The .bikey. |
<pbo> | The PBO to check. |
<signature> | The signature file. Default: <pbo name>.<keyname>.bisign, where the key name is stored in the public key. |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Verbose output. |
Behaviour:
- Prints nothing and exits with status 0 when the signature is valid.
- Exits with status 1 and an error when it is not. The key a signature was made with is stored in the signature and compared first, so a wrong key is reported as such. If the PBO changed after signing, the first hash that differs is printed with the signed and the real value.
- The version of the signature (2 or 3) is read from the signature file.
Examples:
$ dayzmake verify release.bikey sg.pbo
$ echo $?
0
A key that did not make the signature:
$ dayzmake verify other.bikey mymod.pbo mymod.pbo.mykey.bisign
error: The signature was made with a different key (signature: mykey, 1024 bits; this key: other, 1024 bits).
A PBO whose a.c was changed after it was signed:
$ dayzmake verify release.bikey sg2.pbo
error: Hash 1 doesn't match
Signed hash: 025f08824316bcd409d45bcef929192c2b16375b
Real hash: e2ac5c2b8005409dbca48bc11e9424f2d574f62a
A signature file that does not exist:
$ dayzmake verify release.bikey sg.pbo missing.bisign
error: Failed to open signature "missing.bisign":
No such file or directory (os error 2)
See also: sign, Verifying downloads (for the GPG signatures of dayzmake itself, which are unrelated to BI keys).
Textures: paa2img, img2paa
PAA is DayZ’s texture format. These commands convert between PAA and ordinary image files. They are available
when dayzmake is built with the image feature, which the released binaries have. The examples start from a
64 by 64 PNG named tex.png.
dayzmake paa2img
Convert a PAA texture to an image.
dayzmake paa2img [-v] [-f] <source> <target>
| Argument | Meaning |
|---|---|
<source> | The PAA file. |
<target> | The image to write. The format follows the extension: png, jpg, bmp, tga and gif work. |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Verbose output. |
-f, --force | off | Overwrite an existing <target>. |
Behaviour:
- The largest mipmap is decoded to 8-bit RGBA. DXT1, DXT3, DXT5 and uncompressed RGBA PAAs are supported, with
or without LZO-compressed mipmaps. The 16-bit formats ARGB4444, ARGB1555 and AI88 (grey with alpha) are
read too: their mipmaps are LZSS-compressed, and a wrong checksum or a cut-short stream is an error.
Writing these formats is not supported (
img2paa -toffers DXT1, DXT3, DXT5 and RGBA). - A file that starts with the PNG signature is reported as a PNG file, not as an unknown PAA.
- The reader treats the file as untrusted: tag sizes, mipmap sizes and the number of mipmaps are limited, so a small hostile file cannot make dayzmake allocate gigabytes.
- An extension that is not an image format is an error and nothing is written.
Examples:
$ dayzmake paa2img t21/data/a_co.paa back.png
$ file back.png
back.png: PNG image data, 64 x 64, 8-bit/color RGBA, non-interlaced
$ dayzmake paa2img t21/data/a_co.paa back.png
error: Target file "back.png" already exists. Use --force to overwrite.
$ dayzmake paa2img t21/data/a_co.paa back.txt
error: Failed to save output image:
The file extension `."txt"` was not recognized as an image format
See also: img2paa, Textures and model checks.
dayzmake img2paa
Convert an image to a PAA texture.
dayzmake img2paa [-v] [-f] [-c] [-t <paatype>] <source> <target>
| Argument | Meaning |
|---|---|
<source> | The image (PNG, JPEG, BMP, TGA, GIF and the other formats of the image library). |
<target> | The PAA to write. |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Verbose output. |
-f, --force | off | Overwrite an existing <target>. |
-c, --compress | off | LZO-compress the mipmaps wider than 128 pixels of a DXT texture, where that makes them smaller. img2paa already does this for every conversion, so the option does not change the output; it is kept for compatibility with armake2. rgba is never compressed, and that is not an error. |
-t <paatype>, --type <paatype> | dxt5 | The pixel format: dxt1, dxt3, dxt5 or rgba, in any case. |
Behaviour:
dxt1has no alpha or 1-bit alpha and is the smallest,dxt3has explicit 4-bit alpha,dxt5interpolated alpha, andrgbais uncompressed 8-bit RGBA (about eight times the size ofdxt1).- The output has a chain of mipmaps, halving the size until a side reaches 4 pixels (five levels for a 64 by 64 image). Image sizes should be powers of two, as the game expects; dayzmake does not resize (a 100 by 50 image stays 100 by 50).
- An unknown type is an error:
Unsupported PAA compression type for creation: foo.
Examples (a 64 by 64 image gives these sizes):
$ dayzmake img2paa tex.png t21/data/a_co.paa
$ dayzmake img2paa -t dxt1 tex.png t21/data/b_co.paa
$ dayzmake img2paa -t rgba tex.png t21/data/c.paa
$ ls -l t21/data
-rw-r--r-- 1 me me 5577 Nov 16 15:34 a_co.paa
-rw-r--r-- 1 me me 2849 Nov 16 15:34 b_co.paa
-rw-r--r-- 1 me me 21945 Nov 16 15:34 c.paa
$ dayzmake img2paa -t foo tex.png x.paa
error: Failed to convert image to PAA:
Unsupported PAA compression type for creation: foo
$ dayzmake img2paa nonexist.png y.paa
error: Failed to open input image file "nonexist.png":
No such file or directory (os error 2)
See also: paa2img.
Script API: api
dayzmake api answers questions about the DayZ script API (classes, members, enums, base class chains, where a
declaration lives, compile-time defines) and about its configs (api config) from the installed game, without
extracting anything. It reads
dta/scripts.pbo of the game and, when asked with -m, the script PBOs of mods, builds an index once and
caches it. The guide shows typical sessions; this page lists every command.
The examples use a small synthetic game (dz/dta/scripts.pbo with the classes Entity, ItemBase, PlayerBase,
Apple and the enum EStatTypes) selected with --dayz dz, and a mod @MyMod that adds Heal to PlayerBase.
With a real installation --dayz is not needed.
Selecting mods
-m (--mod) takes a comma separated list. Without it only vanilla is queried. Each entry is one of:
| Entry | Meaning |
|---|---|
cf, cot, dabs, expansion | Community Framework, Community Online Tools, DabsFramework, DayZ Expansion, by their workshop ids; the mod must be subscribed on Steam. |
aliases | All four aliases above. |
all | Every installed mod that has scripts (api config: also a mod that has only a config, such as a retexture). The first run indexes each mod, which can take a while; the result is cached. |
| a number | A workshop id. |
| a directory | A mod folder that has an addons folder with PBOs. A name that exists as a path, or contains / or \, is taken as a directory. |
| a name | The name of an installed mod’s meta.cpp or its @folder name, matched ignoring case; a unique part of the name is enough. See api mods. |
Indexes are named vanilla and, for mods, the alias, the workshop id, or the mod’s folder name or title with
characters other than letters, digits, ., _ and - replaced by _ (@MyMod becomes _MyMod). The text output tags lines of mods with the index name, for example [My_Mod].
All the query commands below load vanilla first and then the selected mods, and answer over all of them. An index whose input files changed (size or modification time of a PBO, or a new format of the index) is rebuilt automatically; the cache location is in Environment and files.
Text and JSON output
Text output has one declaration per line; members carry their //! doc comment after //. JSON output is one
line, {"result": {...}, "truncated": N}, where N is the number of items cut by --max. The key inside
result names the kind: Classes, Matches, Names, Enums, Chain, Sources or Defines. src --cat --json
returns {"files": [...]}, as do --context and --lines with --json. Declarations carry module (index into the PBO list), path and line.
dayzmake api class
Show the members of a class.
dayzmake api class [-v] [--experimental] [--dayz <dir>] [-m <mods>] [--refresh] [--max <n>] [--inherited] [--mods-only] [--json] <name>
| Argument | Meaning |
|---|---|
<name> | The class name (exact, case-sensitive). |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Print a # <index>: <build> line before the result of each index. |
--experimental | off | Use the experimental branch instead of stable. |
--dayz <dir> | Steam install | A DayZ client or server directory; the index is read from <dir>/dta/scripts.pbo. |
-m <mods>, --mod <mods> | vanilla only | Also query mods; see Selecting mods. |
--refresh | off | Rebuild the cached index before answering. |
--inherited | off | Also show the members of the base classes. |
--mods-only | off | Show only what the selected mods declare. |
--max <n> | 120 | Print at most n lines (JSON: items). A cut is announced with ... N more lines (raise --max or narrow the query). |
--json | off | Print JSON instead of text. |
Behaviour: members are listed alphabetically with modifiers (static, protected, native), types, default
values and doc comments. modded class declarations of mods are shown as separate blocks tagged [modded].
With --inherited the members of each base class follow, nearest first. --mods-only hides everything the
selected mods do not declare, and is an error if no selected mod declares the class. A class that does not exist
is an error that suggests api find.
Examples:
$ dayzmake api --dayz dz class PlayerBase
class PlayerBase : Entity
bool IsAlive() // Returns true while the player is alive.
void OnRPC(PlayerIdentity sender,int rpc_type,ParamsReadContext ctx)
$ dayzmake api --dayz dz class -m @MyMod PlayerBase
class PlayerBase : Entity [vanilla 4_world]
bool IsAlive() // Returns true while the player is alive.
void OnRPC(PlayerIdentity sender,int rpc_type,ParamsReadContext ctx)
class PlayerBase [_MyMod 4_world] [modded]
void Heal(float amount) // Added by MyMod.
$ dayzmake api --dayz dz class --inherited ItemBase
class ItemBase : Entity
int m_Quantity
static const int MAX_STACK=100
int GetQuantity() // Quantity of the item in its stack.
void SetQuantity(int value,bool destroy_config=true)
class Entity
protected float m_Health
float GetHealth() // Current health of the entity.
void OnRPC(PlayerIdentity sender,int rpc_type,ParamsReadContext ctx)
void SetHealth(float value)
$ dayzmake api --dayz dz class Nope
error: no class "Nope"; try: dayzmake api find Nope
(searched vanilla only; add -m <mod> or -m all for mods)
$ dayzmake api class --max 1 PlayerBase
class PlayerBase : Entity
... 2 more lines (raise --max or narrow the query)
See also: api find, api chain, api src.
dayzmake api find
Search names, signatures and documentation with a regular expression.
dayzmake api find [-v] [--experimental] [--dayz <dir>] [-m <mods>] [--refresh] [--max <n>] [--class <class>] [--json] <regex>
| Argument | Meaning |
|---|---|
<regex> | A case-insensitive regular expression. It is matched against member names, signatures, doc comments, class names and enum items, so ^OnRPC finds the OnRPC methods. |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Print a # <index>: <build> line before the result of each index. |
--experimental | off | Use the experimental branch instead of stable. |
--dayz <dir> | Steam install | A DayZ client or server directory; the index is read from <dir>/dta/scripts.pbo. |
-m <mods>, --mod <mods> | vanilla only | Also query mods; see Selecting mods. |
--refresh | off | Rebuild the cached index before answering. |
--class <class> | all | Search only the members of this class or enum. |
--max <n> | 120 | Print at most n lines (JSON: items). A cut is announced with ... N more lines (raise --max or narrow the query). |
--json | off | Print JSON instead of text. |
Behaviour: every match is printed as <Class>: <declaration>; with mods, lines are prefixed with the index in
brackets. An invalid regular expression is an error.
Examples:
$ dayzmake api --dayz dz find '^OnRPC'
Entity: void OnRPC(PlayerIdentity sender,int rpc_type,ParamsReadContext ctx)
PlayerBase: void OnRPC(PlayerIdentity sender,int rpc_type,ParamsReadContext ctx)
$ dayzmake api --dayz dz find -m @MyMod 'heal|health'
[vanilla] Entity: protected float m_Health
[vanilla] Entity: float GetHealth() // Current health of the entity.
[vanilla] Entity: void SetHealth(float value)
[vanilla] EStatTypes: HEALTH = 0
[_MyMod] PlayerBase: void Heal(float amount) // Added by MyMod.
$ dayzmake api --dayz dz find --class ItemBase quantity
ItemBase: int m_Quantity
ItemBase: int GetQuantity() // Quantity of the item in its stack.
ItemBase: void SetQuantity(int value,bool destroy_config=true)
See also: api class, api enum.
dayzmake api sub
List the subclasses of a class.
dayzmake api sub [-v] [--experimental] [--dayz <dir>] [-m <mods>] [--refresh] [--max <n>] [--all] [--json] <name>
| Argument | Meaning |
|---|---|
<name> | The class name. |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Print a # <index>: <build> line before the result of each index. |
--experimental | off | Use the experimental branch instead of stable. |
--dayz <dir> | Steam install | A DayZ client or server directory; the index is read from <dir>/dta/scripts.pbo. |
-m <mods>, --mod <mods> | vanilla only | Also query mods; see Selecting mods. |
--refresh | off | Rebuild the cached index before answering. |
--all | off | Include indirect subclasses. |
--max <n> | 120 | Print at most n lines (JSON: items). A cut is announced with ... N more lines (raise --max or narrow the query). |
--json | off | Print JSON instead of text. |
Behaviour: prints the names on one line. Without --all only direct subclasses are listed.
Examples:
$ dayzmake api --dayz dz sub Entity
ItemBase PlayerBase
$ dayzmake api --dayz dz sub --all Entity
ItemBase PlayerBase Apple
See also: api chain.
dayzmake api enum
Show the items of an enum.
dayzmake api enum [-v] [--experimental] [--dayz <dir>] [-m <mods>] [--refresh] [--max <n>] [--json] <name>
| Argument | Meaning |
|---|---|
<name> | The enum name. |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Print a # <index>: <build> line before the result of each index. |
--experimental | off | Use the experimental branch instead of stable. |
--dayz <dir> | Steam install | A DayZ client or server directory; the index is read from <dir>/dta/scripts.pbo. |
-m <mods>, --mod <mods> | vanilla only | Also query mods; see Selecting mods. |
--refresh | off | Rebuild the cached index before answering. |
--max <n> | 120 | Print at most n lines (JSON: items). A cut is announced with ... N more lines (raise --max or narrow the query). |
--json | off | Print JSON instead of text. |
Behaviour: the values are computed, so an item without an explicit value continues counting from the previous
one. Items added by modded enum declarations of mods are included, tagged with their index.
Example:
$ dayzmake api --dayz dz enum EStatTypes
enum EStatTypes
HEALTH = 0
BLOOD = 1
SHOCK = 10
WATER = 11
See also: api find.
dayzmake api chain
Show the chain of base classes of a class.
dayzmake api chain [-v] [--experimental] [--dayz <dir>] [-m <mods>] [--refresh] [--json] <name>
| Argument | Meaning |
|---|---|
<name> | The class name. |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Print a # <index>: <build> line before the result of each index. |
--experimental | off | Use the experimental branch instead of stable. |
--dayz <dir> | Steam install | A DayZ client or server directory; the index is read from <dir>/dta/scripts.pbo. |
-m <mods>, --mod <mods> | vanilla only | Also query mods; see Selecting mods. |
--refresh | off | Rebuild the cached index before answering. |
--json | off | Print JSON instead of text. |
Behaviour: the class, its base, the base of that, up to the root, joined with >. There is no --max; chains
are short.
Example:
$ dayzmake api --dayz dz chain Apple
Apple > ItemBase > Entity
dayzmake api src
Show where a class or enum is declared, or print the files.
dayzmake api src [-v] [--experimental] [--dayz <dir>] [-m <mods>] [--refresh] [--cat] [--context <n>] [--lines <a-b>] [--json] <name>
| Argument | Meaning |
|---|---|
<name> | The class or enum name. |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Print a # <index>: <build> line before the result of each index. |
--experimental | off | Use the experimental branch instead of stable. |
--dayz <dir> | Steam install | A DayZ client or server directory; the index is read from <dir>/dta/scripts.pbo. |
-m <mods>, --mod <mods> | vanilla only | Also query mods; see Selecting mods. |
--refresh | off | Rebuild the cached index before answering. |
--cat | off | Print the full source files instead of the locations. |
--context <n> | off | Print the lines from line-n to line+n of each file that declares the name, with line numbers. |
--lines <a-b> | off | Print lines a to b of each file that declares the name, with line numbers. |
--json | off | Print JSON instead of text. |
Behaviour: without --cat, one line per declaration: [<index>] <pbo> <prefix>\<path>:<line>. With --cat, the
full source files are read from the PBOs again and printed, each after a // ==== [<index>] <pbo> <path>:<line>
header, with a blank line between files. --context and --lines print part of each file under the same header,
one <line>| <text> per line, the number right-aligned to the width of the largest number in the range ( 9| ...,
10| ...); a range outside the file is clamped to it, a greater than b is an error, and the two options exclude
each other and --cat. With --json each file carries "lines": [{"line": n, "text": "..."}] instead of text. --max does not apply. In the MCP server api_source can write the files to a file.
Examples:
$ dayzmake api --dayz dz src -m @MyMod PlayerBase
[vanilla] dta/scripts.pbo scripts\4_world\player.c:1
[_MyMod] addons/mymod.pbo mymod\4_world\mymod.c:1
$ dayzmake api --dayz dz src --cat Apple
// ==== [vanilla] dta/scripts.pbo scripts\4_world\player.c:8
class PlayerBase extends Entity
{
//! Returns true while the player is alive.
bool IsAlive();
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx);
}
class Apple extends ItemBase
{
void Eat(PlayerBase player);
}
See also: api class.
dayzmake api grep
Search the script bodies for a regular expression.
dayzmake api grep [-v] [--experimental] [--dayz <dir>] [-m <mods>] [--max <n>] [--ignore-case] [--json] <regex>
| Argument | Meaning |
|---|---|
<regex> | A regular expression, as api find takes it, matched against each line. |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Accepted for consistency; grep prints no per-index header. |
--experimental | off | Use the experimental branch instead of stable. |
--dayz <dir> | Steam install | A DayZ client or server directory; the scripts are read from <dir>/dta/scripts.pbo. |
-m <mods>, --mod <mods> | vanilla only | Also search mods; see Selecting mods. |
--max <n> | 120 | Print at most n lines (JSON: items). The rest is counted and announced with ... N more lines (raise --max or narrow the query). |
--ignore-case | off | Match case-insensitively. Without it the match is case-sensitive, unlike api find. |
--json | off | Print a JSON array of {"source", "path", "line", "text"} (plus "truncated" on cut lines) instead of text. |
Behaviour: every .c entry of dta/scripts.pbo and of the script PBOs of the selected mods is read straight
from its PBO and matched line by line on the raw source, comments included; nothing is written to disk and no
index is needed (--refresh does not apply). Output is <prefix>\<path>:<line>: <text>, the path as the
<prefix>\<path> part of api src output (without the PBO file), with [<index>] in front when mods are selected. Hits are sorted by source (vanilla first, then the mods
in -m order), then path, then line. --max limits the printed lines but the whole input is scanned, so the
number in the ... N more lines note is exact (a full scan of the game’s scripts takes well under a second).
no match is printed when nothing matches; control characters in the text are escaped (a tab shows as \t).
A matching line is printed up to its first 512 bytes (counted before escaping), cut back to the previous character boundary and followed by […];
in JSON text is cut the same way (without the marker) and the hit gets "truncated": true, only when it was cut.
JSON has no truncation note: it holds the first --max hits. An invalid regex is an error that names the pattern.
A mod PBO that cannot be read is skipped with a warning.
Examples:
$ dayzmake api grep 'GetGame\(\)\.GetMission\(\)' --max 2
scripts\3_Game\Sandstorm.c:95: \t\t\tGetGame().GetMission().GetWorldData().WeatherSandstormStart(continuedSession);
scripts\3_Game\Sandstorm.c:115: \t\t\tGetGame().GetMission().GetWorldData().WeatherSandstormStop(calledByWeather);
... 4 more lines (raise --max or narrow the query)
dayzmake api defines
List the compile-time defines that are active in the selected indexes.
dayzmake api defines [-v] [--experimental] [--dayz <dir>] [-m <mods>] [--refresh] [--max <n>] [--json] [<regex>]
| Argument | Meaning |
|---|---|
<regex> | Optional filter; only defines that match are printed. |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Print a # <index>: <build> line before the result of each index. |
--experimental | off | Use the experimental branch instead of stable. |
--dayz <dir> | Steam install | A DayZ client or server directory; the index is read from <dir>/dta/scripts.pbo. |
-m <mods>, --mod <mods> | vanilla only | Also query mods; see Selecting mods. |
--refresh | off | Rebuild the cached index before answering. |
--max <n> | 120 | Print at most n lines (JSON: items). A cut is announced with ... N more lines (raise --max or narrow the query). |
--json | off | Print JSON instead of text. |
Behaviour: lists the defines that the configs and scripts of each index declare (#define in scripts and the
defines[] of CfgMods in a mod’s config), per PBO prefix. Output is [<index>] <prefix>: <name> <name> ...;
when nothing matches it prints no matching define. The conditional compilation of the scripts (#ifdef SERVER
and so on) is evaluated with the defines of a dedicated server plus those of the mod when the index is built.
Examples:
$ dayzmake api --dayz dz defines -m @MyMod 'MYMOD|SERVER'
[_MyMod] mymod: MYMOD
$ dayzmake api --dayz dz defines
no matching define
See also: api class.
dayzmake api config
Look up a config class: its inheritance chain, its own and inherited properties, its subclasses and the PBOs that define it.
dayzmake api config [-v] [--experimental] [--dayz <dir>] [-m <mods>] [--refresh] [--max <n>] [--json] <path>
| Argument | Meaning |
|---|---|
<path> | A /-separated class path such as CfgVehicles/Hatchback_02, matched ignoring case. |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Print a # config <source>: <n> classes line for vanilla and each mod. |
--experimental | off | Use the experimental branch instead of stable. |
--dayz <dir> | Steam install | A DayZ client or server directory (it must have dta/scripts.pbo). |
-m <mods>, --mod <mods> | vanilla only | Also merge the configs of mods; see Selecting mods. |
--refresh | off | Rebuild the cached config indexes before answering. |
--max <n> | 120 | Print at most n lines; with --json at most n properties, n subclasses and n nested classes. |
--json | off | Print one JSON object instead of text. |
Which configs: every rapified config.bin and every plain config.cpp of the PBOs in the dta and addons
folders of the game (any case), including the ones in folders of a PBO (the weapon PBOs keep one per weapon), and
of the addons folder of each selected mod. -m all selects the installed mods that have scripts or a config, so
retexture and tweak mods with only a config are included. Everything else in the PBOs is left unread.
Load order and merging, as the engine does it:
- The config PBOs of the game and of all selected mods are sorted together by
CfgPatches.*.requiredAddons(an addon after the PBO that provides the addons it requires), as the engine does: a game addon that requires a mod addon loads after it, and a mod addon that a later mod requires loads first. Ties are broken by the source (the game first, then the mods in-morder) and then by the sorted path, so without dependencies the order is the game, then the mods as selected. A cycle inrequiredAddonsis a warning (api-config-order) and the PBOs involved load in that tie-break order. - A class defined again extends the earlier definition: its properties are added or overwritten. Like the engine,
the base class becomes whatever the new definition names, and no base when it names none: a mod that writes
class Hatchback_02 { ... }without: CarScriptcuts the class off from its base (the game logsUpdating base class). The lookup shows it asBase changed: CarScript -> (none) by [<source>] <pbo>, JSON hasbase_changes, and a mod’s change raises the warningapi-config-base-changed(the game’s own changes are only shown).delete X;removes the class with everything inside it.x[] += {...};appends to the array of the earlier definition or, when the class has none, of the base class. A forward declaration (class X;) creates nothing and changes nothing.
Inheritance: for class B: A the base A is looked up in the scope that holds B first (never B itself), then
in the classes that scope inherits from, then in the scopes around it, up to the top level. That is how
class HitPoints: HitPoints inside a derived class finds the HitPoints of its base. A base that is defined
nowhere ends the chain with (not found); a base that leads back to the class itself is an error
(inheritance cycle).
Output: the class path, the chain (Hatch : Base), the PBOs that define or modify the class ([<source>] <pbo>,
in load order), the resolved properties sorted by name, each tagged (from <class>) with the nearest class that
sets it (the last one that extended it, for +=), the classes declared inside the class (classes) and its direct
subclasses (classes whose base resolves to it). Long values are cut in text output. A float that overflows (1e999)
is an infinity; the text output shows it as derapify writes it, 1e999 or -1e999, and JSON as the string
"1e999" / "-1e999", since JSON has no infinity. JSON is
{"path", "name", "chain": [{"name", "path"}], "chain_end": "root" or "unknown base <name>", "properties": [{"name", "value", "origin", "origin_path"}], "subclasses", "classes", "pbos": [{"source", "pbo"}], "base_changes": [{"from", "to", "source", "pbo"}], "truncated": N}.
The index is cached like the script index: one file per source (config-vanilla-<branch>.json,
config-mod-<name>-<branch>-<hash>.json) that is rebuilt when a PBO changes, with --refresh, or after an update of
dayzmake; the sources are merged on each call. A PBO or config that cannot be read is skipped with a warning
(api-bad-config); a source over the size limit (2 million classes or 10 million properties) is cut with
api-config-limit. api update does not build it.
Example:
$ dayzmake api --dayz dz config CfgVehicles/Hatch
CfgVehicles/Hatch
chain: Hatch : Base
defined in (2):
[vanilla] Addons/zz_a.pbo
[vanilla] Addons/aa_b.pbo
properties (4):
displayName = "Hatch B" (from Hatch)
extra = 5 (from Hatch)
scope = 2 (from Hatch)
tags = {"a", "b", "b_tag"} (from Hatch)
classes (0):
subclasses (1):
Newcar
$ dayzmake api --dayz dz config CfgVehicles/Doomed
error: no config class "CfgVehicles/Doomed"; the deepest class found is "CfgVehicles"
Here aa_b.pbo requires the addon of zz_a.pbo, so it loads after it although it sorts before. Doomed is
deleted by the second addon.
See also: api class, api mods.
dayzmake api update
Rebuild the cached indexes now.
dayzmake api update [-v] [--experimental] [--dayz <dir>] [-m <mods>]
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Verbose output. |
--experimental | off | Use the experimental branch. |
--dayz <dir> | Steam install | The DayZ directory. |
-m <mods>, --mod <mods> | vanilla only | The mods to index; -m all warms the cache for every installed mod. |
Behaviour: always rebuilds, never answers a query. One line per index: its cache name, the number of classes and the build. Use it after a game update when the first query would otherwise be slow.
Examples:
$ dayzmake api update
vanilla-stable: 4 classes, stable build 17000000
$ dayzmake api -m all update
vanilla-stable: 4 classes, stable build 17000000
mod-My_Mod-stable-ceb44f75: 2 classes, stable
(-m is accepted before or after the command word.)
See also: Environment and files for the cache.
dayzmake api mods
List the installed mods.
dayzmake api mods [-v] [--experimental] [--dayz <dir>] [--json]
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Verbose output. |
--experimental | off | Look in the experimental branch’s workshop folder. |
--dayz <dir> | Steam install | The DayZ directory whose @mod folders are included. |
--json | off | Print JSON: {"mods":[{"dir","has_scripts","id","link","name"}]}. |
Behaviour: lists the mods in the workshop content folder of the branch plus every @* folder of the game
install, sorted by name. Text lines are <workshop id or -> <name> <folder> [scripts]; scripts appears when
a PBO of the mod contains .c files. Only folder listings, meta.cpp and the PBO headers are read. The names
and ids can be used with -m.
Examples:
$ dayzmake api mods
1234567890 My Mod …/steamapps/workshop/content/221100/1234567890 scripts
$ dayzmake api mods --json
{"mods":[{"dir":"…/steamapps/workshop/content/221100/1234567890","has_scripts":true,"id":1234567890,"link":null,"name":"My Mod"}]}
Errors name what is missing:
$ dayzmake api -m nonexist class X
error: no installed mod is named "nonexist" (installed: My Mod); see `dayzmake api mods`
$ dayzmake api -m cf class X
error: mod cf (workshop 1559212036) is not installed for the stable branch; subscribe to it on the Steam workshop or pass its directory
$ dayzmake api --experimental class X
error: no DayZ experimental install found in the Steam libraries; pass the install directory with --dayz <dir>
$ dayzmake api class --max abc PlayerBase
error: --max must be a number, not "abc"
Navigation meshes: navmesh
A navmesh (.nm file) tells the AI of DayZ where infected, animals and players’ pathfinding can walk. A terrain mod
ships one next to its world. dayzmake navmesh builds it: generate asks the navmesh data server of
DayZDiag_x64.exe for the geometry of the world, tile by tile, and builds the mesh from it; probe shows what the
server says about the world; info summarises a .nm file. The guide goes from a built
terrain mod to a mesh in the game; this page lists every command.
The generator is a Rust port of the Recast and Detour libraries with the changes DayZ made to them. Its output is independent of the number of threads and connections: the same input gives the same bytes. On x86 and x86_64 it uses the same approximate reciprocal square root instruction as DayZ; on other CPUs (ARM, for example) a plain division is used, and a slope very close to the maximum slope can be classified differently there. The instruction is approximate, and its result can differ between x86 CPU makers (Intel and AMD), so the same slope case can also be classified differently on two x86 machines.
The examples use a small synthetic world of 3 by 3 tiles of 50 by 50 m, served by a test server and saved as the
capture world.dzgeo. Against the game, use the address of the machine that runs DayZDiag_x64.exe; the port is
always 36533. The outputs below were produced by the program.
Data servers and captures
probe and generate talk to a data server: DayZDiag_x64.exe started with -server -startNavmeshDataServer. The
server listens on TCP port 36533 (fixed by the game). A host is written host or host:port; the port defaults to
36533, and the host to 127.0.0.1. Names are resolved to IPv4 addresses (IPv6 is not supported).
The data server opens its port about 25 seconds after DayZDiag_x64.exe starts, and a connection made while the world
is still loading can be reset (Connection reset by peer): repeat probe until it answers. The command line, the
mission and the config the server needs are in the guide. The builder was compared with the
navmeshes shipped with DayZ 1.30; the ignored test navmesh_live of dayzmake-core repeats the comparison (variables
DAYZ_NAVMESH, DAYZ_NAVMESH_CAPTURE and DAYZ_NAVMESH_INNER, and the optional DAYZ_NAVMESH_RANGE, run with
cargo test -p dayzmake-core --test navmesh_live -- --ignored); the guide lists what was compared and the result: the
inner tiles of the central half of Badlands are identical to the shipped mesh except 60 tiles with known causes, and the
polygon flags and the link array and its size are not compared.
probe, and the request for the world parameters at the start of generate, make one attempt: when the connection
cannot be made within 10 seconds, or the answer fails, the command fails at once. Tile requests connect when they are
first needed, and a tile request that fails on the network (a connect that fails, a closed connection, a timeout, a
wrong answer) is repeated on a fresh connection, five attempts in all, waiting 1, 2, 3 and 4 seconds between them (10
seconds of waiting; an attempt that cannot connect can also wait up to the 10 second connect timeout, so a host that
does not answer at all costs about a minute). When a connection is still failing after its five attempts (a server that
refuses or resets it, as a server that serves one client at a time does for the others), that connection stops and its
tile goes back to the queue for the connections that are left. A tile that fails on two connections that had delivered a
tile, or on one that had and another one, is reported as not fetched, and the connection that reported it carries on, so
one bad tile costs one tile, not the run. Failures on connections that never delivered a tile (a refused or reset start)
count only together with one that had, so a refused start loses no tile. A complete answer that is wrong (not a tile,
another tile, an unknown cell class) is a failure of that tile alone: the connection is not dead, because the whole
frame was read and the next request uses a fresh connection. A tile is reported as not fetched because of dead
connections only when no connection is left; the text of its error is the last error of the first connection that died.
A server that does not deliver a whole message within 10 minutes counts as failed (the deadline covers the message, so a
server that trickles bytes fails too). A malformed answer is not repeated. All data from a server is checked and limited
before it is used.
Use one connection per DayZDiag_x64.exe (--connections defaults to one per server): it serves one client at a time,
and the others are refused or reset. With three or more connections to one such server a tile can also fail on two
connections that had each delivered a tile; it is then reported as not fetched although the server may serve it, and the
printed to continue command tries it again.
A capture (.dzgeo) is a recording of the geometry that a server sent. generate --record writes one while it
fetches, and generate --capture builds from one without any server. A capture lets you rebuild the mesh after a
change of the generator, or on another machine, without starting the game.
generate --capture does not load the file. It reads the world parameters and the position of every tile record (a few
bytes per record, found by skipping over the tile data), and then reads only the tiles of the range when they are built.
Only the tiles of --range are put into the index, so a range of a capture of many gigabytes needs memory in proportion
to the tiles in that range; a 3 x 3 range of a 50 GB capture of 53,000 tiles takes a few seconds and about 300 MB. The
format is unchanged, so existing captures work. Records that lie outside the world grid are ignored (one message says
how many); a capture with more records than the world has tiles is refused. A library caller that opens a capture with
CaptureFile and a range must pass the range of the run to generate: a run whose range is not covered by the
indexed range is an error, not a mesh without those tiles. A tile that is cut off at the end of a capture is ignored; a
malformed tile record is reported when its tile is built, as a failed tile, not when the file is opened.
dayzmake navmesh probe
Ask the data server for the world parameters, and optionally for one tile.
dayzmake navmesh probe [-v] [--json] [--server <host>] [--tile <x,z>]
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Lifts the limit of ten warnings per warning name. |
--json | off | Print one JSON object {"params": {...}, "tile": {...}} instead of text. tile is only there with --tile. |
--server <host> | 127.0.0.1 | The data server, host or host:port. |
--tile <x,z> | none | Also fetch tile x,z (tile coordinates, from 0) and summarise it. |
The text output is, in order: the world size and the tile grid; the sea, contour and block parameters; the island
filter switch and seed; the agent (the sizes the mesh is built for); one line per cell class (the resolution of
a tile); one line per jump link class; and with --tile a line for the tile and one per group of triangles
(area is the surface type, parts the number of door and object parts, verts the number of vertices).
$ dayzmake navmesh probe --server 127.0.0.1:36533 --tile 1,1
world 150.0 x 150.0 m, tiles 3 x 3 of 50.0 x 50.0 m
deep sea height 0.75, deep water depth 1.50, contour error 0.300, obstacles 1, block 4
filter islands 1, seed (60.0, 10.0, 60.0)
agent: stand 1.50 crouch 1.00 prone 0.50 diameter 0.60 step 0.45 slope 45.0
cell class 0: 200 cells over 50.00 m (cs 0.250) [unk 200 0]
cell class 1: 500 cells over 50.00 m (cs 0.100) [unk 500 0]
link 0: typeId -1 len 1.80 height 1.20 centre 0.40 dropdown 0.00..0.00 agent h 1.50 step 0.45 r 0.30 flags 0x100 area 48
tile (1,1) cell class 1 bounds (50.00 0.00 50.00)-(100.00 30.00 100.00), 7 groups
area 1: 0 parts, 7350 verts
area 9: 0 parts, 72 verts
area 8: 0 parts, 186 verts
area 12: 1 parts, 36 verts
area 13: 1 parts, 36 verts
area 10: 1 parts, 72 verts
area 15: 0 parts, 2 verts
With --json the object has params (worldSizeX, worldSizeZ, tilesX, tilesZ, tileWidth, tileHeight,
seaLevel, deepWaterDepth, contourMaxError, obstacles, blockSize, filterIsolatedIslands, seed, agent,
cellClasses, linkClasses) and, with --tile, tile (x, z, cellClass, bmin, bmax and groups, a list
of area, parts and verts):
$ dayzmake navmesh probe --json --server 127.0.0.1:36533
{"params":{"agent":{"crouchHeight":1.0,"diameter":0.6,"maxSlope":45.0,"maxStepHeight":0.45,"proneHeight":0.5,"standHeight":1.5},"blockSize":4,"cellClasses":[{"cellSize":0.25,"cells":200,"width":50.0},{"cellSize":0.1,"cells":500,"width":50.0}],"contourMaxError":0.3,"deepWaterDepth":1.5,"filterIsolatedIslands":true,"linkClasses":[{"agentHeight":1.5,"agentRadius":0.3,"area":48,"dropdownMax":0.0,"dropdownMin":0.0,"flags":256,"index":0,"jumpHeight":1.2,"jumpLength":1.8,"maxStepHeight":0.45,"minCenterHeight":0.4,"typeId":-1}],"obstacles":true,"seaLevel":0.75,"seed":[60.0,10.0,60.0],"tileHeight":50.0,"tileWidth":50.0,"tilesX":3,"tilesZ":3,"worldSizeX":150.0,"worldSizeZ":150.0}}
When nothing listens on the port the command fails with status 1 and says how to start the server:
$ dayzmake navmesh probe --server 127.0.0.1:9
error: cannot connect to 127.0.0.1:9: Connection refused (os error 111); start DayZDiag_x64.exe with -server -startNavmeshDataServer
dayzmake navmesh generate
Build a navmesh from a data server or a capture and write it to <target>.
dayzmake navmesh generate [-v] [-f] [--server <host>]... [--capture <dzgeo>] [--record <dzgeo>] [--range <x0,z0,x1,z1>] [--base <nm>] [--skip-existing] [--checkpoint <n>] [--threads <n>] [--connections <n>] [--sea-level <m>] [--doors <state>] [--no-links] [--no-island-filter] [--seed <x,y,z>] <target>
| Argument | Meaning |
|---|---|
<target> | The .nm file to write. It is written atomically (a temporary file next to it, renamed at the end). |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Lifts the limit of ten warnings per warning name. |
-f, --force | off | Overwrite an existing <target> and an existing --record file. Without it, an existing target is an error that is reported before anything is fetched. |
--server <host> | 127.0.0.1 | A data server, host or host:port. Repeatable: the connections are spread over the servers, which must serve the same world (several DayZDiag_x64.exe on several machines build faster). The world parameters come from the first one. Not together with --capture. |
--capture <dzgeo> | none | Build from this capture instead of a server. Tiles the capture does not have are left out. Without --range the range is the bounding box of the captured tiles. |
--record <dzgeo> | none | Also write the fetched tiles to a capture file. It must not be the file read with --capture (the run is refused: writing it would destroy the capture). |
--range <x0,z0,x1,z1> | the whole world | The tiles to build: columns x0 to x1 and rows z0 to z1, inclusive. Values below 0 or beyond the grid are cut to the world; an upper bound below 0 means the last tile. A range with nothing left is the error empty tile range. |
--base <nm> | none | Start from this navmesh: its grid is kept, and the new tiles replace the tiles of their cells. It must fit the world (grid, tile size and origin), or the run fails with base navmesh does not match the world. |
--skip-existing | off | Leave out the tiles that --base already has. Needs --base (--skip-existing needs --base). |
--checkpoint <n> | 0 (off) | Write the target after every n finished tiles (built, empty or failed). Each checkpoint rewrites the whole file, so use a large n (hundreds or thousands of tiles) for a big world. A negative value is an error; 0 means off. A checkpoint that cannot be written stops the run, which is then a failure (see below). |
--threads <n> | cores - 1, at least 1 | Builder threads, at most 256. 0 means the default; a negative number is an error. |
--connections <n> | one per server (1 for a capture) | Connections to the servers, at most 256. 0 means the default; a negative number is an error. |
--sea-level <m> | the server’s deep sea height | The sea level in metres. |
--doors <state> | closed | The state of the doors baked into the mesh. closed: the polygons of open doors are disabled, those of closed doors are not. open: the other way round. enabled: no door polygon is disabled. |
--no-links | links on | Leave out jump, climb and ladder links. |
--no-island-filter | filter on | Do not flag polygons that cannot be reached from the seed. |
--seed <x,y,z> | the world’s seed position | Where the island filter starts (world coordinates in metres). |
The command prints, to standard error, a progress line, which is rewritten in place on a terminal and appears at most once per 5 % when the output is redirected:
1/9 tiles (0 failed), 21.8 tiles/s, 0:00:00 left
Then, to standard output, the summary: the number of tiles built, empty and failed and the time; the first twenty
failures, indented; a line when tiles had door part numbers outside their range (the warning navmesh-stray-part
is raised for them); the result of the island filter; and wrote <target>.
$ dayzmake navmesh generate --capture world.dzgeo --threads 2 mymap.nm
built 9 tiles, 0 empty, 0 failed in 0.4 s
island filter: seed (60.0 10.0 60.0) -> 84 reachable, 1 isolated polys
wrote mymap.nm
A tile without walkable surface is empty: the tile of that cell is removed from a --base mesh. A tile that cannot
be built is failed and raises the warning navmesh-tile-failed; it does not stop the run. The island filter
runs over the whole mesh at the end, so a resumed run (below) filters the merged mesh. When the seed finds no
polygon the filter is skipped with the warning navmesh-seed.
Memory: the tiles fetched but not yet built or applied wait in queues whose length is limited, not their size. A tile
record can be large (a frame may be up to 1 GiB) and nothing limits the total bytes, so a world with huge tiles needs
memory in proportion; --record keeps each fetched tile until it has been written.
The target is written even when the run was partial. The exit status is 0 when every tile was handled, and 1 when
a tile failed, a tile could not be fetched, or a checkpoint or --record write failed.
A run that was stopped (a checkpoint or --record write failed), or that had tiles it could not fetch and no tile
that failed to build, ends with the command that continues it. The command repeats every option of the run except
--record (with -f it would overwrite the first recording) and --base, which becomes the target, so the rest is
built with the same settings. A tile that failed to build is not offered for a retry, because it would fail again. The
printed command is quoted for a POSIX shell (single quotes around anything but letters, digits and _@%+=:,./-); that
works in bash and zsh; PowerShell and cmd.exe users adapt the quotes ('\'' does not work in PowerShell). With a
server that closes every connection, one tile (five attempts, 1+2+3+4 s between them, 10 seconds in all) gives:
$ dayzmake navmesh generate --server 127.0.0.1:36533 --range 0,0,0,0 --threads 2 lost.nm
warning: island filter skipped: no polygon near the seed (60.0 10.0 60.0) [navmesh-seed]
built 0 tiles, 0 empty, 0 failed in 10.0 s
tile (0,0): connection to 127.0.0.1:36533 closed by the server
wrote lost.nm
to continue: dayzmake navmesh generate --base lost.nm --skip-existing -f --server 127.0.0.1:36533 --range 0,0,0,0 --threads 2 lost.nm
error: 0 tiles could not be built and 1 could not be fetched; the mesh was saved without them
--base <target> --skip-existing over the same range builds only the tiles that are still missing, and the result
is the same as an uninterrupted run:
$ dayzmake navmesh generate --server 127.0.0.1:36533 --range 0,0,2,0 --threads 2 --record rec.dzgeo part.nm
warning: island filter skipped: no polygon near the seed (60.0 10.0 60.0) [navmesh-seed]
built 3 tiles, 0 empty, 0 failed in 0.1 s
wrote part.nm
$ dayzmake navmesh generate --server 127.0.0.1:36533 --base part.nm --skip-existing --threads 2 -f part.nm
built 6 tiles, 0 empty, 0 failed in 0.3 s
island filter: seed (60.0 10.0 60.0) -> 84 reachable, 1 isolated polys
wrote part.nm
(The first run raised the warning navmesh-seed shown above, because the seed lies in a row that was not built.)
Errors:
$ dayzmake navmesh generate --capture world.dzgeo --threads 2 mymap.nm
error: Target file "mymap.nm" already exists. Use --force to overwrite.
$ dayzmake navmesh generate --capture world.dzgeo --range 1,2,3 mymap2.nm
error: --range: expected x0,z0,x1,z1, got "1,2,3"
dayzmake navmesh info
Summarise a .nm file.
dayzmake navmesh info [-v] [--json] [--tiles] <source>
| Argument | Meaning |
|---|---|
<source> | The .nm file (set version 7 or 9). |
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Lifts the limit of ten warnings per warning name. |
--json | off | Print one JSON object instead of text. |
--tiles | off | List every tile: x z ref polys verts offmesh parts obstacles. |
The summary gives the file version as read (7 or 9; generate always writes 9), the grid and the size of a tile, the
number of tile slots (max tiles), the number of tiles and the totals of polygons, vertices and off-mesh connections
(the jump, climb and ladder links). ref is the tile reference in hex, parts the door and object parts of the tile
and obstacles its tree obstacles.
$ dayzmake navmesh info --tiles mymap.nm
navmesh version 9, grid 3 x 3 tiles of 50.0 x 50.0 m, max tiles 9
tiles 9, polys 85, verts 159, off-mesh connections 12
x z ref polys verts offmesh parts obstacles
0 0 0x1000000000000 2 6 0 0 1
1 0 0x1000000100000 1 4 0 2 0
2 0 0x1000000200000 1 4 0 2 1
0 1 0x1000000300000 4 8 0 0 1
1 1 0x1000000400000 41 85 12 2 0
2 1 0x1000000500000 2 6 0 2 0
0 2 0x1000000600000 30 34 0 0 0
1 2 0x1000000700000 2 6 0 0 1
2 2 0x1000000800000 2 6 0 0 1
With --json the object has version, tilesX, tilesZ, tileWidth, tileHeight, maxTiles, maxPolys,
tileCount, polys, verts and offMesh, and with --tiles a list tiles of objects with x, z, ref,
polys, verts, offMesh, parts and obstacles:
$ dayzmake navmesh info --json mymap.nm
{"maxPolys":1048576,"maxTiles":9,"offMesh":12,"polys":85,"tileCount":9,"tileHeight":50.0,"tileWidth":50.0,"tilesX":3,"tilesZ":3,"version":9,"verts":159}
A file that is not a navmesh set is an error.
MCP server: mcp and its tools
The Model Context Protocol (MCP) lets an AI assistant call tools. dayzmake mcp is an MCP server that offers the script
API index, the file commands and the navmesh commands of dayzmake as tools. The guide shows how to
register it; this page is the reference of the protocol subset and of every tool.
dayzmake mcp
Run the MCP server on standard input and output.
dayzmake mcp [-v]
| Option | Default | Meaning |
|---|---|---|
-v, --verbose | off | Lift the limit of ten warnings per name in each tool call. |
Behaviour:
- Transport: newline-delimited JSON-RPC 2.0 on standard input and output, one JSON object per line. Standard output carries nothing but JSON-RPC replies; progress notes of tools (for example the Proton sandbox) go to standard error. The server runs until its standard input ends and then exits with status 0.
- Methods:
initialize(answers with the protocol version it was asked for if it is2025-06-18,2025-03-26or2024-11-05, else2025-06-18; capabilities are{"tools": {}}),ping,tools/listandtools/call. Notifications get no reply. Resources, prompts and sampling are not offered. - Requests are handled one after the other. A request line may be at most 16 MiB; a longer one is answered with
request line too longand skipped. - Tool arguments are JSON objects; a missing required argument, or an argument of the wrong type, gives a tool
error result such as
argument "pbo" must be a string. - The tools take file paths as given, relative to the working directory of the server, and act with the
permissions of the user who runs it: they can read, create and, with
force, overwrite any file that user can. No tool overwrites a file unlessforceis true. Register the server only with a client you trust to do that.
See also: Using dayzmake from an MCP client, Script API: api.
Results and errors
A successful tools/call returns {"content": [{"type": "text", "text": "..."}], "isError": false}. A tool that
fails returns the same shape with isError: true and the error message as the text; the server keeps running.
- Warnings of the call come first:
warnings:and one line per warning, a blank line, then the output. A cut never drops them. Each call has its own ten-per-name limit. - Output is capped at 200000 bytes. A cut result ends with
[truncated: showing bytes A-B of N; call again with offset=B]. Theoffsetandlengtharguments exist onpbo_catandapi_source; other tools return their whole (short) output. - A panic in a tool is caught and reported as
internal error: the tool "<name>" panicked.
Protocol errors are JSON-RPC errors:
| Code | When |
|---|---|
-32700 | The line is not JSON (parse error). |
-32600 | The request is not an object, has an invalid id or no method, or the line is too long. |
-32601 | Unknown method (method not found: <method>). |
-32602 | tools/call with bad parameters or an unknown tool (unknown tool "<name>"). |
A session with the real server (the lines starting with > are requests, the other lines replies; mymod.pbo
is the PBO of the first mod guide):
> {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"doc","version":"1"}}}
{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"tools":{}},"protocolVersion":"2025-06-18","serverInfo":{"name":"dayzmake","version":"3.2.0"}}}
> {"jsonrpc":"2.0","method":"notifications/initialized"}
> {"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"api_class","arguments":{"name":"PlayerBase","mods":"My Mod"}}}
{"id":2,"jsonrpc":"2.0","result":{"content":[{"text":"class PlayerBase : Entity [vanilla 4_world]\n bool IsAlive() // Returns true while the player is alive.\n void OnRPC(PlayerIdentity sender,int rpc_type,ParamsReadContext ctx)\nclass PlayerBase [My_Mod 4_world] [modded]\n void Heal(float amount) // Added by MyMod.","type":"text"}],"isError":false}}
> {"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"pbo_cat","arguments":{"pbo":"mymod.pbo","file":"config.bin"}}}
{"id":3,"jsonrpc":"2.0","result":{"content":[{"text":"the entry is not UTF-8 text (291 bytes); pass target to write it to a file","type":"text"}],"isError":true}}
> {"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"nope","arguments":{}}}
{"error":{"code":-32602,"message":"unknown tool \"nope\""},"id":4,"jsonrpc":"2.0"}
> {"jsonrpc":"2.0","id":5,"method":"tools/call","params":{"name":"pbo_build","arguments":{"source":"t21","target":"t21-mcp.pbo"}}}
{"id":5,"jsonrpc":"2.0","result":{"content":[{"text":"warnings:\nIn file small.p3d: warning: Model references texture \"t21\\data\\gone_co.paa\", which is not in the addon. [missing-texture]\nIn file small.p3d: warning: Model references material \"t21\\data\\m.rvmat\", which is not in the addon. [missing-material]\nIn file small.p3d: warning: On non-Windows systems binarize.exe is only used with --proton-binarize; file will be copied as-is. [non-windows-binarization]\n\nwrote t21-mcp.pbo","type":"text"}],"isError":false}}
> {"jsonrpc":"2.0","id":6,"method":"tools/call","params":{"name":"pbo_build","arguments":{"source":"t21","target":"t21-mcp.pbo"}}}
{"id":6,"jsonrpc":"2.0","result":{"content":[{"text":"Target file \"t21-mcp.pbo\" already exists. Use --force to overwrite.","type":"text"}],"isError":true}}
> {"jsonrpc":"2.0","id":7,"method":"tools/call","params":{"name":"pbo_verify","arguments":{"public_key":"mykey.bikey","pbo":"mymod.pbo"}}}
{"id":7,"jsonrpc":"2.0","result":{"content":[{"text":"signature is valid","type":"text"}],"isError":false}}
Tools
The API tools take the same mods, experimental, dayz and refresh arguments, and json and max where the
CLI command has --json and --max; without mods only vanilla is queried and no tool defaults to all. The
file tools take the arguments of their CLI counterparts, with force for --force.
api_class
Members of a DayZ script class from the installed scripts.pbo (vanilla; mods only when selected with mods).
| Argument | Type | Required | Meaning |
|---|---|---|---|
name | string | yes | Class name. |
dayz | string | no | DayZ client/server directory (uses <dir>/dta/scripts.pbo) instead of the Steam install. |
experimental | boolean | no | Use the experimental branch instead of stable. |
inherited | boolean | no | Also show the base classes. |
json | boolean | no | Return JSON instead of text. |
max | integer (≥ 0) | no | At most this many lines or items (default 120). |
mods | string | no | Also query these mods, comma separated: cf, cot, dabs, expansion, aliases (those four, if installed), all (every installed mod with scripts; the first run builds the caches and can take a while, later runs are quick; api_update with mods=all warms them), a workshop id, a mod name or @dir name (see api_mods) or a mod directory. Without it only vanilla is queried. |
mods_only | boolean | no | Show only what the selected mods declare. |
refresh | boolean | no | Rebuild the cached index first. |
Result: The text of dayzmake api class, or JSON with json. See api class.
api_find
Case-insensitive regex over member names, signatures, docs, class names and enum items (so ^OnRPC finds the OnRPC methods).
| Argument | Type | Required | Meaning |
|---|---|---|---|
regex | string | yes | The regular expression. |
class | string | no | Search only the members of this class or enum. |
dayz | string | no | DayZ client/server directory (uses <dir>/dta/scripts.pbo) instead of the Steam install. |
experimental | boolean | no | Use the experimental branch instead of stable. |
json | boolean | no | Return JSON instead of text. |
max | integer (≥ 0) | no | At most this many lines or items (default 120). |
mods | string | no | Also query these mods, comma separated: cf, cot, dabs, expansion, aliases (those four, if installed), all (every installed mod with scripts; the first run builds the caches and can take a while, later runs are quick; api_update with mods=all warms them), a workshop id, a mod name or @dir name (see api_mods) or a mod directory. Without it only vanilla is queried. |
refresh | boolean | no | Rebuild the cached index first. |
Result: The text of dayzmake api find. See api find.
api_subclasses
Subclasses of a class.
| Argument | Type | Required | Meaning |
|---|---|---|---|
name | string | yes | Class name. |
all | boolean | no | Include indirect subclasses. |
dayz | string | no | DayZ client/server directory (uses <dir>/dta/scripts.pbo) instead of the Steam install. |
experimental | boolean | no | Use the experimental branch instead of stable. |
json | boolean | no | Return JSON instead of text. |
max | integer (≥ 0) | no | At most this many lines or items (default 120). |
mods | string | no | Also query these mods, comma separated: cf, cot, dabs, expansion, aliases (those four, if installed), all (every installed mod with scripts; the first run builds the caches and can take a while, later runs are quick; api_update with mods=all warms them), a workshop id, a mod name or @dir name (see api_mods) or a mod directory. Without it only vanilla is queried. |
refresh | boolean | no | Rebuild the cached index first. |
Result: The names on one line, as dayzmake api sub.
api_enum
Items of an enum.
| Argument | Type | Required | Meaning |
|---|---|---|---|
name | string | yes | Enum name. |
dayz | string | no | DayZ client/server directory (uses <dir>/dta/scripts.pbo) instead of the Steam install. |
experimental | boolean | no | Use the experimental branch instead of stable. |
json | boolean | no | Return JSON instead of text. |
max | integer (≥ 0) | no | At most this many lines or items (default 120). |
mods | string | no | Also query these mods, comma separated: cf, cot, dabs, expansion, aliases (those four, if installed), all (every installed mod with scripts; the first run builds the caches and can take a while, later runs are quick; api_update with mods=all warms them), a workshop id, a mod name or @dir name (see api_mods) or a mod directory. Without it only vanilla is queried. |
refresh | boolean | no | Rebuild the cached index first. |
Result: The text of dayzmake api enum.
api_chain
Base class chain of a class.
| Argument | Type | Required | Meaning |
|---|---|---|---|
name | string | yes | Class name. |
dayz | string | no | DayZ client/server directory (uses <dir>/dta/scripts.pbo) instead of the Steam install. |
experimental | boolean | no | Use the experimental branch instead of stable. |
json | boolean | no | Return JSON instead of text. |
mods | string | no | Also query these mods, comma separated: cf, cot, dabs, expansion, aliases (those four, if installed), all (every installed mod with scripts; the first run builds the caches and can take a while, later runs are quick; api_update with mods=all warms them), a workshop id, a mod name or @dir name (see api_mods) or a mod directory. Without it only vanilla is queried. |
refresh | boolean | no | Rebuild the cached index first. |
Result: The chain, as dayzmake api chain.
api_source
Files and lines that declare a class or enum; with cat the full source files, with context or lines part of them.
| Argument | Type | Required | Meaning |
|---|---|---|---|
name | string | yes | Class or enum name. |
cat | boolean | no | Return the full source files (with json: the files as JSON). |
context | integer (≥ 0) | no | Return n lines around each declaration, with line numbers (excludes cat and lines). |
dayz | string | no | DayZ client/server directory (uses <dir>/dta/scripts.pbo) instead of the Steam install. |
experimental | boolean | no | Use the experimental branch instead of stable. |
force | boolean | no | Overwrite existing target files. |
json | boolean | no | Return JSON instead of text. |
length | integer (≥ 0) | no | Return at most this many bytes (default and maximum 200000). |
lines | string | no | Return lines a to b of each file as “a-b”, with line numbers (excludes cat and context). |
max | integer (≥ 0) | no | At most this many lines or items (default 120). |
mods | string | no | Also query these mods, comma separated: cf, cot, dabs, expansion, aliases (those four, if installed), all (every installed mod with scripts; the first run builds the caches and can take a while, later runs are quick; api_update with mods=all warms them), a workshop id, a mod name or @dir name (see api_mods) or a mod directory. Without it only vanilla is queried. |
offset | integer (≥ 0) | no | Start at this byte of the output (default 0). A cut-off reply names the offset that fetches the rest. |
refresh | boolean | no | Rebuild the cached index first. |
target | string | no | With cat: write the files to this file instead of returning them (cannot be combined with context or lines). |
Result: The locations, as dayzmake api src; with cat the source files, which can be long: use offset and length to page, or target to write them to a file (target together with context or lines, or without cat, is an error).
api_grep
Full-text search over the script bodies (every .c file of vanilla and the selected mods, read from the PBOs). Matches raw lines, comments included.
| Argument | Type | Required | Meaning |
|---|---|---|---|
regex | string | yes | Regular expression, matched against each line. |
ignore_case | boolean | no | Match case-insensitively. |
dayz | string | no | DayZ client/server directory (uses <dir>/dta/scripts.pbo) instead of the Steam install. |
experimental | boolean | no | Use the experimental branch instead of stable. |
json | boolean | no | Return JSON instead of text. |
max | integer (≥ 0) | no | At most this many lines or items (default 120). |
mods | string | no | Also query these mods, comma separated: cf, cot, dabs, expansion, aliases (those four, if installed), all (every installed mod with scripts; the first run builds the caches and can take a while, later runs are quick; api_update with mods=all warms them), a workshop id, a mod name or @dir name (see api_mods) or a mod directory. Without it only vanilla is queried. |
Result: The matching lines, as dayzmake api grep.
api_config
Look up a config class (config.bin and config.cpp of the game and the selected mods, merged in load order the way the engine does): its inheritance chain, its own and inherited properties each tagged with the class they come from, its direct subclasses and the PBOs that define it; a redefinition that changes or drops the base class (as the engine does) is reported as a base change. The path is a /-separated class path such as CfgVehicles/Hatchback_02, matched ignoring case.
| Argument | Type | Required | Meaning |
|---|---|---|---|
path | string | yes | The class path, for example CfgVehicles/Hatchback_02 or CfgWeapons/M4A1. |
dayz | string | no | DayZ client/server directory (uses <dir>/dta/scripts.pbo) instead of the Steam install. |
experimental | boolean | no | Use the experimental branch instead of stable. |
json | boolean | no | Return JSON instead of text. |
max | integer (≥ 0) | no | At most this many lines or items (default 120). |
mods | string | no | Also query these mods, comma separated: cf, cot, dabs, expansion, aliases (those four, if installed), all (every installed mod with scripts; the first run builds the caches and can take a while, later runs are quick; api_update with mods=all warms them), a workshop id, a mod name or @dir name (see api_mods) or a mod directory. Without it only vanilla is queried. |
refresh | boolean | no | Rebuild the cached index first. |
Result: The class, as dayzmake api config.
api_defines
Compile-time defines of the selected indexes, optionally filtered by a regex.
| Argument | Type | Required | Meaning |
|---|---|---|---|
dayz | string | no | DayZ client/server directory (uses <dir>/dta/scripts.pbo) instead of the Steam install. |
experimental | boolean | no | Use the experimental branch instead of stable. |
json | boolean | no | Return JSON instead of text. |
max | integer (≥ 0) | no | At most this many lines or items (default 120). |
mods | string | no | Also query these mods, comma separated: cf, cot, dabs, expansion, aliases (those four, if installed), all (every installed mod with scripts; the first run builds the caches and can take a while, later runs are quick; api_update with mods=all warms them), a workshop id, a mod name or @dir name (see api_mods) or a mod directory. Without it only vanilla is queried. |
refresh | boolean | no | Rebuild the cached index first. |
regex | string | no | Filter regular expression. |
Result: The defines, as dayzmake api defines.
api_update
Rebuild the cached indexes now. With mods=all this indexes every installed mod, which warms the caches for later queries.
| Argument | Type | Required | Meaning |
|---|---|---|---|
dayz | string | no | DayZ client/server directory (uses <dir>/dta/scripts.pbo) instead of the Steam install. |
experimental | boolean | no | Use the experimental branch instead of stable. |
mods | string | no | Also query these mods, comma separated: cf, cot, dabs, expansion, aliases (those four, if installed), all (every installed mod with scripts; the first run builds the caches and can take a while, later runs are quick; api_update with mods=all warms them), a workshop id, a mod name or @dir name (see api_mods) or a mod directory. Without it only vanilla is queried. |
refresh | boolean | no | Rebuild the cached index first. |
Result: One line per rebuilt index, as dayzmake api update.
api_mods
List the installed mods (workshop id, name, directory, whether they have scripts); the names and ids can be used in the mods argument of the other api tools. Reading them is quick; querying all of them with mods=all builds the caches on the first run and can take a while; api_update with mods=all warms them.
| Argument | Type | Required | Meaning |
|---|---|---|---|
dayz | string | no | DayZ client/server directory instead of the Steam install. |
experimental | boolean | no | Use the experimental branch instead of stable. |
json | boolean | no | Return JSON instead of text. |
Result: The installed mods, as dayzmake api mods (JSON with json).
pbo_inspect
List the entries of a PBO, or describe a model (P3D, MLOD or ODOL v56: format, LODs, textures, selections).
| Argument | Type | Required | Meaning |
|---|---|---|---|
path | string | yes | PBO or P3D file. |
json | boolean | no | PBOs only: return the header as JSON with the raw bytes of names as hex. |
Result: The text of dayzmake inspect: the PBO listing or the model description; with json, the object of
dayzmake inspect --json (an error for a model).
pbo_cat
Read one entry of a PBO: returned as text if it is UTF-8, otherwise write it to target.
| Argument | Type | Required | Meaning |
|---|---|---|---|
file | string | yes | Entry name. |
pbo | string | yes | PBO file. |
force | boolean | no | Overwrite existing target files. |
length | integer (≥ 0) | no | Return at most this many bytes (default and maximum 200000). |
offset | integer (≥ 0) | no | Start at this byte of the output (default 0). A cut-off reply names the offset that fetches the rest. |
target | string | no | Write the entry to this file instead of returning it (required for binary data). |
Result: The entry as text when it is UTF-8, or wrote <target> (<n> bytes) with target. A binary entry without target is an error: the entry is not UTF-8 text (291 bytes); pass target to write it to a file. Large entries are cut at 200000 bytes with a note that names the offset that continues.
pbo_unpack
Unpack a PBO into a folder, all of it or the entries selected by only and exclude. Unsafe entry names are skipped with a warning.
| Argument | Type | Required | Meaning |
|---|---|---|---|
pbo | string | yes | PBO file. |
target | string | yes | Folder to extract into. |
force | boolean | no | Overwrite existing target files. |
use_prefix | boolean | no | Extract into <target>/<prefix>/. |
exclude | array of strings | no | Glob patterns of entries to leave out (case-insensitive, / separators). |
only | array of strings | no | Glob patterns: write only the entries that match one (exclude wins). |
Result: unpacked <pbo> to <target>.
extract
Unpack every PBO of a DayZ install, a mod folder or a single PBO into one tree <target>/<prefix>/<entry>, optionally derapified, and write the prefix to PBO map pbo-map.tsv. The tree replaces an existing target atomically with force.
| Argument | Type | Required | Meaning |
|---|---|---|---|
source | string | yes | DayZ client or server folder, mod folder (dta/ and addons/ are searched) or one PBO. |
target | string | yes | Folder to write the tree to. |
force | boolean | no | Replace an earlier extract result or an empty folder. |
derapify | boolean | no | Write every rapified .bin as a .cpp of the same name. |
exclude | array of strings | no | Glob patterns of entries to leave out (case-insensitive, / separators). |
only | array of strings | no | Glob patterns: write only the entries that match one (exclude wins). |
Result: extracted <n> files from <m> PBOs to <target>. See extract.
pbo_pack
Pack a folder into a PBO without binarizing or rapifying.
| Argument | Type | Required | Meaning |
|---|---|---|---|
source | string | yes | Folder to pack. |
target | string | yes | PBO file to write. |
exclude | array of strings | no | Glob patterns to leave out. |
force | boolean | no | Overwrite existing target files. |
headerext | array of strings | no | Header extensions as key=value. |
key | string | no | Private key (.biprivatekey): sign the PBO after packing. |
Result: wrote <target>, or wrote and signed <target> when key was given.
pbo_build
Build a PBO from a folder, rapifying configs and binarizing models.
| Argument | Type | Required | Meaning |
|---|---|---|---|
source | string | yes | Folder to pack. |
target | string | yes | PBO file to write. |
exclude | array of strings | no | Glob patterns to leave out. |
force | boolean | no | Overwrite existing target files. |
headerext | array of strings | no | Header extensions as key=value. |
include | array of strings | no | Folders to search for includes (the current directory is only checked directly, not searched). |
key | string | no | Private key (.biprivatekey): sign the PBO after packing. |
proton_binarize | boolean | no | Linux: binarize models with DayZ Tools’ binarize.exe under Proton. |
Result: wrote <target>. Warnings of the build come first in the text.
config_rapify
Preprocess and rapify a config file.
| Argument | Type | Required | Meaning |
|---|---|---|---|
source | string | yes | Config source file. |
target | string | yes | File to write. |
force | boolean | no | Overwrite existing target files. |
include | array of strings | no | Folders to search for includes. |
Result: wrote <target> (<n> bytes).
config_derapify
Convert a rapified config back to text.
| Argument | Type | Required | Meaning |
|---|---|---|---|
source | string | yes | Rapified config. |
force | boolean | no | Overwrite existing target files. |
target | string | no | Write the text here; absent: return it. |
indent | string | no | Indentation per level: spaces and tabs only, at most 64 characters, default four spaces. |
Result: The text of the config, or wrote <target> (<n> bytes) with target.
config_preprocess
Preprocess a file (macros, includes).
| Argument | Type | Required | Meaning |
|---|---|---|---|
source | string | yes | File to preprocess. |
force | boolean | no | Overwrite existing target files. |
include | array of strings | no | Folders to search for includes. |
target | string | no | Write the result here; absent: return it. |
Result: The preprocessed text, or wrote <target> (<n> bytes) with target.
paa_to_image
Convert a PAA texture to an image (the format follows the target extension, e.g. png). DXT1 to DXT5, RGBA,
ARGB4444, ARGB1555 and AI88 are read; a PNG file named .paa gets an error that says so.
| Argument | Type | Required | Meaning |
|---|---|---|---|
source | string | yes | PAA file. |
target | string | yes | Image file to write. |
force | boolean | no | Overwrite existing target files. |
Result: wrote <target>.
image_to_paa
Convert an image to a PAA texture.
| Argument | Type | Required | Meaning |
|---|---|---|---|
source | string | yes | Image file. |
target | string | yes | PAA file to write. |
compress | boolean | no | LZO-compress DXT mipmaps wider than 128 px (always done; kept for compatibility). |
force | boolean | no | Overwrite existing target files. |
type | string | no | PAA type, e.g. dxt1, dxt5 (default dxt5). |
Result: wrote <target>.
key_generate
Generate a key pair (<name>.biprivatekey and <name>.bikey).
| Argument | Type | Required | Meaning |
|---|---|---|---|
name | string | yes | Path of the key without extension. |
force | boolean | no | Overwrite existing target files. |
Result: generated <name>.biprivatekey and <name>.bikey.
pbo_sign
Sign a PBO with a private key.
| Argument | Type | Required | Meaning |
|---|---|---|---|
pbo | string | yes | PBO file. |
private_key | string | yes | Private key file. |
force | boolean | no | Overwrite existing target files. |
signature | string | no | Signature file (default <pbo>.<key>.bisign). |
v2 | boolean | no | Write an older v2 signature. |
Result: signed; the signature is written to signature, by default <pbo>.<key>.bisign.
pbo_verify
Verify the signature of a PBO with a public key.
| Argument | Type | Required | Meaning |
|---|---|---|---|
pbo | string | yes | PBO file. |
public_key | string | yes | Public key file (.bikey). |
signature | string | no | Signature file (default <pbo>.<key>.bisign). |
Result: signature is valid, or an error result that says what does not match.
binarize
Binarize a model with BI’s binarize.exe (Windows; on Linux through Proton).
| Argument | Type | Required | Meaning |
|---|---|---|---|
source | string | yes | Model file. |
target | string | yes | File to write. |
force | boolean | no | Overwrite existing target files. |
Result: wrote <target>, or an error when DayZ Tools or Proton cannot be found (see Binarizing models).
navmesh_probe
Ask the navmesh data server of DayZDiag_x64.exe (started with -startNavmeshDataServer) for the world parameters and, with tile, one tile.
| Argument | Type | Required | Meaning |
|---|---|---|---|
server | string | no | Data server, host or host:port (port 36533 by default, host 127.0.0.1). |
tile | string | no | Also fetch this tile and summarise it, as "x,z". |
json | boolean | no | Return JSON instead of text. |
Result: the text of dayzmake navmesh probe (JSON with json), or an error that names the server and how to start it. See navmesh.
navmesh_generate
Build the navmesh (.nm) of a terrain mod from a navmesh data server or a capture and save it to target. A whole map can take many minutes, and the call returns only when the run is over; use range for a part. The mesh is saved even when some tiles failed, and the call then reports an error that says so.
| Argument | Type | Required | Meaning |
|---|---|---|---|
target | string | yes | The .nm file to write. |
server | array of strings | no | Data servers, each host or host:port (default 127.0.0.1); several share the work. Not with capture. |
capture | string | no | Read the tiles from this .dzgeo capture instead of a server. |
record | string | no | Write the fetched tiles to this .dzgeo capture. |
range | string | no | Tile range to build as "x0,z0,x1,z1" (inclusive, clamped to the world). |
base | string | no | Patch the new tiles into this existing .nm. |
skip_existing | boolean | no | Leave out the tiles that base already has (needs base). |
checkpoint | integer (≥ 0) | no | Save the target after every n finished tiles (0: off). |
threads | integer (≥ 0) | no | Builder threads, 1 to 256; 0 or absent: cores - 1, at least 1. |
connections | integer (≥ 0) | no | Connections to the data servers, 1 to 256; 0 or absent: one per server. |
sea_level | number or string | no | Sea level in metres instead of the server’s deep sea height. |
doors | string | no | Door state baked into the mesh: closed (default), open or enabled. |
seed | string | no | Island filter seed as "x,y,z" instead of the world’s seed position. |
no_links | boolean | no | No jump, climb or ladder links. |
no_island_filter | boolean | no | Do not flag polygons that the seed cannot reach. |
force | boolean | no | Overwrite existing target and record files. |
Result: the summary of dayzmake navmesh generate (built <n> tiles, ..., wrote <target>), after the warnings; no progress is reported. A run that was stopped or that lost tiles is an error result that starts with the same summary, then (when a continuation makes sense) has the navmesh_generate arguments that continue it (to continue with navmesh_generate: target=..., base=..., skip_existing=true, force=true, ...), and ends with failed: <reason>; the partial mesh is saved all the same. More than 256 threads or connections is an error. See navmesh.
navmesh_info
Summarise a .nm navmesh: the grid and the totals, with tiles one line per tile.
| Argument | Type | Required | Meaning |
|---|---|---|---|
source | string | yes | The .nm file. |
tiles | boolean | no | One line (or JSON object) per tile. |
json | boolean | no | Return JSON instead of text. |
Result: the text of dayzmake navmesh info (JSON with json).
Environment and files
Everything dayzmake reads from its environment, and the files and folders it looks for, in one place. No
command reads any other variable. The library crate dayzmake-core reads variables only to locate and run
binarize.exe; everything else is an option of the caller.
Environment variables
| Variable | Read by | Meaning |
|---|---|---|
HOME | api, build, binarize | Home directory. Used to look for Steam (see below) and as the fallback for the API cache. |
STEAM_ROOT | api, build --proton-binarize, binarize | The Steam directory, checked before every other location. It must contain steamapps. |
DAYZ_TOOLS | build --proton-binarize, binarize | The DayZ Tools directory (the one that contains Bin/Binarize/binarize.exe). Default: <steam>/steamapps/common/DayZ Tools. |
PROTON | build --proton-binarize, binarize | A Proton directory (the one that contains the proton script). Default: the first of Proton Hotfix, Proton - Experimental, Proton Experimental in steamapps/common, then the alphabetically last folder starting with Proton that has a proton script. |
BIOUTPUT | build, binarize | 1 shows the output of binarize.exe (and Proton) while models are binarized. Without it the output is only shown when a run fails. |
DAYZMAKE_CACHE | api, mcp | The folder of the script API cache. |
XDG_CACHE_HOME | api, mcp | Linux and macOS: cache folder is $XDG_CACHE_HOME/dayzmake/api when DAYZMAKE_CACHE is not set. |
LOCALAPPDATA | api, mcp | Windows: cache folder is %LOCALAPPDATA%\dayzmake\api when DAYZMAKE_CACHE is not set. |
TMPDIR (TEMP on Windows) | build, binarize | Where the temporary folder of a binarize run goes. The Proton sandbox of a binarize run is a folder dayzmake-binarize-<pid>-<n> below it; it is removed when the run ends. |
ProgramFiles(x86), ProgramFiles | api (Windows) | Searched for Steam\steamapps after the registry. |
NO_COLOR | all commands | Any value, even an empty one, switches the colours of warning and error messages off. |
CLICOLOR | all commands | 0 switches colours off. |
CLICOLOR_FORCE | all commands | A value other than 0 switches colours on even when the output is piped, and wins over NO_COLOR. |
NO_COLOR, CLICOLOR and CLICOLOR_FORCE are read by the colored library, not by dayzmake. Warnings and
errors are written to standard error, but whether they are coloured depends on standard output being a terminal
(unless CLICOLOR_FORCE is set): dayzmake rapify x.cpp > /dev/null in a terminal prints plain warnings, and
dayzmake rapify x.cpp 2>err.txt in a terminal writes escape codes into err.txt.
An empty STEAM_ROOT, DAYZ_TOOLS, PROTON, DAYZMAKE_CACHE, XDG_CACHE_HOME, LOCALAPPDATA, ProgramFiles(x86)
or ProgramFiles counts as unset. HOME is not checked: an empty HOME makes the Steam and cache locations
relative paths (.steam/steam, .cache/dayzmake/api), so set it properly. BIOUTPUT only counts when it is
exactly 1.
How the Steam installation is found
api collects candidate Steam folders in this order and keeps those that have a steamapps folder, without
duplicates: $STEAM_ROOT, then below $HOME: .steam/steam, .steam/root, .steam/debian-installation,
.local/share/Steam, the Flatpak folder .var/app/com.valvesoftware.Steam/.local/share/Steam, the Snap folder
snap/steam/common/.local/share/Steam and macOS’s Library/Application Support/Steam. On Windows the registry
value HKEY_CURRENT_USER\Software\Valve\Steam, SteamPath comes next, then %ProgramFiles(x86)%\Steam and
%ProgramFiles%\Steam.
Each candidate contributes its library folders too: steamapps/libraryfolders.vdf is read and every path in it
that is an existing absolute directory is searched for app manifests (appmanifest_<id>.acf). The first library
with a manifest whose install folder exists wins. These files are untrusted: they are read at most 1 MiB, with
invalid UTF-8 replaced, and an installdir must be a safe relative path.
| Branch | Client app | Server app |
|---|---|---|
| stable | 221100 | 223350 |
| experimental | 1024020 | 1042420 |
The game’s scripts are dta/scripts.pbo of the client install, or else of the server install, whichever has
the file; --dayz <dir> replaces the search. Workshop mods are
steamapps/workshop/content/<client app>/<workshop id>/. A mod folder has addons/*.pbo (the addons folder is
found ignoring case), keys, and optionally a meta.cpp whose name = "..."; is the mod’s name. The
@name folders in the game’s install (where the DayZ launcher links mods) are listed too.
binarize and build --proton-binarize search a shorter list for the Steam folder: $STEAM_ROOT, then
~/.steam/debian-installation, ~/.steam/steam and ~/.local/share/Steam; the first that has
steamapps/common is used. DayZ Tools is Steam app 830640.
Windows registry
| Key | Value | Used for |
|---|---|---|
HKEY_CURRENT_USER\Software\Valve\Steam | SteamPath | Finding Steam for the script API. |
HKEY_CURRENT_USER\Software\Bohemia Interactive\binarize | path | The folder of binarize_x64.exe, which is what build and binarize run on Windows. |
Files and folders dayzmake reads or writes
| Path | What |
|---|---|
$PBOPREFIX$, $PREFIX$ | In a source folder: the prefix and header extensions of the PBO (see Header extensions). unpack writes $PBOPREFIX$. |
$NOBIN$, $NOBIN-NOTEST$ | In a source folder: switch rapification and binarization off for build. |
<cache>/vanilla-<branch>.json | The index of the game scripts. <cache> is $DAYZMAKE_CACHE, else $XDG_CACHE_HOME/dayzmake/api, else $HOME/.cache/dayzmake/api (%LOCALAPPDATA%\dayzmake\api on Windows). The folder is created with mode 0700. |
<cache>/mod-<name>-<branch>-<hash>.json | The index of one mod. |
*.biprivatekey, *.bikey, *.bisign | Keys and signatures. Private keys are written with mode 0600. |
A cache file is rebuilt when the size or modification time of one of its PBOs changed or the format of the index
changed, and a corrupt file is replaced. A cache folder that cannot be found or written is a warning
(api-cache); the query still runs on the index that was built in memory. Cache files can
be deleted at any time; --refresh and api update rebuild them.
Network
dayzmake never uses the network.
Warnings
Every warning has a name, shown in square brackets at the end of its line. Mute a warning with -w <name> on
the commands that accept it (rapify, preprocess, binarize, build; the warnings of pack, unpack and api cannot be muted); in the MCP server warnings are returned
with the result of each tool call. At most ten warnings of the same name are shown per run; use -v to see them
all. A warning never changes the exit status: only errors do.
The messages below are real output (shortened paths are marked with …), except where a note says that the
format is quoted from the source because the situation needs files this manual cannot ship (DayZ Tools, a damaged
PBO of the game).
Each section lists the commands that can raise the warning, what triggers it and an example.
api-bad-config
Raised by: api, mcp.
A config.bin or config.cpp cannot be read. An #include in a config.cpp is only resolved from the entries of the same PBO (relative to the including entry, or as \prefix\path inside the prefix of the PBO): an absolute path, a drive letter, a .. that would leave the PBO’s root or a file that is not in the PBO makes the config unreadable (.. inside the PBO is resolved against the folder of the including entry), and the file system is never read. For a mod PBO its defines[] are not collected (the scripts of the PBO are still indexed); for api config the config is left out of the config index. A class with a name that cannot be a path segment (empty, with a / or a control character) is skipped with the same warning.
In file …/badmod/addons/entry.pbo: warning: cannot read config.bin: failed to fill whole buffer [api-bad-config]
api-bad-entry
Raised by: api, mcp.
An entry of a PBO that holds scripts cannot be read (for example a corrupt compressed entry). The entry is skipped.
warning: cannot read "<entry name>": <reason> [api-bad-entry] (the message format; no synthetic file in this manual triggers it)
api-bad-mod
Raised by: api, mcp.
A selected mod cannot be indexed, for example because its folder disappeared, or an indexing thread failed. The mod is skipped and the others are answered.
warning: skipping mod <name>: <reason> [api-bad-mod] (the message format)
api-bad-pbo
Raised by: api (also api grep), mcp.
A PBO of a mod is not readable as a PBO. It is skipped.
In file …/badmod/addons/junk.pbo: warning: skipping unreadable PBO: …/badmod/addons/junk.pbo: failed to fill whole buffer [api-bad-pbo]
api-cache
Raised by: api, mcp.
The cache folder cannot be found, created or written, or a cache file cannot be written. The query still runs on the freshly built index, only slower on the next run.
warning: cannot create the cache directory /proc/nope/x: No such file or directory (os error 2); the index is built without a cache [api-cache]
api-config-base-changed
Raised by: api config, mcp.
A class is defined again with another base class, or with none. The engine takes the base of the last definition, so a mod that writes class X { ... } without : Base cuts X off from its base. The lookup shows the change as well. Only a change made by a mod (a -m source) is warned about, whenever its PBO is merged over what loaded before it; the game changes some bases on purpose, and the lookup shows those changes without a warning.
In file …/mod/addons/rebase.pbo: warning: class CfgVehicles/Hatch changes its base class: Base -> (none) [api-config-base-changed]
api-config-include-unreadable
Raised by: api config, mcp.
A text config.cpp is indexed, and a text entry of the same PBO that it could include (.hpp, .h, .inc, .txt, .cfg and so on) is truncated or cannot be decompressed. The entry is skipped and the configs of the PBO still load. A config that includes the entry fails with the same reason (api-bad-config), not with “not found”. PBOs with only a config.bin read no such entries.
In file …/mod/addons/entry.pbo: warning: cannot read the includable zz_readme.txt: PBO entry "zz_readme.txt" is truncated (its data ends past the end of the file).; it is skipped [api-config-include-unreadable]
api-config-includes-capped
Raised by: api config, mcp.
The includable text entries of one PBO add up to more than 64 MiB. The entries past that total are not read, once per PBO; a config that includes one of them fails with api-bad-config.
In file …/mod/addons/huge.pbo: warning: the includable files of this PBO are more than 67108864 bytes; the rest is skipped [api-config-includes-capped] (the message format; no synthetic file in this manual triggers it)
api-config-limit
Raised by: api config, mcp.
The config of one source (the game or a mod) has more than 2 million classes or 10 million properties, or the merge of the selected sources does. The rest is skipped; the classes read so far can still be looked up.
In file …/mod/addons/huge.pbo: warning: the config of mod is too large (more than 2000000 classes or 10000000 properties); the rest is skipped [api-config-limit] (the message format; no synthetic file in this manual triggers it)
api-config-order
Raised by: api config, mcp.
The requiredAddons of the CfgPatches of some PBOs depend on each other in a cycle (the PBOs can belong to different sources), so no order satisfies them. The PBOs of the cycle, and the PBOs that depend on them, load after the others, in the global tie-break order: the source (the game first, then the mods in -m order), then the path. Only the PBOs that really are in the cycle are named and counted, each as [<source>] <pbo>. The warning is raised on every query, not only when the index is built, because the merge runs for every query; the same holds for api-config-base-changed of a change across PBOs.
warning: requiredAddons form a cycle between 2 configs ([vanilla] Addons/c1.pbo, [vanilla] Addons/c2.pbo); they and the configs that depend on them load last, in source and path order [api-config-order]
api-unsafe-entry
Raised by: api, mcp.
A script entry of a PBO has a name that could not be a path (.. components, a drive letter, control characters). It is skipped; no file system path is ever built from PBO content.
In file …/badmod/addons/entry.pbo: warning: skipping unsafe entry name "..\x\a.c" [api-unsafe-entry]
api-unsafe-prefix
Raised by: api, mcp.
The prefix in the header of a mod PBO is unsafe. The whole PBO is skipped.
In file …/badmod/addons/unsafe.pbo: warning: skipping PBO with unsafe prefix "..\evil" [api-unsafe-prefix]
binarize-missing-texture
Raised by: build --proton-binarize, binarize, and the MCP tools pbo_build and binarize.
binarize.exe printed a line that says it cannot find a texture or material (cannot, not found). Typical for references outside the addon: binarize.exe resolves paths relative to the addon only, so vanilla dz\... textures stay unresolved. The model is still binarized; only the alpha flags depend on reading the texture.
warning: <model>: <the line binarize.exe printed> [binarize-missing-texture] (needs DayZ Tools; not reproducible without it)
derapify-failed
Raised by: extract --derapify, and the MCP tool extract.
A *.bin starts with the rapified signature but cannot be read as a config. It is written as it is, with its .bin name.
warning: Keeping "config.bin" as it is: failed to fill whole buffer [derapify-failed]
duplicate-entry
Raised by: build, pack, unpack, extract.
Two files map to the same PBO entry name ignoring case (A.txt and a.txt), or, when unpacking, a PBO has two entries with the same path. The first in sorted order is used and the other skipped. An entry generated from source (the rapified config.bin) wins over a plain file of the same name.
warning: Skipping "data/a.txt": an entry named "data\A.txt" was already packed. [duplicate-entry]
duplicate-path
Raised by: extract.
Two PBOs of the source write the same path ignoring case. The PBO that comes later in sorted order wins; the warning names both.
warning: "a/x.txt" is in Addons/c.pbo and in dta/a.pbo; keeping the one of dta/a.pbo. [duplicate-path]
empty-value
Raised by: rapify, build, config_rapify.
A config entry has no value (z = ;, or a macro that expanded to nothing). It is stored as an empty string.
In file warn.cpp:1: warning: Entry "z" has no value; it is stored as an empty string. [empty-value]
extract-path-clash
Raised by: extract, and the MCP tool extract.
An entry would be a file where an earlier entry of the same extract has a folder, or a folder where it has a file (p/a in one PBO, p/a/b in another). The first one in the sorted PBO order is written; the later entry is skipped and is not part of the tree. The warning says which case it is and names both PBOs and the path (always with /). The other case reads Skipping "p/a" from <pbo>: it is a file, but <other pbo> has a folder there; <pbo> is the skipped one and <other pbo> the one whose entry was written (the owner).
warning: Skipping "p/x/y.txt" from addons/b.pbo: it needs "p/x" as a folder, but addons/a.pbo has a file there. [extract-path-clash]
include-case
Raised by: rapify, preprocess, build.
An #include only matched a file when case is ignored. It works on Linux because dayzmake falls back to a case-insensitive match, but DayZ itself runs on Windows file names; fix the case so the build is the same everywhere.
warning: Include "Inc/Common.HPP" only matched ".../w/inc/common.hpp" ignoring case. [include-case]
leading-separator
Raised by: unpack, extract.
A PBO entry name starts with \ or /. It is extracted without it.
warning: Entry "\scripts\hello.c" starts with a path separator; extracting it as "scripts/hello.c". [leading-separator]
macro-arg-count
Raised by: rapify, preprocess, build.
A macro is called with a different number of arguments than it declares.
In file mac.cpp:2: warning: Macro "M" expects 2 argument(s), got 1 [macro-arg-count]
missing-material
Raised by: build, pbo_build.
An editable model references a material (.rvmat) that starts with the addon’s prefix but is not in the addon. The rules for other prefixes are those of missing-texture.
In file small.p3d: warning: Model references material "t21\data\m.rvmat", which is not in the addon. [missing-material]
missing-texture
Raised by: build, pbo_build.
An editable model references a texture that starts with the addon’s prefix but is not in the addon. References to other prefixes are only checked if the file exists below an -i folder or the current directory; if not, nothing is reported, because there is no way to tell whether they are wrong. Procedural textures (#(argb,...)) are skipped.
In file small.p3d: warning: Model references texture "t21\data\gone_co.paa", which is not in the addon. [missing-texture]
model-unreadable
Raised by: build, pbo_build.
A .p3d is neither a readable MLOD nor a known binarized model, so its textures and materials cannot be checked.
In file data/broken.p3d: warning: Cannot check textures and materials: not an MLOD model [model-unreadable]
navmesh-seed
Raised by: navmesh generate, navmesh_generate.
The island filter found no polygon near the seed position (a box that reaches 30 m in x, 30 m in height and 3 m in z to each side of it), so it was skipped and no polygon is flagged as an island. The seed is the world’s seedPosition or the one given with --seed; it has to be on land, near walkable ground.
warning: island filter skipped: no polygon near the seed (-5000.0 10.0 -5000.0) [navmesh-seed]
navmesh-stray-part
Raised by: navmesh generate, navmesh_generate.
A built tile had polygons whose door part id was beyond the list of parts of the tile. This happens for trees below sea level on a tile that also has doors. The ids were ignored (the polygons get no door part); the mesh is complete. One warning per tile.
warning: tile (12,40): 3 polygons had out-of-range door part ids, which were ignored [navmesh-stray-part]
navmesh-tile-failed
Raised by: navmesh generate, navmesh_generate.
A tile could not be built or added to the mesh, or its data from the server was malformed. The run goes on without that tile, saves the mesh and exits with status 1; the tile is listed in the report. One warning per tile.
warning: tile (1,0): unknown cell class 99 [navmesh-tile-failed]
non-utf8-filename
Raised by: unpack, extract.
A PBO entry name is not valid UTF-8. It is extracted as Windows-1252.
warning: Entry name "café.txt" is not valid UTF-8; extracting it as windows-1252. [non-utf8-filename]
non-windows-binarization
Raised by: build and the MCP tool pbo_build.
On Linux and macOS, build without --proton-binarize copies each .p3d and .rtm as it is.
In file small.p3d: warning: On non-Windows systems binarize.exe is only used with --proton-binarize; file will be copied as-is. [non-windows-binarization]
prebinarized-file
Raised by: build, binarize, pbo_build.
A model or animation is already binarized (ODOL, BMTR). It is copied unchanged and binarize.exe is not run. The message names the format and version.
In file data/odol.p3d: warning: File is already binarized (ODOL v58); copying it as-is. [prebinarized-file]
old-tree-left
Raised by: extract.
The new tree is in place, but the old target folder that was moved away could not be removed. Delete the folder the warning names.
warning: Could not remove the old tree ".out.extract-4242-0.old": Permission denied (os error 13) [old-tree-left]
prefix-slash
Raised by: build, pack.
The prefix in $PBOPREFIX$ or -e prefix=... has leading or trailing slashes. They are removed.
warning: Removed leading/trailing slashes from prefix "/leading/". [prefix-slash]
prerapified-file
Raised by: rapify, build.
A config that should be rapified already is. It is copied unchanged.
In file data/pre.cpp: warning: File is already rapified; copying it as-is. [prerapified-file]
unquoted-string
Raised by: rapify, build.
A value or array element is not in quotes (name = hello;). It is stored as a string. Macro arguments that are not evaluated show up here too.
In file warn.cpp:1: warning: String value "hello" is not quoted properly. [unquoted-string]
unsafe-header
Raised by: unpack.
A header extension of a PBO contains control characters (line breaks). They are replaced with spaces in the $PBOPREFIX$ that unpack writes.
warning: Header extension "note" contains control characters; replaced them with spaces. [unsafe-header]
unsafe-path
Raised by: build, pack, unpack, extract.
A file name is not usable as a PBO entry name (not UTF-8, control characters, :, a Windows device name such as CON or NUL, ..), or, when unpacking, an entry would leave the target folder or go through a symbolic link. The file or entry is skipped. extract also skips a whole PBO whose prefix is not a safe folder name or is pbo-map.tsv.
warning: Skipping "data/bad:name.txt": unsafe entry name. [unsafe-path]
unsupported-file
Raised by: build, pack.
A file in the source folder is a FIFO, a device or a socket. It is skipped; dayzmake never opens it, so it cannot hang on it.
In file data/pipe: warning: Skipping a file that is not a regular file (FIFO, device or socket). [unsupported-file]
unterminated-comment
Raised by: rapify, preprocess, build, api config, mcp.
A /* comment is never closed. Like CfgConvert, which says nothing about it, dayzmake takes the rest of the file as the comment, so every line after it is ignored, also an #include (which is then not even looked up). In an included file the comment ends with that file. The warning names the file and the line of the /*; it is not raised for /* inside a string. It also covers a comment that opens after a directive (#endif /* c, #define X 1 /* c), and one in a disabled #ifdef branch.
In file open.cpp:2: warning: A /* comment is never closed; the rest of the file is ignored. [unterminated-comment]
Header extensions and prefixes
A PBO starts with a header that holds header extensions: key=value pairs. The most important one is prefix,
the virtual path of the PBO’s contents. A PBO with the prefix mymod\scripts makes its file config.bin known
to the game as mymod\scripts\config.bin; textures, models and includes refer to files by these paths. Other
extensions carry information such as the product the PBO was made for.
Where extensions come from
build and pack collect them in this order; a later source wins:
- The file
$PBOPREFIX$(or$PREFIX$) in the source folder. Each line is one setting; reading stops at the first empty line. A line without=is the prefix. A linekey=valuesets that extension, andprefix=valuesets the prefix. A repeated key keeps its first position and takes the last value. The file itself is not packed as an entry. -e key=valueon the command line, repeatable. An entry without=is an error:Invalid header extension "x" (expected key=value).- If no prefix was given, the name of the source folder.
dayzmake does not add any extension on its own (no default product or version). The header always lists the prefix first, then the other extensions in this order: those of $PBOPREFIX$ in file order, then new ones of -e; an -e for a key that already
exists replaces its value in place.
The prefix
- Slashes are normalised to
\and a leading or trailing separator is removed with theprefix-slashwarning. - With no
$PBOPREFIX$the prefix is the name of the source folder:dayzmake build mymodgivesmymod. Models are checked against this prefix: a texturemymod\data\a_co.paais expected in the PBO, a texture of another prefix is not. - A model that
binarize.exeprocesses sees the addon below its prefix (P:\<prefix>), so textures resolve as in the game. unpackwrites the prefix and all other extensions to$PBOPREFIX$in the extracted folder, andunpack --use-prefixputs the files below<target>/<prefix>/.
Example
A folder m2 with this $PBOPREFIX$:
m2
product=dayz
gives these extensions, which -e can add to or override:
$ dayzmake build m2 m2.pbo
$ dayzmake inspect m2.pbo | head -4
Header extensions:
- prefix=m2
- product=dayz
$ dayzmake build -e author=bzed -e product=dz m2 -f m2.pbo
$ dayzmake inspect m2.pbo | head -5
Header extensions:
- prefix=m2
- product=dz
- author=bzed
Exclude patterns
Patterns of -x are not header extensions but decide which files enter the PBO. A pattern is a string with
* as the only wildcard, compared with the whole path inside the PBO (with \ as the separator), case-sensitively:
| Pattern | Leaves out |
|---|---|
*.psd | every file ending in .psd, anywhere |
data\*.png | every .png below data |
source\* | everything below source |
*\Thumbs.db | Thumbs.db in any subfolder (a pattern without * in front only matches the root) |
There are no default patterns: every file is packed unless excluded, including hidden files and, for build,
the marker files $NOBIN$ and $NOBIN-NOTEST$. Excluded files are skipped without a warning.
Prefix and header values in untrusted PBOs
Values in a PBO header are untrusted. dayzmake never builds a path from them without checking: an unsafe
prefix is an error for unpack --use-prefix and a warning (api-unsafe-prefix) for the script API; control
characters in a value are replaced by spaces when $PBOPREFIX$ is written (unsafe-header).
dayzmake-core library
The file-format code lives in the dayzmake-core crate
(crates/dayzmake-core): PBO, configs, P3D, PAA, BI keys and signatures and navigation meshes (.nm, with their
generator), with no CLI dependencies. It never prints; warnings go to a WarningSink you provide, so it is safe to use
from many threads.
cargo add dayzmake-core
Features: sign (BI keys and signatures), image (PAA from and to images) and navmesh (the navmesh generator:
the data-server client, the tile builder and the .nm reader and writer), all on by
default; default-features = false builds without them. The
API documentation has a complete example (key, PAA, pack, sign, verify).
The licence is GPL-2.0-or-later, so GPLv3 and AGPLv3 projects may link it. dayzmake-core is versioned
independently of the CLI.
Third-party code
The navmesh module of dayzmake-core contains Rust ports of
Recast and Detour by Mikko Mononen (zlib licence), altered
for DayZ. The files keep the original copyright line and the zlib notice, and say that they were ported to Rust and
altered and are not the original software. The zlib licence is compatible with GPL-2.0-or-later.
The API documentation of the version on main is published with this site: dayzmake_core.
Released versions are on docs.rs.
Testing
Unit tests:
cargo test
The end-to-end DayZ test harness builds a small test mod, binarizes it, packs
it into a PBO, signs it, and boots a local DayZ server (Steam app 223350, plus
app 1042420 with --both) to prove the mod loads and runs:
testharness/run.sh --both
See testharness/README.md for details.
Changes
3.2.0
With dayzmake-core 0.3.1.
- New command group
navmeshfor navigation meshes of terrain mods:navmesh probeshows the world parameters (and one tile) of the navmesh data server ofDayZDiag_x64.exe,navmesh generatebuilds the.nmfile from that server or from a capture (--capture,--record;--range,--base/--skip-existingand--checkpointto resume;--threads,--connections, several--server;--doors,--sea-level,--no-links,--no-island-filter,--seed), andnavmesh infosummarises a.nmfile (--tiles,--json). The output is the same for any number of threads. New warningsnavmesh-tile-failed,navmesh-stray-partandnavmesh-seed. See the guide Navigation meshes for a terrain mod.dayzmake-coregets the modulenavmesh(featurenavmesh, on by default). The MCP server gets the toolsnavmesh_probe,navmesh_generateandnavmesh_info.--threadsand--connectionstake at most 256 and refuse negative numbers (0 is the default). A tile that needs more than 2^26 heightfield spans fails instead of exhausting memory,--basemust match the world’s grid and tile size,navmesh infoshows the file version read (7 or 9), and the MCPsea_leveltakes a number or a string. navmesh generate --capturedoes not load the whole capture: it indexes the file and reads only the tiles of the range (memory in proportion to the range, not to the file; a 3 x 3 range of a 50 GB capture ran in 6 s and 300 MB).dayzmake-coregetscapture::CaptureFileandSource::CaptureFile; the capture format is unchanged.navmesh generate: a data-server connection that is refused or reset is retried five times with 10 seconds of waiting (1, 2, 3 and 4 s between the tries), and when it still fails its tile goes back to the queue for the other connections instead of failing; a tile that fails on two working connections, or gets a wrong answer, is reported as not fetched without taking the connections down.--recordmay not name the--capturefile. Only the tiles of--rangeare indexed from a capture (library:CaptureFileOptions; a run for a range wider than the indexed one is refused).
3.1.0
With dayzmake-core 0.3.0.
- Parsing a config nested to the depth limit (128 levels) fits a 1 MiB stack again on Windows debug builds: the recursive grammar rules for classes and arrays have smaller frames (a debug build needs about 410 KiB for the deepest class nesting, it needed 920 KiB). The behaviour and the limits are unchanged (#108).
api config: the warningapi-config-limitof a merge is raised once and names the PBO where the merge stopped;api-config-ordernames only the PBOs of the cycle, each as[<source>] <pbo>, and, likeapi-config-base-changedacross PBOs, is raised on every query.api configreads the includable text entries of a PBO only when it has a textconfig.cpp, skips a truncated or undecodable one with the new warningapi-config-include-unreadable(the configs of the PBO still load, and an include of it names the read error), reads at most 64 MiB of them per PBO (new warningapi-config-includes-capped), and resolves..inside the PBO:#include "..\macros.hpp"fromsub\config.cppfindsmacros.hpp; a path that leaves the PBO’s root is still refused (#99).PBO::insert_entryover an entry whose stored name is not UTF-8 (windows-1252) stores the raw bytes of the new name; it kept the old entry’s bytes (part of #98).api configsorts the config PBOs of the game and of all selected mods together byrequiredAddons, as the engine does (a game addon that requires a mod addon loads after it); ties go to the source (game, then the mods in-morder) and then to the path.-m allincludes mods that have only a config. Theapi-config-base-changedwarning shows the class path as written (CfgVehicles/Car_Base), the game is recognised by a flag and no longer by the namevanilla, and an infinite float is shown as1e999/-1e999as derapify writes it (a string in--json) (part of #98).extractrefuses a new target folder inside the source also without-f, before it creates anything (it used to write into the mod folder, and the-fre-run was then refused). A file/folder clash across PBOs (p/ain one,p/a/bin another) no longer fails the extract: the first entry in the sorted PBO order is written, the later one is skipped with the new warningextract-path-clash(part of #98).- The
extract-path-clashwarning names the skipped entry, says whether it is a file or a folder and what the other PBO has at that path, with/separators on every platform; an extract source that cannot be resolved is an error of its own (part of #104). api grepprints at most the first 512 bytes of a matching line (counted before escaping), cut at a character boundary and followed by[…];--jsoncutstextthe same way and adds"truncated": trueto cut hits. The MCPapi_sourcerefusestargettogether withcontextorlinesinstead of ignoring it, and alsotargetwithoutcat(errortarget is only used with cat; it did nothing there) (part of #98, #104).inspectof an ODOL v56 model leaves out theClass:andDamage:lines when they are empty and a section (Textures, Materials, Proxies, Properties, Selections, Animations) that has no items; an empty material name was already printed as(none)(#96).- A config value entry (not an array or a class) may end at the line end instead of
;, as in CfgConvert; it keeps its value type, as in CfgConvert:x = 1.5is a float, no longer the string"1.5", andx = 1e999is an infinity (see below). At the very end of a file without a line end such an entry is a syntax error, as in CfgConvert (#95). An integer literal that overflows at a line end is handled as before a;(see the next bullets). - The preprocessor strips a
//comment at the very end of the input, with no line end after it, as CfgConvert does; before,x = 1;followed by// cwithout a final newline was a syntax error. An unterminated/*runs to the end of the file, also as in CfgConvert (silently there), and raises the new warningunterminated-commentwith file and line; an included file’s comment ends with that file. When the last line of a config is picked out to decide whether its entry may end at the end of the file, a lone CR now counts as a line break; CfgConvert rejectsx = 1\r#define Y 1andx = 1\r// c, dayzmake accepts them (#103). - A config float literal that overflows f32 (
1e999,-1e39) is rapified as an infinity, no longer an error, as CfgConvert does; a literal that underflows is 0.derapifywrites an infinity as1e999/-1e999, so derapify then rapify keeps the bits (#102). - A decimal integer literal that does not fit 64 bits (
99999999999999999999) is a float, as in CfgConvert (x = 1e20), at a line end and before a;; in an array every decimal literal that does not fit 32 bits is a float ({3000000000}is3000000000.0). It was an error. A decimal literal that fits 64 bits but not 32 is a 64-bit integer entry (x = 2147483648, entry subtype 6), as CfgConvert writes it;derapifyandapi configread it (they rejected subtype 6,Unrecognized variable entry subtype: 6). Followed by text it stays an unquoted string. Two other inputs were checked against CfgConvert and need no change:x = 1 // candx = 2 \+ a comment line, both without a final newline, are syntax errors in both; an included file whose last line has no line end is accepted by both (CfgConvert glues its own#linemarker to the value, dayzmake does not) (part of #104). - Config enum values are computed like CfgConvert, in
f32(#107): a literal is rounded tof32and a value outsidei32is-2147483648(A = 2147483647,2147483648,99999999999999999999and-2147483649all give it), hex keeps its low 32 bits at any length (0x1FFFFFFFFFis-1) and0Xworks, and an implicit value is the last explicit value plus its distance, added inf32(A = 16777217, Bgives16777216twice;A = 16777216, B, Cgives16777216,16777216,16777218). Such values were an error.__EVALof large numbers keeps its exact floats; CfgConvert’s imprecise low bits (__EVAL(2^31)is0x4effffe4there) are not copied. - A hex config literal does what CfgConvert does: without a sign it keeps its low 32 bits at any length (
0x1FFFFFFFFFis-1,0x100000000is0; it was an error),0Xworks like0x, and with a sign it is a float (-0x10is-16.0, it was the integer-16) (#106). - A config syntax error no longer brings the
unquoted-stringwarning that the failed parse raised on the error’s own line (x = 1 // cwas tried as an unquoted string first); warnings from earlier lines are kept (part of #104). - Config errors raised while parsing a value (a failing
__EVAL/__EXEC, nesting too deep) carry theIn line <file>:<line>:context of a parse error (#94). api config <path>looks up a config class such asCfgVehicles/Hatchback_02: its inheritance chain, its own and inherited properties each tagged with the class they come from, the classes inside it, its subclasses and the PBOs that define it. It indexes everyconfig.binandconfig.cppof thedtaandaddonsPBOs of the game (also the ones in folders of a PBO) and of the-mmods, loads the PBOs of all sources byCfgPatchesrequiredAddons(ties: vanilla, the mods in order, sorted path), and merges like the engine: a class defined again extends the earlier one, properties overwrite, the base class becomes what the last definition names (none included; the lookup printsBase changed: A -> (none) by [<source>] <pbo>and a mod’s change raisesapi-config-base-changed),deleteremoves,+=appends,class X;creates nothing.--maxcuts the output,--jsonprints an object,--refreshrebuilds the cached index of each source. An inheritance cycle is an error. An#includein a modconfig.cppis resolved from the entries of the same PBO only, never from the file system (#97). The MCP tool isapi_config; new warningsapi-config-order,api-config-base-changedandapi-config-limit(#89).extract [-f] [--derapify] [--only <pattern>]... [-x <pattern>]... <source> <targetfolder>unpacks every PBO in thedtaandaddonsfolders of a DayZ install or mod, or a single PBO, into<targetfolder>/<prefix>/, optionally derapifying the rapified.binfiles to.cpp, and writespbo-map.tsv(prefix with/separators, TAB, PBO path;\, TAB, CR and LF are escaped as\\,\t,\r,\n). The tree is written to a staging folder and swapped in, so a re-run drops stale files and a failure keeps the old tree;-fonly replaces an empty folder or an earlier result (one with apbo-map.tsv) and never one that contains or lies inside the source. Entries are streamed, not read whole, and an I/O or decompression error fails the extract. The MCP tool isextract(#87).api grep <regex>searches the lines of every.cfile of vanilla and of the selected mods, straight from the PBOs, and prints[<source>] <prefix>\<path>:<line>: <text>sorted by source, path and line.--ignore-casematches case-insensitively,--maxcuts the output and bounds the memory used (all further matches are still counted for the... N more linesnote) and--jsonprints an array of{source, path, line, text}. The MCP tool isapi_grep(#88).api src --context <n>prints n lines around each declaration and--lines <a-b>lines a to b of each file, as<line>| <text>(with--json:"lines"); the options exclude each other and--cat. The MCP toolapi_sourcetakescontextandlines(#90).unpacktakes-x <pattern>(leave entries out) and--only <pattern>(write only matching entries);-xwins. The MCP toolpbo_unpackhas the argumentsexcludeandonly.UnpackOptionsgainsexcludeandonly, anddayzmake_core::pbo::EntryFilteris the shared filter (#86).inspect --json <file.pbo>prints the PBO header as one JSON object: the header extensions, the prefix and the entries, each name next to the lowercase hex of its raw bytes, so a prefix with a control character or a byte that is not UTF-8 is unambiguous. The MCP toolpbo_inspecttakes the argumentjson. A model gives an error (#91).- Writing and signing a PBO keep the stored bytes of header extensions and entry names that a UTF-8 and a windows-1252 spelling would otherwise swap (#92).
- Config values in exponent notation (
1e-5,1.5E+3,3.162277e-5) are rapified as floats (#85), not as strings with anunquoted-stringwarning, so derapify then rapify keeps a float a float. Values such as1e5xor1estay strings. A float that does not fit an f32 (1e999,-1e39) becomes an f32 infinity, as in CfgConvert (#102); followed by text (1e999x) it stays an unquoted string, like an integer that does not fit (99999999999x, #93), and a float entry may end at a closing brace without a semicolon. inspectandpbo_inspectlist ODOL v56 models (#84): skeleton, bounding box, LODs with vertex and face counts, textures, materials, proxies, properties, selections and animations. Other ODOL versions still show the format and version, with a note that only v56 is decoded. A model whose LOD ranges overlap is refused.- PAA reads ARGB4444, ARGB1555 and AI88 (#83):
paa2imgandpaa_to_imagedecode the 19 such textures the game ships (LZSS mipmaps with a checksum); a wrong checksum or a cut-short stream is an error. A PNG file named.paais reported as a PNG file. - Config enum blocks (#82):
rapifyacceptsenum { A, B = 5, C };at any class level (values count up from the last explicit one, as in C) and writes the names, lowercase, into the enum table of theconfig.bin;derapifyprints the table as anenum { name = value, ... };block at the top. A table that is missing or damaged gives no block and no error.
3.0.2
With dayzmake-core 0.2.2.
- PAA fixes in dayzmake-core:
Paaremembers per mipmap whether it is LZO-compressed, soPaa::writeno longer flags a short raw mipmap as compressed (#76) andPaa::to_dynamic_imagedecodes aPaabuilt byPaa::from_dynamic_imageorPaa::lzo_compresswithout a write/read round trip (#78).Paa::readdrops theGGATSFFOoffset tagg, so a re-written PAA has it once (#75);Paa::tagg("GGATSFFO")now returnsNoneafterread. Paa::writeandimg2paareject a mipmap of 16 MiB or more (its length field has 3 bytes), for example RGBA 2048×2048 and larger or a DXT5 4096×4096 texture that LZO cannot shrink, instead of writing a wrong length, andPaa::readkeeps an LZO-compressed mipmap compressed, so a read and re-written PAA stays readable (#79).dayzmake cataccepts-fto overwrite its target; the “Use –force” error was already printed for it (#71).img2paa -cand the MCP toolimage_to_paa(compress) LZO-compress DXT mipmaps wider than 128 pixels (#70). dayzmake already did that for every conversion, so the output does not change. New in dayzmake-core:Paa::lzo_compress.derapify -dand the MCP toolconfig_derapify(indent) set the indentation: spaces and tabs only, empty allowed (#69). New in dayzmake-core:config::WriteOptionsandConfig::write_with.
3.0.1
- Releases carry
SHA256SUMSandSHA512SUMSof all archives with GPG signatures, and the public key (dayzmake-release-key.asc); see Verifying downloads. - The documentation is published as a web site with guides and a reference of every command, option, MCP tool and warning: https://bzed.github.io/dayzmake/.
packno longer warns that models were not binarized; onlybuilddoes (#72, fixed in dayzmake-core 0.2.1).
3.0.0
The changes since 2.0.0. Breaking: a missing #include no longer searches the working directory (it is only
checked directly; pass -i for folders to search), stricter key and PBO checks (see below), and new errors on
hostile config input. dayzmake 3.0.0 needs dayzmake-core 0.2.0.
- Backslash line continuations count as source lines: in a
#defineand in disabled lines they used to be lost, and a macro use no longer shifts the line numbers after it, so warnings and errors point at the right line (#65). - Behaviour change: a missing absolute include no longer walks the whole working directory (#66): the implicit working directory is
only checked directly (
./DZ/data/x.hpp), so a file buried below it is no longer found without-i. Folders given with-iare still searched recursively, but the search does not follow directory symlinks that leave the folder, and enters no directory twice, and it fails with an error naming the include after 1,000,000 visited entries (the author’sP:drive copy has 109,000). - Line numbers in warnings and errors stay right after a disabled
#ifdef/#ifndefbranch (plain lines,#define,#undef,#include, nested branches); they used to drift up by one per disabled line (#63). - Macro expansion also charges its work: every call of a defined macro costs, so an exponential chain whose
expansion is empty (
#define E(x)withE(A)E(A)levels) fails like the others; at most 100,000 macro calls per line, real configs need at most 34 (#59). - Macro work is capped per file too: at most 100,000 macro calls over a file and its includes (a 3000-line file of
A13lines, each about 16,000 calls with an empty expansion, took 37 s); real configs under the author’s trees need at most 174 (#64). - At most 10,000
#includes are processed perpreprocesscall (nested ones and repeated inclusions count), so an exponential include fan-out fails at once; real configs under the author’s trees use at most 1 (#60). - Lines in a disabled
#ifdef/#ifndefbranch are skipped before any macro expansion, so they cannot raise macro errors or cost time (#61). - All Windows device names are recognised in PBO entry names and output targets:
COM0-COM9andLPT0-LPT9also with the superscript digits (COM¹),CONIN$andCONOUT$, in any case, with or without an extension (#62). packandbuildrecognise their own output by file identity (device and inode, or volume and file index), soM\OUT.PBOover an existingm\out.pboon a case-insensitive file system is never packed into itself (#37).- An existing regular file with a device-like name (
NUL,COM1, reached through a verbatim path) is not overwritten in place and needs--forcelike any file (#40); a new target with such a name can still be created (#45). unpackwarns about a leading separator only for entries it extracts, andbuild’s duplicate-entry warning names the stored entry (config.bin,m.p3d) it kept (#41).- A closed stderr no longer panics: usage and other errors still end with their normal exit status (1, or 0 with only warnings) instead of 101 (#43).
- Macro expansion is capped: a source line that makes expansion copy more than 500,000 tokens, or a file (with its includes) more than 16,000,000, is an error naming the macro, so an exponential definition chain (billion laughs) fails at once instead of exhausting memory (#57). The counters measure copying work, re-counted at each expansion level, not the size of the output. The most that the author’s DayZ trees (1596 configs) need is 888 tokens per line and 749,577 per file.
- The same cap also counts bytes (64 MiB per line, 512 MiB per file), so that
#xstringification, which collapses a large expansion into one token, cannot bypass it (#58). Real configs need at most 12 KB per line and 7.3 MB per file. - Nesting deeper than 128 levels (macro argument parentheses, config classes, config arrays,
__EVALparentheses and operator chains) is a parse error, not a stack overflow (#54). Parentheses inside macro arguments count even in strings, as the preprocessor reads them. - An include cycle (
#includeof a file already being included) or include nesting deeper than 32 is an error naming the chain, not a stack overflow (#53). - A closed stdout pipe (
dayzmake inspect x.pbo | head -3) ends the command quietly with exit status 0 and no error line (it used to printBroken pipeand exit 1, or panic inapi). A closed pipe on stderr, a target file or an external tool is still an error (#39). - OpenSSL is gone from the dependency tree, tests included (they use
num-bigintas the independent check): building and testing need no system libraries, and the CI and the Dockerfile no longer installlibssl-devorpkg-config.dayzmake keygengenerates the RSA key pair with the pure-Rustrsacrate and the operating system’s random number generator, and signing and verification run onrsatoo (blinded, constant-time private-key operation; the result is checked against the public key before it is written). Key files and.bisignoutput are byte-identical to before. A signature value that is not smaller than the key’s modulus is a verification error. Our copies of key components read from a key file are wiped from memory when dropped (best effort: thersacrate makes internal copies it does not wipe). - Two misleading errors are fixed: a
.bisignwith a bad header says “Invalid signature file” (not “public key”), and verifying with a key other than the one that made the signature says “The signature was made with a different key” (names and lengths only) instead of a complaint about the modulus (#56). signand key generation refuse keys below 384 bits, theCryptoAPIminimum BI’s tools and the game need (smaller keys could only sign with broken padding). Reading such keys and verifying their signatures still works (#55).- A
.bisignfile is read with the same checks as a public key: its embedded key must carry theRSA1blob header and a modulus exactly as wide as the header length says; anything else is a read error (#52). - Macro expansion has a depth limit on every path (64 levels); a config that nests deeper, or expands a macro into itself through its arguments, is an error naming the macro instead of a stack overflow (#51).
- Key files must carry the CryptoAPI blob header (type, key algorithm,
RSA1/RSA2magic) thatdayzmakeand BI’s tools write; any other header is a read error (#50). - Keys and
.bisignfiles are limited to 16384 bits (288 at the low end); a larger header length is a read error (#49). - A key file whose modulus is not exactly as wide as its header length says, and a private key whose length is not a multiple of 16, is rejected when read (#48).
verifyandsignrecompute the SHA-1 of the PBO instead of trusting its stored trailer: a PBO whose bytes changed (config.bin, files a signature version leaves out, the header) no longer verifies, and a PBO with a wrong trailer is not signed. Both fail with a “checksum mismatch” error (#46); repack the PBO (dayzmake pack/build) before signing. BI’sDSCheckSignaturestrusts the stored trailer,dayzmake verifydoes not.inspectandunpackstill read such files.dayzmake caton an entry that is not in the PBO now exits 1 with an error (it used to exit 0 and printnot found).x = ;(or a value macro that expands to nothing) now raises theempty-valuewarning; the value is still stored as""(#19).build .(and a symlinked addon folder) without$PBOPREFIX$uses the folder’s name as the prefix instead of failing with “Invalid addon directory” (#11).- Preprocessor parse errors report 1-based line numbers (#12).
- Unpacking a PBO skips entry names with any control character (C1 included),
..or drive-letter components or an empty component (unsafe-pathwarning); a leading separator is stripped instead (\scripts\x.cis written asscripts/x.c,leading-separatorwarning). Modifying a PBO rejects such names. The API index (api) is more lenient: an entry with a leading or trailing separator is indexed under its normalised name instead of being skipped (#13, #21). - Rewriting a read PBO keeps the packing method of entries it does not know (#14).
- Names, paths and values from untrusted files are shown with control characters escaped in errors, warnings and
inspectlistings.derapifyrefuses a class or entry name that cannot be written as config text (#15, #22, #26, #28). - Writing a P3D rejects an inconsistent model (bad selection size, vertex index out of range, a face without 3 or 4 vertices, a NUL in a name) before the first byte is written; the error names the LOD index (#16).
- A string with an embedded NUL fails rapifying with an error naming the config entry, instead of writing a corrupt file (#23).
- Proton binarizing rejects a
$PBOPREFIX$that would leave its sandbox (#17). - Output files (
build,pack,rapify,binarize,keygen, …) are replaced atomically: a failed command keeps the old target, an existing target keeps its permissions (with--forcea read-only target is replaced on unix and stays read-only; Windows refuses it and leaves it intact), a symlink is written through, and a device, FIFO or pipe (/dev/null,/dev/stdout, and on WindowsNUL,CON, …) is written in place. A failure to create the temporary file names the directory (#18, #25). buildnever packs its own output: the target and its temporary file are left out when they lie inside the source folder (#24). The same holds forpackandbuildwith stdout redirected into the source folder (dayzmake pack m > m/out.pbo) (#38).- The
apiwarning for a mod with an unsafe prefix shows the prefix escaped once, not twice (#31). keygencreates the private key readable by its owner only (0600) (#20).buildandpackskip FIFOs, devices and sockets in the source folder (unsupported-filewarning, no more hanging on a FIFO) and files whose names are unsafe as PBO entry names (unsafe-pathwarning);-xexcludes apply first. Names that collide (case-insensitively, for exampleconfig.cppandconfig.bin) give aduplicate-entrywarning; the first in sorted order wins, except that an entry generated from source (the rapifiedconfig.cpp, a.p3dopacked as.p3d) wins over a plainconfig.binor.p3dof the same name (#35). An unreadable source file, such as a dangling symlink, is named in the error (#27, #30, #32, #33, #35).buildmatches the model extensions.p3d,.rtmand.p3docase-insensitively (N.P3Dis binarized liken.p3d;xp3dis not a model) (#34).