scmJS docs

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 path/to/patch_rt.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. The patch_rt.mpq found with the two is applied over them, as the game applies it, and is required: without it the script stops and says so, since the unit tables it would write are the ones from before the game's patches. npm run extract:tilesets alone does not need it, as the patch holds no terrain. npm run doctor says when fixtures/data/ has the two archives and not the patch.

The script reads .mpq archives only, from a classic installation or the map editor download; it cannot read a Remastered installation. With only Remastered, run the dev server and install from Help ▸ Game Data… as in the browser.

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 runs without them. A green test run and a working dev server therefore prove nothing about the extraction; run it.

The container image#

The container image at ghcr.io/scm-js/scm-js carries no game data and refuses to serve the paths the files would be at, so a container starts at step 5 of the search and asks, like the hosted editor. To serve your own extraction to your own browser instead, mount an extracted tree over those paths:

docker run --rm -p 8080:80 \
  -v "$PWD/public/tileset:/usr/share/nginx/html/tileset:ro" \
  -v "$PWD/public/arr:/usr/share/nginx/html/arr:ro" \
  -v "$PWD/public/unit:/usr/share/nginx/html/unit:ro" \
  -v "$PWD/public/game:/usr/share/nginx/html/game:ro" \
  -v "$PWD/public/scripts:/usr/share/nginx/html/scripts:ro" \
  ghcr.io/scm-js/scm-js:latest

That is a copy on your own machine served to your own browser. Publishing an image with the files inside, or serving one from a public address, is redistributing Blizzard's data; see ATTRIBUTION.md.