Dayz build imageset

From DayZ-n-Chill/Agentic-Z · View interactive version

Dayz build imageset is an AI agent skill from the GitHub repository DayZ-n-Chill/Agentic-Z. Packs PNG sprites from a mod's .gui-sources/<setname>/ folders into a DayZ .imageset definition and .paa atlas under gui/imagesets/. Use when a mod's HUD or menu icons need to become an imageset that .layout files can reference.

How to use this skill

Skill file

<!-- skill-dir-note -->

Path note: <skill-dir> in commands below is the absolute path of this skill's folder. When the agent loads this skill the harness exposes the skill's base directory; substitute it before running. Sibling skills are reached via <skill-dir>\..\dayz-X\.

/dayz-build-imageset

Pack a folder of PNG sprites into a DayZ imageset (atlas + .imageset definition file). Source images stay in .gui-sources/, which /dayz-build-pbo leaves out of the PBO (its exclude.lst drops .gui-sources\); only the packed .paa atlas and .imageset file land under gui/imagesets/ where the engine expects them.

Layout convention:

<mod-root>/
  .gui-sources/
    my_icons/
      hud_health.png
      hud_stamina.png
      hud_thirst.png
    main_menu/
      ...
  gui/
    imagesets/
      my_icons.imageset      <- generated
      my_icons.paa           <- generated
      main_menu.imageset
      main_menu.paa

Follow skills/_shared/dayz-conventions.md.

Requirements

Pillow composes the atlas. If it is missing the script exits 1 with an install hint:

py -m pip install -r "<skill-dir>\requirements.txt"

How to run

python "<skill-dir>\build_imageset.py" <ModName> [--mod-name <name>] [--dry-run] [--prune]
python "<skill-dir>\build_imageset.py" <mod-root> [--mod-name <name>] [--dry-run] [--prune]

| Argument | Required? | Notes |

|---|---|---|

| <ModName> | one of the two | Resolves to workspace/<ModName>/ in the project cached by /dayz-init, like the other /dayz-* skills, so it works from the repo root. |

| <mod-root> | one of the two | A path to a folder containing .gui-sources/. Any argument with a slash, backslash or drive letter, or . / .., is read as a path (use .\MyMod for a folder in the current directory). |

| --mod-name <name> | no | Root used in the path field of the .imageset (<name>\gui\imagesets\<setname>.paa). Defaults to the mod's $PBOPREFIX$, because in-PBO paths are rooted at the PBO prefix (vanilla P:\DZ\gui.txt:1 has prefix=gui\, and P:\gui\imagesets\playstation_buttons2.imageset:7 references Gui/imagesets/...). With no $PBOPREFIX$ it falls back to the folder name with a [WARN]. |

| --dry-run | no | Packs in memory and prints, per set, the atlases it would write and the stale outputs it would delete (Would remove stale ...). Writes, converts and deletes nothing. Still needs preflight, Pillow and ImageToPAA.exe. With --prune it also lists the orphans it would delete (Would remove orphan ...). |

| --prune | no | Deletes orphan outputs: generated files in gui/imagesets/ whose .gui-sources/<set>/ folder no longer exists (step 5). Without it they are only reported with a [WARN]. Preview with --dry-run --prune. |

What it does

  1. Preflight gate (DayZ Tools needed for ImageToPAA.exe), before any other check.
  2. Check that Pillow is installed and that <mod-root>/.gui-sources/ exists with at least one subfolder.
  3. Resolve ImageToPAA.exe from DayZ Tools.
  4. For each subfolder of <mod-root>/.gui-sources/ (folders whose name starts with a dot, such as .git, are skipped):
  1. Look for orphans: .imageset files in gui/imagesets/ whose stem is neither a current set name nor <set>_N of one (ignoring case), left behind when a set folder was deleted or renamed. /dayz-build-pbo would keep packing their sprites. Only files this skill wrote count: the .imageset must start with ImageSetClass {, carry Name "<stem>" and point at ...\gui\imagesets\<stem>.paa, so hand-made or vanilla-style imagesets (which use Gui/imagesets/....edds, as at P:\gui\imagesets\playstation_buttons2.imageset:7) are never touched. Each orphan .imageset and its <stem>.paa are reported with a [WARN], or deleted with --prune. This also runs when .gui-sources/ has no set folders left, before that run fails.
  2. Report a summary; exit non-zero if any imageset failed. Orphans alone do not change the exit code.

Generated `.imageset` format

ImageSetClass {
 Name "my_icons"
 RefSize 512 512
 Textures {
  ImageSetTextureClass {
   mpix 0
   path "MyMod\gui\imagesets\my_icons.paa"
  }
 }
 Images {
  ImageSetDefClass hud_health {
   Name "hud_health"
   Pos 10 10
   Size 64 64
   Flags 0
  }
  ...
 }
 Groups {
 }
}

This matches the vanilla layout: P:\gui\imagesets\playstation_buttons2.imageset (:1 to :24) has the same Name / RefSize / Textures / Images / Groups blocks and per-sprite Name / Pos / Size / Flags 0 fields.

Pos is the sprite's top-left in atlas pixels (after gutter); Size is the sprite's own dimensions (gutter is NOT included in Size). In the vanilla file above, DPAD_all_directions has Pos 1 1 and Size 44 44 inside a RefSize 64 64 atlas, so Size is the sprite alone.

The vanilla file also lists a second texture, mpix 1 with an @2x atlas, beside the mpix 0 one (playstation_buttons2.imageset:5 to :12). The generated file has only mpix 0, so the game uses that one atlas at every resolution.

Using the set in a layout

Refuses to run if

Do not

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.