Skip to main content
POST
/
fork
/
{id}
/
scenario
apply a scenario to a fork
curl --request POST \
  --url http://localhost:3917/fork/{id}/scenario \
  --header 'Content-Type: application/json' \
  --data '
{
  "entities": [
    {
      "health": 100,
      "position": [
        -3,
        1,
        0
      ],
      "team": 1
    },
    {
      "health": 60,
      "position": [
        3,
        1,
        0
      ],
      "team": 2
    }
  ],
  "name": "demo",
  "rules": [
    {
      "actions": [
        {
          "action": "heal",
          "amount": 20,
          "target": "this"
        }
      ],
      "filter": "any",
      "when": {
        "kind": "health_below",
        "threshold": 50
      }
    }
  ],
  "version": 2
}
'
{
  "assertions": 0,
  "entities_spawned": 3,
  "fork_id": "fork-1",
  "ok": true,
  "rules": 1,
  "templates": 0
}

Path Parameters

id
string
required

Fork id to apply the scenario to.

Body

application/json

A scenario document (same shape as POST /scenario): templates, entities, rules, assertions, camera, game.

The body is of type any.

Response

200 - application/json

Scenario applied to the fork; main world untouched. Returns ok:false with an error when the fork id is unknown.