From a mod folder to a replay
The whole path, from a mod as its makers ship it to a bot made for it playing you on the
play page, and the game's replay played on from a moment. Cosmonarchy BW is the example;
any mod goes the same way. You need your copy of StarCraft, Node (for
npm install -g @scm-js/cli, which gives the scmjs command), and Docker for building
the bot. To play the catalogue's example bot instead of your own, skip steps 3 and 4 and
give --bot cosmonarchy-example in step 5.
- The mod. Use the release folder as its makers ship it, here
Cosmonarchy BW, or a folderscmjs mod unpackwrote.scmjs mod info "Cosmonarchy BW"names it, counts its files, plugins and FireGraft project, and prints its hash. - Check it.
scmjs mod check "Cosmonarchy BW"lists the mistakes it finds across the tables, pictures, scripts and sounds, errors first. Nothing here stops on a warning. - A bot for it. In a new folder beside the mod's,
scmjs bot newwrites a bot to start from. Thenscmjs mod header "../Cosmonarchy BW" --botwritesCosmonarchy_BW.handCosmonarchy_BW.ids.jsonbeside it and names the mod in itsscmbot.json; the command prints how many units, weapons, upgrades and techs it named. Write the bot against the header's names (Cosmonarchy_BW::UnitTypes::Terran_Mason); the scmbot repository'sexamples/cosmonarchy/is one to start from. - Build it.
scmjs bot buildwritesout/<key>.scmbot. The first build downloads the toolchain, a Docker image. To try it without a page,scmjs bot run out/<key>.scmbot "(4)Exodus 1.0.scx" --mod "../Cosmonarchy BW"plays it, and its first lines say "made for Cosmonarchy BW". - Hand it all to the play page. With Exodus, one of the mod's maps (
--maptakes the map's file, so give its path if it is not in this folder),scmjs mod play "../Cosmonarchy BW" --map "(4)Exodus 1.0.scx" --bot out/<key>.scmbotopens the play page in your browser. The first time, the page asks for your StarCraft folder, then keeps the mod (a few minutes for a mod of Cosmonarchy's size) and loads again; then Exodus is on the setup screen with its own settings, and the row beside yours names your bot "made for Cosmonarchy BW". The terminal says the same and returns. With--bot cosmonarchy-examplethe page's own example bot plays instead. - Play. Press Start Game. The mod's plugins run in the game, the mod's AI plays the map's computers, and your bot plays its side.
- Save the replay. Game Menu ▸ Save Replay downloads the game as a
.rep, with the mod's name and hash at the end of the file. - Read it.
scmjs replay info game.repshows theModline (Cosmonarchy BW, its hash, and its makers' link if you gave the page one) and thePluginsline (the four that ran, and the FireGraft project).--builds --mod "../Cosmonarchy BW"lists what each player ordered by the mod's names. - Open it in the editor. At scmjs.dev/editor, File ▸ Open Replay… opens it with Aftermath, which shows the mod and its link. The Replay view plays the game with the mod the play page kept in step 5, and the analysis plays it through the same way: the Game, Analysis and Cast tabs fill as for any replay. With the mod's plugins running, the analysis goes at about the game's own pace, so a long game takes a while, and the Fights tab lists the fights without playing them again (Replays of a mod). Help ▸ Game Data… ▸ Add a data set… with the mod's folder, or Aftermath's Attach the Mod's Folder…, names the units by the mod.
- Play from a moment. Stop the timeline where you want and press Play From Here. The play page opens with the mod and its plugins running, at that moment; take a player and play on, alone or against a community bot such as yours.