scmJS docs

Checking, testing and saving

Before a map is played, it can be checked for common mistakes, tried in the game, and saved in the form you want to release.

Check Map#

Check Map on a new map: eight players and no start locations yet

Tools ▸ Check Map… looks for what the game would refuse or silently drop. A map with no triggers is judged as a melee map and one with triggers as a scenario, since that is how each is played.

A map with triggers gets three more checks:

Double-click an issue to go to it. The same check runs inside the Save dialog.

From a terminal, scmjs map check runs the same check over any number of maps, and can fail a CI build on it (Checking a map).

Test Map#

The Test Map dialog

Tools ▸ Test Map (Ctrl+F5, or the toolbar's Test button) hands the map to the game. The desktop app has one place to send it: StarCraft. The editor at scmjs.dev has two, StarCraft and the browser, and Send the map to at the top of Edit ▸ Preferences ▸ Testing chooses which one Test Map uses. It is the browser until you choose. The Tools menu also has Test in StarCraft and Test in Browser, which go to that place whatever the choice. Tools ▸ Test Map Settings… opens that Preferences page.

StarCraft. The game cannot open a map from the outside, so the editor writes it into a scmJS folder under the game's Maps folder, where Single Player ▸ Custom Game lists it.

The folder, and in the desktop app whether the game starts, are under StarCraft on Edit ▸ Preferences ▸ Testing. The first test in a browser with no folder yet opens a dialog to pick one.

The browser. In the editor at scmjs.dev, Tools ▸ Test in Browser opens the map on the site's play page, scmjs.dev/play, which runs the game in a browser tab. The map goes straight from the editor's tab to that one, and testing again sends the new version to the same tab. The game runs from your own StarCraft files: the first time, the play page asks for the folder StarCraft is installed in. Blizzard's map editor download is not enough for it.

How the map is played is set under This browser on Edit ▸ Preferences ▸ Testing:

Keeping the game. Save Replay in the play page's Game Menu saves the game you are playing as a replay file, as far as it has been played. When the game ends, the play page offers it again beside Watch the Replay, Analyse in the Editor, which opens the replay in a new editor tab with Aftermath, and Play Again.

Debugging triggers. Tools ▸ Debug Triggers in Browser plays the map in a panel under the map instead of a tab, always with the map's own settings, and shows what its triggers do while you play:

Run the command again to rebuild the map and start over in the same panel.

Note. Testing and debugging in the browser come with the scm-sim plugin and appear only in the editor at scmjs.dev, not in the desktop app or an editor hosted elsewhere. There, Test Map goes to StarCraft and Preferences ▸ Testing has no choice to make.

A map for a mod. While a mod's data set is in use (see Data sets made from a mod), the map Test Map builds carries it, so the play page knows which mod the map was made for. StarCraft, started on its own, plays the game's own data rather than the mod's, and the dialog says so; so does a target that cannot take the data set.

From a terminal, scmjs map trace runs a map's triggers in the game and lists which fired, and scmjs map test plays scenarios you write and checks how each ended (Triggers in the game).

Saving#

Ctrl+S writes the map back where it came from.

Save As (Ctrl+Shift+S) and Save Copy As… open the Save dialog; a copy is written without the open map changing its name or file.

The Save dialog

The Save dialog asks for a file name, a format and what to keep. Everything else is folded away underneath and can be left alone:

If Check Map finds problems, the dialog says how many beside a button that opens it; the map saves either way. The options confirmed here are what Ctrl+S reuses for that map from then on.

The file a save replaces is kept, so a bad save can be undone:

Preferences ▸ Files ▸ Saving turns this off.

Maps built on save. A map with a TrigScript program is built by TrigScript as the file is written. The file you save is the one the game plays. It also carries the map as you see it in the editor, and that is what comes back when you open the file again. A notice shows while the build runs, with a button to save without waiting for it. If the build fails, the map is still saved and the notice says what went wrong; the file lacks the built part until a later save succeeds. Test Map builds the same way, and stops on a failure instead.

Save to scmjs.dev…, under File and under Account, keeps a copy of the map on your scmjs.dev account as a numbered revision with a note. It does not change where Ctrl+S writes. See Keeping maps on scmjs.dev.

To see what changed between two saved versions of a map, scmjs map diff compares them from a terminal and --picture draws where; Maps in git covers keeping maps in git.

Recovery copies#

While a map has unsaved changes, the editor keeps a copy of it in the browser's storage (the app's own storage in the desktop app): every two minutes, and whenever the editor goes to the background (another tab, the window minimised). The copy is removed as soon as the map is saved or closed, so a copy only survives when the editor closed with work unsaved: a crash, a closed tab, a power cut.

At the next start the Recover Maps dialog lists what was left, with the map's name, its file, its size and when it was copied. Restore opens the map in its own tab with its changes unsaved, under its old file name, so Ctrl+S writes back to the same file (after the browser asks again for permission). Later keeps the copies for the next start, and File ▸ Recover Maps… lists them at any time. Maps still open in another tab or window are never listed there.

Quitting the desktop app and answering Don't Save removes the copies. A copy only covers changes up to the moment it was made, and it lives in this browser: it is not a backup of the file, and clearing the site's data removes it. Preferences ▸ Files ▸ Recovery turns the copies off or changes how often they are made.

Export an image#

The Export Image dialog

File ▸ Export ▸ Image (.png)… renders the whole map to a PNG, with one setting that decides what the picture is: at 32 pixels per tile it is the full game art, at 8 or 16 the same smaller, at 4 and 2 the average tile colours with units as minimap dots, and at 1 pixel per tile it is the game's minimap. Units, locations, fog and the grid are each a tick.

To show how a map was made rather than how it ended up, the Timelapse plugin (Plugins ▸ Browse Plugins…) records the map one change at a time and exports the recording as a GIF or a WebM video; see Plugins.

Tools ▸ Statistics… counts what the map holds (units per player, resources, doodads, triggers, strings), and Ctrl+F finds a unit, location, sprite, string or trigger by name.

scmJS 0.18.0 · Generated from the repository. The source is under the MIT license, which does not cover what ATTRIBUTION.md lists. StarCraft and Brood War are trademarks of Blizzard Entertainment; this project ships none of their data.