scmJS docs

What to ask

Ask as you would ask a person who knows StarCraft maps. You do not need to name tools; the AI chooses which to use. Here is Claude Desktop asked about a map, then for its minimap:

Claude describing crossing.scx (size, players, resources, Check Map) and then showing its minimap

Below are a few more requests with what scmJS answers. The answers are real, from scmJS's sample maps; your AI app puts them in its own words.

Is anything wrong with this map?#

What is in ums.scx, and does Check Map find anything?

The AI reads the map (map_info) and runs Check Map on it (map_check), which answers:

ums.scx  ▲ 1 warning
  ▲ Nothing makes Player 1 lose: no Defeat, and no Victory or Draw for another player. A scenario
    does not end when a player's units are gone. · Triggers

Then ask it to fix what it found:

Add a trigger that makes Player 1 lose when they have no units left.

Change a message#

Change the opening message to "Hold the ridge." and show me what changed.

The AI takes the triggers out as text, changes the message, puts them back, and compares the map before and after. The comparison it reads you includes:

Triggers +1 −1
  − Player 1: Always() → Display Text Message(Always Display, "Hold the base."); Play WAV(…
  + Player 1: Always() → Display Text Message(Always Display, "Hold the ridge."); Play WAV(…

Watch the changes in the editor#

Open ums.scx in the editor so I can watch what you change.

The map opens in the scmJS editor in your browser, and every change after that arrives there, one step in Edit ▸ Undo each. Select some units and ask:

Make the units I have selected invincible.

Working in the editor has the rest.

Make a melee map#

Make me a four-player desert map.

✔ crossing.scx: 128 × 128 · Desert · 4 players · seed 2026 · 29 KB
  Laid out   mirrored both ways · an open middle · 4 ramps · 2 free bases
  Balance    walks the symmetry makes equal differ by 1.5% start to start, 5.0% to the free bases
  Check Map  no errors or warnings

The four-player desert map made from seed 2026

Each start has a main on high ground with a ramp, a natural, and a way to the middle. The same seed makes the same map, so you can ask for "the same map, but jungle".

Is it fair?#

Is crossing.scx fair? Where are the chokes?

The AI reads the layout (map_analyze): the walk from each start to the others, by ground and by air, how long a Zergling or a Marine takes, and the narrowest point on each way. It ends with the verdicts:

✔ Every start's walks to its opponents match the others', nearest to farthest, within 2%; near and far pairs differ by 53%.
✔ Every main has 9 mineral fields and 1 geyser, 13,500 minerals and 5,000 gas.
✔ Naturals 33 tiles from their mains by ground.
✔ Every main's way out is 3.5 tiles at its narrowest.

Ask for the picture too, and the AI shows you the walks it measured:

The layout of the same map: white walks between the starts, yellow walks to the naturals, a circle on each natural and an orange square on each ramp

Write the triggers as a script#

Give village.scx a script: a greeting at the Elder, the Captain and the Smithy.

For more than a handful of triggers, the AI writes a TrigScript script in place of triggers by hand: TypeScript in which one function can make many triggers, and the map's locations, switches and units are checked by name. It looks up what a script can call for your map (map_script_api), writes the script's files into the map (map_script_import), and is told at once whether they compile. Here it asked for a location the map does not have:

village.scx: main.ts, greet.ts added
main.ts:3:63 error Property 'Smithy' does not exist on type '{ … readonly Elder: Location<1>; readonly Captain: Location<2>; readonly Shop: Location<...>; … }'.
✖ 1 error in the script. The files are kept in the map; send the corrected ones.

It sends the corrected file, the script compiles, and map_build puts its triggers into the map beside the ones made by hand:

✔ village.scx: 3 triggers → #18–#20 · written to village.scx · 29 KB  TrigScript 4.5.0, TypeScript 6.0.3

The script stays in the map: Triggers ▸ TrigScript… in the editor opens the same files, and you or the AI can go on from either side.

Does it work?#

Play the first quest in village.scx and tell me whether it works.

The AI plays the map in the game itself (map_test): it orders your units about as you would, makes things happen at set times, and reads what came of it. Here it walks the hero to the Elder, to the crate and back, on a small RPG map:

village.scx: 17 triggers, 1 scenario played
  ✔ the lost medicine  3 of 3 expectations held
      ✔ "QUEST COMPLETE: The Lost Medicine" was shown: shown at frame 901
      ✔ Player 1 has exactly 100 minerals: it has 100
      ✔ switch "Q1 done" is set: it is set
      ran to 0:45 (frame 1,080): the game was still going; Player 1 has 100 minerals and 0 gas
      shown (13 lines):
        0:04  "QUEST STARTED: The Lost Medicine. Fetch the crate from the forest edge."
        0:22  "You pick up the medicine crate. Take it back to the Village Elder."
        0:38  "QUEST COMPLETE: The Lost Medicine. +100 minerals."
        …
      fired (6 triggers), by when first:
        0:04  #4 "q1 start: talk to elder"
        0:22  #5 "q1 fetch: pick up crate"
        0:38  #6 "q1 done: crate returned"
        …

So an AI that has written triggers for you can check them before it says they work, and tell you what the player would see. Ask it to keep the checks ("and keep that as a test"): they go into village.tests.json beside the map, and "run the tests for village.scx" plays them again after the next change. They are the same tests scmjs map test runs.

Share it#

Share crossing.scx with a link.

This needs the scmjs.dev account tools switched on. Once you are signed in, the AI first tells you what would happen: the map is stored on your account, and anyone who has the link can open it. Nothing is uploaded until you say yes. Then it gives you the link.

More to ask#

A request The tools the AI uses
"Which triggers never fire, and why?" map_trace
"What happens if the hero walks into the lair before the third quest?" map_test
"Which of my maps still mention the Marine?" map_find
"Give Player 1 six more Marines in the Base location and make the Ghost invincible." map_units, map_locations, map_edit
"Put a plateau in the middle with a ramp on its south side, and a few lakes around it." map_terrain, map_edit, map_preview
"Make Player 3 a Protoss computer in the second force, and give Zerglings 50 hit points." map_settings, map_set
"Show me the map." map_preview, which answers with the picture
"Do the triggers slow the game down?" map_cost
"Which triggers never fired in the replays in replays/?" map_coverage
"What changed in ridge.scx since the last commit?" (for maps kept in git) map_diff with rev
"How much smaller can this map get?" map_optimize, a dry run
"What does this mod change in the game?" mod_info, mod_diff (the mod tools)
"Upload the games I played this week." replay_sync, which asks first (the account tools)

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.