Tapestry
Source Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Grammar

Player input parsing.

Definitions:

Slots:

Commands:

  • Action:[args:] Run a script defined action.
  • Focus:sequence: Select a specific set of bounds for the scanner to use when matching nouns.
  • One noun: Attempt to find a noun matching one or more words entered by the player.
  • One of: Attempts to match exactly one of its sub-scanners.
  • One word: Match text exactly as typed by the player.
  • Refine sequence: Uses the last noun in a series of sub-scanners as a source for finding for the first noun in the series.
  • Reverse: 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.
  • Sequence: Require that all of its sub-scanners match.

Commands

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.

Slots:

Terms:

Action: Text

Name of the action. See also: [DefineAction].

args: optional Arg repeats

Optional additional arguments to pass to the action.

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:

  • "" - the empty string for the current locale ( the default bounds )
  • "compass" - for nouns of kind "directions" ( north, east, etc. )
  • "player" - for the player's inventory
  • "debugging" - for all objects of kind "objects"

see: https://pkg.go.dev/git.sr.ht/~ionous/tapestry/support/play#Survey

Slots:

Terms:

Focus: Text
sequence: ScannerMaker repeats

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.

Slots:

Terms:

noun: Text

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.

Slots:

Terms:

of: ScannerMaker repeats

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:

Sequence:
  - One word: "take"
  - One word: "off"

Slots:

Terms:

word: Text repeats

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.

Slots:

Terms:

sequence: ScannerMaker repeats

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.

Slots:

Terms:

Reverse: ScannerMaker repeats

Require that all of its sub-scanners match.

Slots:

Terms:

Sequence: ScannerMaker repeats

A series of other scanners to match.