Add-ons / <<bugreport>> Macro

Creates and opens a bug report dialog which includes various state information.

Author Thomas M. Edwards
Website http://www.motoslave.net/sugarcube/2/#downloads
Story format SugarCube 2
Last checked Sun Nov 27 2022
License BSD 2-Clause "Simplified" License
Download bugreport.zip

Index

Overview

SugarCube is a free (gratis and libre) story format for Twine/Twee.

This documentation is a reference for the <<bugreport>> macro set for SugarCube, it assumes at least a passing knowledge of SugarCube macros.

Requirements

This package requires SugarCube v2.19.0 or greater.

Installation

JavaScript

  1. Open the bugreport-macro.min.js file in a text editor (not a word processor) and copy its contents.
  2. Paste them into your project's script section:
    • Twine 1: script-tagged passage.
    • Twine 2: Story JavaScript.

Stylesheet

  1. Open either the bugreport-macro.css or bugreport-macro-bleached.css file in a text editor (not a word processor) and copy its contents.
  2. Paste them into your project's stylesheet section:
    • Twine 1: stylesheet-tagged passage.
    • Twine 2: Story Stylesheet.

Macros

<<bugreport>>

<<bugreport>>

Syntax: <<bugreport [passageName]>>

Creates and opens a bug report dialog which includes various state information.

Arguments:

Usage:

→ Creates a link which opens the bug report dialog
<<link "Create Bug Report">><<bugreport>><</link>>

→ Creates a link which opens the bug report dialog, displaying the
  passage "Bug Report Instructions"
<<link "Create Bug Report">><<bugreport "Bug Report Instructions">><</link>>

Report format

The report generated by <<bugreport>> consists of four parts:

  1. SOURCE: The filename of the story. Most useful if you include the story's version in it (e.g. mirror-mirror-v3.html).
  2. PASSAGES: The ordered list of passages traversed up to the passage where the report was generated.
  3. VARIABLES (PRE-EXECUTION): The story's variable store as it existed before the execution of the passage where the report was generated, shown as the difference between the previous passage's pre-execution state and the current passage's pre-execution state.
  4. VARIABLES (POST-EXECUTION): The story's variable store as it exists after the execution of the passage where the report was generated, shown as the difference between the current passage's pre- and post-execution states.

The report proper is enclosed within spoiler and code tags, common to many forum software packages, and will look something like the following:

[spoiler][code]
SOURCE: mirror-mirror-v3.html

PASSAGES:
"Start", "Follow that rabbit"

VARIABLES (PRE-EXECUTION):

VARIABLES (POST-EXECUTION):
$seenRabbit=true
[/code][/spoiler]

Live demo

Demo Twee code:

:: Start
<<link "Show bug report.">><<bugreport>><</link>>