Extracting for a source build
A clone has no game data until it is extracted. The script finds the archives on its own or takes them as arguments:
npm run extract # look for an installation
npm run extract -- --from "/mnt/c/Program Files (x86)/StarCraft" # a folder
npm run extract -- path/to/StarDat.mpq path/to/BrooDat.mpq # the archives themselves
SCM_DATA_DIR=~/games/sc npm run extract # from the environment
With no arguments it looks in SCM_DATA_DIR or STARCRAFT_DIR, then in the
repository's own fixtures/data/, then in the usual install locations for the platform,
including the Windows drives a WSL session sees under /mnt. A patch_rt.mpq found with
the two is applied over them.
| Command | Does |
|---|---|
npm run extract |
everything |
npm run extract:tilesets |
the tileset graphics only |
npm run extract:units |
the unit tables, sprites and scripts only |
npm run check:assets |
report what is on disk without opening any archive |
Everything lands in public/ (its README is the inventory),
which is gitignored along with fixtures/. The run takes a few seconds and can be
repeated at any time; repeat it after a game patch or after changing what the scripts
take. npm run dev and npm run build warn when the files are missing and carry on,
because the editor degrades rather than crashing without them. That also means a green
test run and a working dev server prove nothing about the extraction; run it.