packages feed

swarm-0.7.0.0: data/scenarios/Tutorials/world101.yaml

version: 1
name: First steps
description: |
  Learn some of the first steps you might take on the new planet.
objectives:
  - id: get_trees
    teaser: Get 3 trees
    goal:
      - You're ready to graduate to something a bit more complex! This multi-step tutorial will walk you through a few of the first steps you might take in exploring the new planet, using many of the commands and techniques you have learned in the previous tutorial challenges.
      - You can see that your base starts out with some key devices equipped and some basic supplies for building robots.  To build more advanced devices and produce more robots, you'll need to explore, gather resources, and set up some automated production pipelines.
      - At this point you may want to create an external `.sw`{=path} file with useful definitions you create.  You can then load it via the `run` command.  See https://github.com/swarm-game/swarm/tree/main/editors for help configuring your editor with support for swarm-lang.
      - Your first task is to collect three or more `tree`{=entity}s. You can remind yourself of the available commands using **F4**.
      - Since you don't yet have a `compass`{=entity} device, you won't be able to refer to cardinal directions like `north` or `east`, only relative directions like `left`, `right`, or `back`.
    condition: |
      try {
        n <- as base {count "tree"};
        pure (n >= 3)
      } { pure false }
  - id: get_harvester
    teaser: Make a harvester
    goal:
      - Nice work!  Now, use the `tree`{=entity}s to make a `harvester`{=entity} device. This will require several intermediate products; try making various things, and take a look at your available recipes (**F3**) and at the recipes listed for items in your inventory.  Of course, you may end up needing some additional trees.
    condition: |
      try { as base {has "harvester"} } {pure false}
    prerequisite: get_trees
  - goal:
      - Now that you have a `harvester`{=entity}, you can use `harvest` instead of `grab` whenever you pick up a growing item (check for the word "growing" at the top of the item description), to leave behind a seed that will regrow.
      - "**TIP:** since you only have a single harvester device for now, whenever you send out a robot to harvest something, try programming it to come back to the base when it is done.  Then, execute `salvage` to get the harvester back, so you can reuse it in another robot later."
      - One of the next things you will probably want is a `lambda`{=entity}, so you can define and use parameterized commands.  Scan some things and use the process of elimination to find one.  Since lambdas regrow, once you find one, try getting it with `harvest`.
      - "**TIP:** remember that you can click on cells in the world to see their coordinates."
    condition: |
      try { as base {has "lambda"} } {pure false}
    prerequisite: get_harvester
solution: |
  run "scenarios/Tutorials/world101.sw"
robots:
  - name: base
    display:
      char: 'Ω'
      attr: robot
    loc: [0, 0]
    dir: north
    devices:
      - 3D printer
      - dictionary
      - grabber
      - welder
      - life support system
      - logger
      - toolkit
      - solar panel
      - workbench
      - clock
    inventory:
      - [5, 3D printer]
      - [100, treads]
      - [70, grabber]
      - [100, solar panel]
      - [50, scanner]
      - [5, toolkit]
seed: 2
world:
  scrollable: false
  dsl: |
    "classic"