Grammar
Player input parsing.
Run a script defined action.
The action will be parameterized with the actor performing the action,
and up to two other nouns. The actor is always the player's,
the nouns are whichever were matched by [Noun].
This command usually appears last in a series of sub-scanners,
after all of the earlier scanners have successfully matched.
Select a specific set of bounds for the scanner to use when matching nouns.
Currently, the set of scanners is defined in golang,
and cannot be extended by script.
They are:
see: https://pkg.go.dev/git.sr.ht/~ionous/tapestry/support/play#Survey
Attempt to find a noun matching one or more words
entered by the player. Out of all the nouns in a game world
the specific nouns matched will, by default, depend on what
objects are visible to the player.
The kind of the noun that should be allowed to match.
Most often this is the most generic kind: "objects".
That allows the action to respond to the player
when an unexpected or undesired noun was entered.
Attempts to match exactly one of its sub-scanners.
Its sub-scanners are evaluated in the order listed;
stopping after the first successful match has occurred.
A series of other scanners to match.
Match text exactly as typed by the player.
To match two words that must appear together
use a [Sequence] containing two separate word commands.
For example, to match the phrase "take off", use:
One or more synonyms to match.
Only the first word matched will be used.
For example: "pluck", "pick", "strum"
would match either "pluck the guitar",
or "strum the guitar".
Uses the last noun in a series of sub-scanners as a source
for finding for the first noun in the series.
For example, in the phrase "take book from table"
if there was one book on a table, and many books on a bookshelf,
refine would ensure that the book on the table was selected.
Assuming that the first and last sub-scanners in a set
match nouns, reverse the order of those nouns when sending
them to an action.
Require that all of its sub-scanners match.
A series of other scanners to match.
Definitions:
Slots:
Commands:
Commands
Slots:
Terms:
Slots:
Terms:
Focus:
Text
sequence:
ScannerMaker
repeats
Slots:
Terms:
noun:
Text
Slots:
Terms:
of:
ScannerMaker
repeats
Sequence:
- One word: "take"
- One word: "off"
Slots:
Terms:
word:
Text
repeats
Slots:
Terms:
sequence:
ScannerMaker
repeats
Slots:
Terms:
Reverse:
ScannerMaker
repeats
Slots:
Terms:
Sequence:
ScannerMaker
repeats