Skip to content

A different step on each system ​

Your step does the same job everywhere, but not the same way on macOS and on Linux, or it only makes sense on one of them.

Solution ​

Give run one entry per system. Each entry is the run of that system:

quests.json
json
{
  "id": "weekly",
  "kind": "action",
  "title": {
    "en": "Turn on the weekly tidy",
    "fr": "Active le rangement hebdomadaire"
  },
  "run": {
    "macos": {
      "do": "automation.enable",
      "args": { "key": "tidy-downloads" }
    },
    "linux": {
      "do": "automation.enable",
      "args": { "key": "tidy-downloads" }
    }
  },
  "check": { "type": "automation", "key": "tidy-downloads", "enabled": true }
}

examples/quest-pack/core.fragment.json#/quests/0/steps/3

When the step exists on one system only, say so with os. This step opens the microphone settings of macOS, and nothing on Linux:

quests.json
json
{
  "id": "microphone",
  "kind": "manual",
  "human": "approve",
  "os": ["macos"],
  "title": { "en": "Allow the microphone", "fr": "Autorise le micro" },
  "run": { "do": "mac.open-pane", "args": { "pane": "microphone" } },
  "check": { "type": "permission", "name": "microphone" }
}

examples/quest-pack/do-it.fragment.json#/quests/1/steps/0

Terminal
sh
alta lint my-pack

How it works ​

The game knows the player's system and keeps the entry for it: a run with macos and linux keys runs the matching executor, and a step whose os does not list the player's system is not shown to them. A link step works the same way: open can be one https address or one per system. alta lint refuses an executor on a system where it does not run (step.run-os), so you learn it before a player does.

Variants ​

  • Different words. The quest's support.notes explain a difference to the player, per system, in each language.
  • Not in a hosted world. Some executors do not run in a world hosted on a server; the Executors page says which, and support.hosted tells the player.
  • Which systems at all. support.platforms lists where the whole quest works.

What's next

Alta OS is open source (MIT).