Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ The table is generated from [`index.yaml`](index.yaml); edit that file, then run
| [`sheet-charge-chargen/`](sheet-charge-chargen/) | 1.0.2 | Joins the Charge sheet to +app character applications |
| [`charge-wiki/`](charge-wiki/) | 1.0.4 | Charge rules as wiki pages (action rolls, momentum, consequences, stress, clocks, progression; CC BY 4.0) |
| [`duties-charge/`](duties-charge/) | 1.0.2 | Duties roll provider "charge" on the Charge sheet |
| [`radio/`](radio/) | 1.8.1 | +radio — frequencies to tune in to, speak on and recall, with moderators, admins and locks; the worked example of a system built on @feed |
| [`radio-help/`](radio-help/) | 1.1.1 | Registers the radio topics with +help (requires radio and plus-help) |
| [`radio-config/`](radio-config/) | 1.0.1 | Registers the radio settings with +config (requires radio and plus-config) |
| [`radio-scene/`](radio-scene/) | 1.4.3 | +radio/log — what a listener hears on a frequency goes into their scene, through a tap on the radio feed kind (requires radio and scene) |
| [`scene-verse/`](scene-verse/) | 2.0.0 | Verse and canon on scenes, and +scene/verses (requires scene) |
<!-- packages-table:end -->

Packages bundled with SharpMUSH (`+who`/`+where`, the HTTP handler, the
Expand Down
25 changes: 25 additions & 0 deletions index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,28 @@ packages:
package: duties-charge
version: 1.0.2
description: Duties roll provider "charge" on the Charge sheet
- path: radio/
name: Radio
package: radio
version: 1.8.1
description: +radio — frequencies to tune in to, speak on and recall, with moderators, admins and locks; the worked example of a system built on @feed
- path: radio-help/
name: Radio help
package: radio-help
version: 1.1.1
description: Registers the radio topics with +help (requires radio and plus-help)
- path: radio-config/
name: Radio settings
package: radio-config
version: 1.0.1
description: Registers the radio settings with +config (requires radio and plus-config)
- path: radio-scene/
name: Radio in scenes
package: radio-scene
version: 1.4.3
description: +radio/log — what a listener hears on a frequency goes into their scene, through a tap on the radio feed kind (requires radio and scene)
- path: scene-verse/
name: Verse and canon in scenes
package: scene-verse
version: 2.0.0
description: Verse and canon on scenes, and +scene/verses (requires scene)
37 changes: 37 additions & 0 deletions radio-config/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
format: "1.20"
package: radio-config
title: "Radio: +config settings"
version: 1.0.1
authors: [SharpMUSH]
description: "Puts the Radio settings into +config: registers them with the +config registry, so staff see and change them with +config radio."
license: MIT
homepage: https://github.com/SharpMUSH/SharpMUSH.Packages
keywords: [radio, config, bridge]
category: Community
bridge: true
requires_server: ">=1.0"
verified_server: "1.0"

# A bridge: it joins two packages that do not know about each other. radio declares its settings as
# DATA`CONFIG`<NAME>, with their types and limits, and reads them with get() whether or not +config is installed.
# This package is the one leaf that tells the +config registry where they are.
depends:
- package: radio
version: ">=1.5"
source:
repo: https://github.com/SharpMUSH/SharpMUSH.Packages
path: radio/
branch: main
- package: plus-config
version: ">=1.0"
source:
repo: https://github.com/SharpMUSH/SharpMUSH
path: examples/packages/plus-config/
branch: main

objects:
- ref: config_registration
target: "{{plus-config/registry}}"
attributes:
SYSTEM`RADIO: |-
{{radio/radio}}
46 changes: 46 additions & 0 deletions radio-help/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
format: "1.20"
package: radio-help
title: "Radio: +help topics"
version: 1.1.1
authors: [SharpMUSH]
description: "Puts the Radio topics into +help: registers the radio package's help with the +help librarian, and points its messages at +help."
license: MIT
homepage: https://github.com/SharpMUSH/SharpMUSH.Packages
keywords: [radio, help, bridge]
category: Community
bridge: true
requires_server: ">=1.0"
verified_server: "1.0"

# A bridge: it joins two packages that do not know about each other. radio keeps its topics on its own help
# object, and plus-help reads any object registered with its librarian. This package is that registration, and the lines that point its messages at +help;
# uninstalling it takes the topics out of +help, and neither package changes.
depends:
- package: radio
version: ">=1.6"
source:
repo: https://github.com/SharpMUSH/SharpMUSH.Packages
path: radio/
branch: main
- package: plus-help
version: ">=1.0"
source:
repo: https://github.com/SharpMUSH/SharpMUSH
path: examples/packages/plus-help/
branch: main

objects:
- ref: help_registration
target: "{{plus-help/librarian}}"
attributes:
SRC`RADIO: |-
{{radio/radio_help}}

# Lines the radio package's messages end with when +help is here, through its FUN`HINT: HINT`<message>.
- ref: message_hints
target: "{{radio/radio}}"
attributes:
HINT`SWITCHES: |-
+help radio lists them.
HINT`USAGE: |-
+help radio lists the rest.
127 changes: 127 additions & 0 deletions radio-scene/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
format: "1.20"
package: radio-scene
title: "Radio in scenes"
version: 1.4.3
authors: [SharpMUSH]
description: "Radio in scenes: +radio/log puts what a player hears on a frequency into the scene they are in. Joins the radio and scene packages through a tap on the radio feed kind."
license: MIT
homepage: https://github.com/SharpMUSH/SharpMUSH.Packages
keywords: [radio, scene, logging, feed]
category: Scenes
bridge: true
requires_server: ">=1.0"
verified_server: "1.0"

# +radio/log writes poses through the Scene plugin, so it installs only while the plugin runs.
plugins: [scene]

# Neither package knows about the other. The radio keeps frequencies and who hears them; the scene
# package keeps scenes and their poses. This one listens to the radio's feed and writes into scenes.
depends:
- package: radio
version: ">=1.3"
source:
repo: https://github.com/SharpMUSH/SharpMUSH.Packages
path: radio/
branch: main
- package: scene
version: ">=1.5"
source:
repo: https://github.com/SharpMUSH/SharpMUSH
path: examples/packages/scene/
branch: main

objects:
# The logger: a tap on the radio feed kind, and the /log and /stoplog switches of +radio. WIZARD because
# it reads the WIZARD radio's attributes and adds poses to other people's scenes.
#
# DATA`PLAYER`<key>`LOG`<id> a player logs frequency <id> into the scene they are in; <key> is the
# radio's FUN`KEY for them, so it matches the radio's own settings
- ref: radiolog
type: thing
name: Radio Scene Log
flags: [WIZARD]
attributes:
# A tap on the radio kind, queued once per line after it is delivered. It reads the line by name (help
# @feed taps): feed is radio/<id>, recipients who heard it, speaker, style, text, and name the
# alterego. A listener who logs this frequency
# and is in a scene gets the line into that scene, drawn as they heard it, once per scene however
# many people in it are logging. It is recorded as the radio type, with the frequency's name in the
# pose's frequency field, which the portal shows in the message's header.
TAP`LOG: |-
think setqm(tap_frequency,after(%<feed>,/),
tap_scenes,,
tap_pairs,)[iter(%<recipients>,if(u({{radiolog}}/FUN`LOGS`INTO,%i0),setqm(tap_scenes,%q<tap_scenes> %q<tap_scene>,
tap_pairs,%q<tap_pairs> %q<tap_scene>~%i0)))]; @dolist/inline %q<tap_pairs>={@scene/addpose [before(##,~)]=[after(##,~)],[scenemember(before(##,~),after(##,~),showas)],[loc(after(##,~))],radio,emit,,[uargs({{radio/radio}}/FUN`LINE,frequency,%q<tap_frequency>,speaker,%<speaker>,name,firstof(%<name>,name(%<speaker>)),style,%<style>,text,%<text>,reader,after(##,~))]; @scene/setpose [last(sceneposes(before(##,~)))]/frequency=[u({{radio/radio}}/FUN`NAME,%q<tap_frequency>)]}
# %0 a listener: 1 when they log %q<tap_frequency>, their scene (left in %q<tap_scene>) is new or active, and no
# one before them put the line into it. A paused scene records nothing until +scene/start resumes it,
# though the player's focus stays on it.
FUN`LOGS`INTO: |-
cand(hasattr({{radiolog}},DATA`PLAYER`[u({{radio/radio}}/FUN`KEY,%0)]`LOG`%q<tap_frequency>),not(strmatch(setr(tap_scene,scenefocus(%0)),#-*)),not(match(paused finished cancelled,scene(%q<tap_scene>,status))),not(member(%q<tap_scenes>,%q<tap_scene>)))

# +radio includes these with its registers: %q<cmd_left> the frequency as typed, %q<viewer_key> the player's
# key and %q<extension_object> this object; INC`NEED`JOINED sets %q<frequency_id>. The radio is the executor
# while they run, so they name it %! and this object %q<extension_object>: a {{ref}} is looked up on the
# executor, and the radio holds none of this package's.
# /log <frequency> starts logging it into the player's scene; /log alone lists what they log.
INC`LOG: |-
@assert strlen(%q<cmd_left>)=@include %q<extension_object>/INC`LOGGED; @include %!/INC`NEED`JOINED; @assert not(strmatch(scenefocus(%#),#-*))=@pemit %#=notice(RADIO,Join a scene first: what you hear is logged into the scene you are in.,warn); &DATA`PLAYER`%q<viewer_key>`LOG`%q<frequency_id> %q<extension_object>=1; @pemit %#=notice(RADIO,What you hear on [u(%!/FUN`NAME,%q<frequency_id>)] goes into your scene until +radio/stoplog.,ok)
INC`STOPLOG: |-
@include %!/INC`NEED`JOINED; @assert hasattr(%q<extension_object>,DATA`PLAYER`%q<viewer_key>`LOG`%q<frequency_id>)=@pemit %#=notice(RADIO,You are not logging [u(%!/FUN`NAME,%q<frequency_id>)].,warn); &DATA`PLAYER`%q<viewer_key>`LOG`%q<frequency_id> %q<extension_object>; @pemit %#=notice(RADIO,[u(%!/FUN`NAME,%q<frequency_id>)] is no longer logged into your scene.,ok)
# The frequencies the player logs that still exist.
INC`LOGGED: |-
think setq(logged_ids,squish(iter(lattr(%q<extension_object>/DATA`PLAYER`%q<viewer_key>`LOG`*),if(hasattr(%!,DATA`FREQUENCY`[last(%i0,`)]`NAME),last(%i0,`))))); @assert words(%q<logged_ids>)=@pemit %#=notice(RADIO,You log no frequency into your scene. +radio/log <frequency> starts.); @pemit %#=notice(RADIO,Logged into your scene: [itemize(iter(%q<logged_ids>,u(%!/FUN`NAME,%i0),,|),|)].)

# Taps are stored, so this only puts the tap back after the radio kind was undefined and defined again.
STARTUP: |-
@feed/tap radio={{radiolog}}/TAP`LOG
AINSTALL: |-
@trigger {{radiolog}}/STARTUP

# The radio pose type, on the Scene Logger beside the scene package's own (see TYPE` there): a message in
# the portal, in the info colour, with the radio icon; in a terminal one line tagged with the scene,
# <RADIO · 12>, in the reader's info colour. Uninstalling this package takes it away, and radio
# lines already recorded then read as in character.
- ref: scene_type_radio
target: "{{scene/logger}}"
attributes:
TYPE`RADIO: |-
{"label":"Radio","presentation":"message","tone":"info","icon":"radio","order":40}
TYPE`RADIO`FORMAT: |-
tone(info,<RADIO[if(strlen(%3),%b[chr(183)] %3)]> %2)

# +radio/log and /stoplog: the radio runs INC`LOG and INC`STOPLOG on the logger. Uninstalling this
# package takes them away again.
- ref: radio_switches
target: "{{radio/radio}}"
attributes:
EXT`LOG: |-
{{radiolog}}
EXT`STOPLOG: |-
{{radiolog}}

# The +help topics go into the radio's and the scene package's own help, so +help radio and +help scene
# list them as subtopics. Attached, so uninstalling this package takes them away again. Bodies are
# evaluated, so brackets, parentheses and percent signs are escaped.
- ref: radio_help_log
target: "{{radio/radio_help}}"
attributes:
SEE`RADIO`LOG: |-
scene radio
HELP`RADIO`LOG: |-
What you hear on a frequency can go into the scene you are in, so the log shows the calls that came in while you played.

- `+radio/log <frequency>` puts everything you hear on that frequency into your scene, until `+radio/stoplog <frequency>`.
- `+radio/log` lists the frequencies you log.

You must be tuned in to the frequency and in a scene. While your scene is paused nothing is logged into it, radio included, until `+scene/start` resumes it. A line goes into a scene once, however many people in it are logging, and it reads the way the first of them heard it. Logging lasts until you stop it: when you move to another scene, what you hear goes there instead.

- ref: scene_help_radio
target: "{{scene/scene_help}}"
attributes:
SEE`SCENE`RADIO: |-
radio log|radio
HELP`SCENE`RADIO: |-
A frequency you are tuned in to can be logged into your scene: `+radio/log <frequency>` starts, `+radio/stoplog <frequency>` stops, and `+radio/log` lists what you log.

Each line goes into the scene once, under the name of the first person in it who logs that frequency, drawn the way they heard it. Radio lines are their own pose type, `radio`, so `+scene/hide radio` leaves them out of your recall and log. See `+help radio log` for the rest.
Loading
Loading