scmJS docs

The AI

The Tools ▸ AI menu

Tools ▸ AI holds an assistant that reads and edits the open map with you, and tools that lay out maps, write triggers, names and briefings, review a map and rewrite its strings. They come with the scmjs.dev plugin and run on your own Anthropic API key.

Claude Desktop, Claude Code, Cursor and other AI apps can work on your maps too, the open map included, with each change as one undo step. Claude Desktop needs no terminal: you install scmJS into it from one file. See AI tools.

Adding your key#

  1. Make an API key at console.anthropic.com.
  2. Open Edit ▸ Preferences ▸ Plugins ▸ scmjs.dev (or Add your key… in the Account dialog), paste the key under Your Anthropic key and press Check and use.
  3. The key is checked with Anthropic first, which costs nothing. When it passes, the Tools ▸ AI menu, the assistant and the AI buttons in the editor's dialogs appear.

Only an Anthropic key works: the key is checked with Anthropic, and a key for another service or for a model running on your own computer is refused. No scmjs.dev account is needed for this. Anthropic bills each request to your Anthropic account. The key stays in your browser: scmjs.dev passes it on with each AI request and keeps no copy. Forget the key on the same page removes it, and the AI features with it.

A few things are the same for every feature:

Where your key goes#

Each AI request goes from your browser to the scmjs.dev server with your key attached. The server passes it to Anthropic and sends the answer back. It keeps nothing of the request: not what you typed, not the answer, not your key or your address. To hold everyone to 30 requests a minute, 1,000 a day and 4 at once, it counts requests per address, in memory only: the counts are never written to disk. What Anthropic keeps is set by Anthropic's own terms for the API.

What the model is told, and what the editor does with its answer, is public in scm-js/ai-engine. Each AI feature is one file there. The server's sign-in, accounts and limits are not public.

If a feature gives you a bad result, open an issue on ai-engine with what you asked, what came back, and the map if you can share it.

The assistant#

The assistant placing a squad for Player 1 on Big Game Hunters

Assistant (Ctrl+Shift+A, or the AI cell in the status bar) opens a conversation about the open map. Ask a question or say what to change, and the assistant reads the map and edits it with the editor's own tools while you watch.

Each turn is folded into one block under your message. While it runs, the block shows the latest steps (▸ a read, ✎ a change), and the map outlines what is about to change and follows the work, zooming out but never in. Scroll or zoom yourself and the view stays where you put it for the rest of the turn. When the turn ends, the block shows the steps, the time and the cost, with an Undo button that reverses the whole turn. Escape stops a turn.

To start a message, use the suggestion chips above the input, or right-click the map and choose Ask AI about this spot / the selection / this area…. Tick Picture to send a screenshot of the visible area. Player Settings has a Set up with AI… button that sets up players and forces from one sentence. After 24 rounds of tool calls the assistant stops and offers to continue.

Make Scenario#

Make Scenario: the design document for a four-player madness map

Make Scenario… builds a whole scenario from a sentence, such as "a madness map" or "a two-lane tower defense". Set the size, tileset and number of players and press Design.

  1. The design. The model writes a design document first: the premise, the players and forces, each trigger system and its settings, the layout and its locations, the objectives and the briefing. Edit it directly, or describe what should change and press Design again. A location name can include {p}, as in "Spawn {p}", to build that system once per player.
  2. The build. Build works through the design one step at a time, each step a row that passes or fails on its own: the terrain and locations, players and forces, each system, the objectives and briefing, the name, and a Check Map at the end. Common layouts (corner camps, lanes, arenas, a bound's course, a town) are laid out by the editor itself; others are drawn from the model's shapes. Common systems (spawns, income, waves, lives, shops, leaderboards and the like) are built by the editor and shown in green; anything else is written in TrigScript and shown in gold.

When it finishes, Review it… or Open the assistant to keep going.

Generate Map and Redo Area#

Generate Map: the plan as a coloured grid, with the designer's notes

Generate Map… lays out a melee map from a description: the number of players, the kind of terrain, where the bases go and the symmetry. It shows a plan first: a rough grid of terrain, the bases with their resources, ramps, a name and the designer's notes. Apply paints it with the isometric brush onto a new map, or onto the open map if it is the same size. Refine sends the plan back with your changes ("more room around the naturals") and a picture of the result. Treat the result as a starting point, and check the ramps against the cliffs before you play.

Redo Area… does the same for part of an existing map. Mark an area (or right-click it and choose Redo this area with AI…) and describe what should be there; the new ground joins the old at the edges.

Triggers, names and strings#

Review Map on Big Game Hunters

Options#

Tools ▸ AI ▸ Options… opens the same Preferences page as the key:

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.