Skip to content

five-on-it / apps/tools/src/cli

apps/tools/src/cli ​

The level pipeline's command line (node apps/tools/src/cli.ts <command>, wrapped by the root level:* scripts):

  • export-level [scene] [--watch]: read every scene folder of the editor project (or one) and export it to packages/world/levels/<name>.json, remove what a gone scene left behind and rewrite the registry packages/world/levels/index.ts; --watch keeps doing it while the editor saves.
  • port-level <level | file.json> [--scene <name>]: build an editor scene from a bundled level or a level file (the scene is named after the level unless told otherwise).
  • recipe-level <file.recipe.json> --scene <name>: build an editor scene from a recipe (kit pieces and blocks placed, roads, spawns; the kits read from apps/level-editor/assets/kits/), the way the Blender generators describe a level.
  • dress-level <level | file.json> [--out <file.recipe.json>]: the recipe that places the city kit's pieces where a block level has its blocks, to be built with recipe-level.
  • region-level <spec.json> [--out <dir>]: a level from a region spec, without Blender: its own kit, its recipe and its places written into the kits folder (or --out), its map printed; then recipe-level and export-level as for any recipe.
  • city-level <spec.json> [--out <dir>] [--check]: a level from a city spec: the solver's plan built by Blender (city.py) into the kits folder (or --out), its map printed; then recipe-level and export-level. --check runs the solver alone: the spec's problems, or its map.
  • new-level <name>: an editor scene with nothing but a ground and a spawn point. Scenes are named test-<words> (a test level) or main-<words> (a level that ships).
  • build-blocks [--out <file>]: the block library alone, as a .babylon asset to drag into any scene.
  • check-levels: the gate (names, exports current, levels playable, no orphan, registry current, skill copies alike, the kit library current).
  • kits-export: the kit library, every piece of the shared kits (its footprint, tags, anchors…), written to packages/catalogue/src/kits.generated.json for the catalogue; run it after regenerating a kit.
  • osm-tags [--check]: the OpenStreetMap tag snapshot the buildings are made from, asked of taginfo and written to packages/catalogue/src/osm/osm-tags.json (--check reads the one there is, without the network).
  • play [level]: export, run the game on the level, re-export while the editor saves.
  • audio-placeholders [--force]: the radio's sample stations' placeholder items (spoken idents and episodes over synthesized music, encoded to MP3 by Blender), each one only when it is not there yet (--force: all of them, over what is there).

Opening the editor itself is npm run level:editor (build/editor.mjs).