CONTENT CONTRACT · VERSION 1
puzzle
A puzzle group of switches and pushable stones on a map of the session.
Signature
{ anchor: AnchorRef, blocked: (VariableId)?, grid: (PuzzleGrid)?, id: ContentId, kind: "puzzle", name: TextKey, playing: (VariableId)?, progress: (VariableId)?, radius_mm: number, reset: (Name)?, resets: (VariableId)?, round: (VariableId)?, rounds: ({{Name}})?, solved: VariableId, solved_when: {VariableCondition}, stones: ({Name})? }Fields
| Name | Type | Meaning |
|---|---|---|
anchor | AnchorRef | Centre of its area, an anchor of the map the puzzle stands on (in a room with the anchor's `inside`); every placement it names stands where the anchor does. Length: 1…226; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}/[a-z][a-z0-9_]{0,95}$; Reference: map.anchor |
blocked | VariableId | World bool variable that is 1 while an older world could not take the puzzle's pieces at their places (something not of the map, a player's building, stands on a piece or on the grid): the pieces never move one by one; the room tries again on every load. Absent: not published. Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$; Reference: variable |
grid | PuzzleGrid | Grid of its pushable stones; required with stones. |
id | ContentId | Package-qualified identity; unique within its declaring namespace. Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$ |
kind | "puzzle" | Discriminant |
name | TextKey | Name of the puzzle shown in the reset vote. Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$; Reference: text |
playing | VariableId | World bool variable a handler sets while it plays the round to the players; steps struck meanwhile do not count. Absent: every step counts. Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$; Reference: variable |
progress | VariableId | World int variable holding how many steps of the current round are done; required with rounds (only it outlasts saving). Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$; Reference: variable |
radius_mm | number | Radius of its area: players inside it are asked before a reset, and an empty area resets an unsolved puzzle with stones. Range: 2000…60000; Unit: mm |
reset | Name | Placement of a lever switch outside the grid that resets it (stones home, switches and progress back); with other players in the area, everyone inside votes first. Length: 1…96; Pattern: ^[a-z][a-z0-9_]{0,95}$ |
resets | VariableId | World int variable counting its resets (for hints). Absent: not counted. Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$; Reference: variable |
round | VariableId | World int variable holding how many rounds are done; required with more than one round. Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$; Reference: variable |
rounds | {{Name}} | Rounds of switch placements (local IDs of `map.structures`) that must turn active in order, one round after the other; others are ignored, a repeat of the last counted one does not count again, a wrong one starts the round over (counting as its first when it is the first). Finished rounds stay finished. Absent: no sequence. Items: 1…8 |
solved | VariableId | World bool variable that becomes 1 when it is solved. Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$; Reference: variable |
solved_when | {VariableCondition} | World-variable conditions that must all hold to solve it (plates pressed, fires lit); empty: only the sequence. Items: 0…16 |
stones | {Name} | Placements of its pushable stones (local IDs of `map.structures`), each on a cell of the grid: their start cells, where a reset returns them. Items: 1…32; Unique entries |
Validated example
{
"anchor": "core:valley/bee_garden",
"blocked": "core:puzzle_bee_blocked",
"grid": {
"cell_mm": 2000,
"cells": [
[
0,
1
],
[
0,
2
],
[
0,
3
],
[
0,
4
],
[
0,
5
],
[
1,
0
],
[
1,
1
],
[
1,
3
],
[
1,
4
],
[
1,
5
],
[
2,
0
],
[
2,
1
],
[
2,
2
],
[
2,
3
],
[
2,
5
],
[
3,
0
],
[
3,
1
],
[
3,
3
],
[
3,
4
],
[
3,
5
],
[
4,
0
],
[
4,
1
],
[
4,
2
],
[
4,
3
],
[
4,
5
],
[
5,
0
],
[
5,
1
],
[
5,
3
],
[
5,
4
],
[
5,
5
],
[
6,
1
],
[
6,
2
],
[
6,
3
],
[
6,
4
],
[
6,
5
]
],
"origin_mm": [
169000,
-65000
]
},
"id": "core:bee_garden",
"kind": "puzzle",
"name": "core:puzzle_bee_name",
"radius_mm": 11000,
"reset": "bee_sundial",
"resets": "core:puzzle_bee_resets",
"solved": "core:puzzle_bee_solved",
"solved_when": [
{
"max": 1,
"min": 1,
"variable": "core:puzzle_bee_plate_a"
},
{
"max": 1,
"min": 1,
"variable": "core:puzzle_bee_plate_b"
},
{
"max": 1,
"min": 1,
"variable": "core:puzzle_bee_plate_c"
}
],
"stones": [
"bee_stone_a",
"bee_stone_b",
"bee_stone_c"
]
}