Extracting
npm run extract # auto-detect
npm run extract -- --from "/mnt/c/Program Files (x86)/StarCraft"
npm run extract -- path/to/StarDat.mpq path/to/BrooDat.mpq
SCM_DATA_DIR=~/games/sc npm run extract
With no arguments the script looks for StarDat.mpq and BrooDat.mpq (and
patch_rt.mpq, which wins over both) in $SCM_DATA_DIR, then in fixtures/data/,
then in the usual install locations, including the Windows drives a WSL session sees
under /mnt.
Brood War's archive is required. Its units.dat is the layout the decoder expects,
and the Ice, Desert and Twilight tilesets only exist there.
Everything lands in public/ (inventory), which is gitignored.
The run takes a few seconds and is idempotent, so re-run it after a patch or after
changing what the scripts extract.
| Command | Does |
|---|---|
npm run extract |
everything |
npm run extract:tilesets |
tileset graphics only |
npm run extract:units |
unit tables, sprites and scripts only |
npm run check:assets |
report what is on disk, touching no archives |
npm run dev and npm run build warn when the data is missing but do not fail. The
app degrades instead of crashing: flat tileset colours instead of terrain, coloured
markers instead of unit sprites, with a note in the relevant palette. A green test
run and a working dev server therefore do not prove extraction still works. Run it.
scripts/extract-assets.mjs is the front end; archive discovery lives in
scripts/lib/archives.mjs.