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

Debug

Scripting commands to debug and test stories.

Definitions:

String Types:

Commands:

  • DoNothing: A runtime command that does.
  • Expect: Evaluate a boolean command and ensure it returns true.
  • Expect text: Examine the most recent game output, and generate an error unless it matches the specified text.
  • Fabricate input: Process fake input as if the player had typed it themselves.
  • Log:value: Print a value that might be useful during development.
  • Note:[level:] Print a message that might be useful during development.

String Types

Logging Level

Used with [DebugLog]. The options are:

  • "debug"
  • "info"
  • "warn"
  • "error"

Commands

A runtime command that does... nothing. ( Can be used to fill in branches ( ex. of if statements )

or rules which aren't supposed to do anything. )

Slots:

Terms:

None.

Evaluate a boolean command and ensure it returns true.

Slots:

Terms:

Expect: BoolEval

The boolean command. If the command returns false, the expectation will fail and the game will generate an error.

Examine the most recent game output, and generate an error unless it matches the specified text.

Slots:

Terms:

text: TextEval

The expected line or lines. If an expected line ends with ellipses "..." then only the first part of the line has to match.

For example, if the expectation was "Hello...", then the output "Hello World!" would match.

Process fake input as if the player had typed it themselves. Fabricate only works while running tests, and does nothing during normal game play. Multiple actions can be specified by separating them with semi-colons. For example:

Fabricate input: "s; jump; look"

Slots:

Terms:

input: TextEval

One or more actions to handle as if typed by the player.

Print a value that might be useful during development. It will be hidden from players in the final game.

Slots:

Terms:

Log: LoggingLevel

Importance of the message.

value: Assignment

Some text, or any other value, to display.

Print a message that might be useful during development. It will be hidden from players in the final game.

Slots:

Terms:

Note: TextEval

One or more lines of text documentation.

level: optional LoggingLevel