Guide
One line to a whole town, and events that are nobody's fault. New in 0.1.7. Optional: nothing else depends on it.
POST http://localhost:8767/v1/broadcast
{ "from": "the mayor", "text": "There's a tornado warning", "to": "all" }
-> { "ok": true, "heard_by": 34, "orders": 0, "wakes": 31 }
From the terminal, lw broadcast "There's a tornado warning" --from "the mayor". From an agent, the MCP tool broadcast.
to is one of:
to | who hears it |
|---|---|
"all" (the default) | every named character in the last state feed |
| ["Tobias", "Mara"] | those characters |
| {"near": [x, z], "radius": 40} | everyone within the radius of that point, from the last state feed |
The answer comes back straight away. heard_by is how many journals got the line, orders how many characters were given the instruction in it, wakes how many will plan something about it. The reactions follow on the next ticks; your game only runs the commands it is sent, exactly as for anything else.
The brain decides what the line is, once, for everyone:
can and never for that character, as a typed order does.A line is an order only when part of it is shaped like one (an imperative, "everyone to…", "you must…") and the command gate can ground that part. Reported speech ("the guards told everyone to stay calm") is news.
Every listener's journal records the line as kind: "broadcast" with told-by:<from>. It is hearsay, and it is treated as hearsay:
A line classed hazard ("fire at the inn", "the river's rising", "raiders on the north road") or opportunity ("the fair opens at noon", "the smith is hiring") wakes a character when its weight times the character's persona reaches 5 (wrongs keep their own bar of 8). The persona shapes the plan:
| who | on a hazard |
|---|---|
| a watchman or guard | warns others, then holds his post |
| a child | shelters at home |
| an innkeeper | shelters at her inn and opens the door to others |
| someone stubborn | finishes the task first, then shelters: a late shelter, not no shelter |
| whoever is at the hazard's place | gets out first |
| anyone else | shelters |
An opportunity is attended when its time is free that day and no mission holds it. An all-clear ("the storm has passed", "the fire's out") ends a shelter and the character goes back to her day; a shelter also ends by itself after two game hours. A grudge she was pursuing is set aside for the reaction and resumes after it.
The manifest's per-character salience block replaces the persona's multipliers ({"hazard": 1.4, "opportunity": 0.5}; 0 means never wakes for this), and never rules still filter every move. See Manifest.
What reads these classes. The event gate 0.1.7 fetches reads hazards, opportunities and all-clears in your own words, next to the wrongs, gifts, needs and background lines it always read. A line it is not sure of goes to the unsure lane. If your world has phrasings of its own (a hazard only your lore names, an offer spelled your way), name them in the manifest's events section and they are stamped before the gate:
"events": {
"hazard": ["tornado warning", "the dam has burst"],
"opportunity": ["free food", "the fair opens"],
"clear": ["storm has passed", "the fire is out"]
}
Shelter, warn others, evacuate, hold a post and attend are verbs of the town-2 vocabulary. Declare "vocabulary": "town-2" and list the ones your characters may use; a town-1 manifest keeps exactly its old behaviour, and a character with none of them simply does not react to a hazard. With no manifest loaded, every move is available.
| verb | engine action (default) | what your game does |
|---|---|---|
| shelter | seek-cover | go indoors (the nearest door, or your own home), or behind something solid |
| warn-others | say, then navigate-to | shout the warning, then move |
| evacuate-to | navigate-to | run to the named place |
| hold-post | guard | stay put, alert |
| attend | navigate-to, then idle_social | walk to the event and join in |
Rebind any of them to an action of your own with the verb's engine. lw manifest check lw.manifest.json --executes <your actions> lists every verb with no body in your game, so nothing silently does nothing.
For an event only some characters see, keep using the perception door, one line per witness:
POST http://localhost:8767/v1/perceive { "char": "Mara", "text": "the inn's kitchen is on fire" }
The classes above apply the same way. There is nothing to list per event and nothing to script.
lw watch shows the reactions as they happen; lw why tobias shows the plan, the move he is on and the line that woke him. The flywheel log carries deliberator_wake with the class, deliberator_hearsay when a told wrong was held against someone who is not the player, and deliberator_stand_down with all clear.
Next: Give orders.