Template Library Generator for TerrainBuilder (DayZ/Arma 3).
*.tml is a Template Library file used by TerrainBuilder to import map objects.
This tool crawls your P:/ (or any game root) and
generates libraries automatically so you can update them fast and consistently.
It was tested on DayZ.
- Scans one or multiple
--pathroots (absolute or relative to--game-root) - Groups directories by object count threshold
- Skips whole subtrees via
--skip(supports prefix match) - Preserves original model paths and casing in
<File> - Makes
<Name>unique across all libraries (case-insensitive) - Auto-assigns colors by library type; unknown groups use a hash color
- Library
shapeis set by group type (nature = ellipse, structures/roads = rectangle)
tml-gen.exe -g P:\ -p dz -o out -n 75 -f./tml-gen -g /home/user/p_drive/ -p dz -o out -n 75 -fExecute tml-gen --help to show all available options.
-g, --game-root(required): absolute path to base game root, e.g.P:\-p, --path(repeatable, required): path(s) to scan inside game-root or absolute-s, --skip(repeatable): skip prefixes after normalization- Defaults to:
characters,vehicles,weapons,animals,gear,data - Matches by prefix:
animalswill also skipanimals_bliss,animals/...
- Defaults to:
-n, --threshold: minimum objects per library (default75)-o, --out: output dir (defaultout)-f, --force: delete output directory before writing
Files are grouped by directory nodes.
If a node has fewer than --threshold objects,
the generator climbs up until the second level (e.g. dz/worlds),
but never to the top-level dz group.
Files directly in GameRoot are placed in the root group only.
<Name> must be unique across all libraries. The generator:
- Keeps the base name if unique.
- Otherwise tries to add a logical suffix:
- If the first path segment is not
dz, append_<root>. For example, the filemy_world/Ruin_Wall.p3dhas the model nameRuin_Wall.p3das in the original game, then it will be registered asRuin_Wall_my_world - Else if the path contains:
wrecks,ruins,bliss,sakhal,proxy,military,furniture,residential,industrialappend that tag.
- If the first path segment is not
- If still not unique, appends
_N(starting from1).
Matching is case-insensitive, but the emitted name keeps original casing.
Library header (<Library ...>) gets:
default_fill/default_outlinebased on library nameshapebased on type:plants,rocks→ellipse- everything else →
rectangle
Type colors are hardcoded (water = blue, industrial = yellow/brown, etc.). Unknown types use a stable hash color.
