Add-ons / <<checkvars>> Macro

Creates and opens a debugging dialog which displays the current state of the story's $variable store (State.variables).

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 checkvars.zip

Index

Overview

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

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

Notice: This package is intended for use with SugarCube and will not work with other story formats.

Installation

JavaScript

  1. Open the checkvars-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: a script-tagged passage.
    • Twine 2: Story JavaScript.

Stylesheet

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

📝 Note: Use only one of the included style sets.

Macros

<<checkvars>>

<<checkvars>>

Syntax: <<checkvars>>

Creates and opens a debugging dialog which displays the current state of the story's $variable store (State.variables).

📝 Note: The StoryMenu special passage is a good location to place this during debugging. It is not recommended to leave it available in production builds.

Arguments: none.

Usage:

→ Creates a link which opens the dialog
<<click "Check Vars">><<checkvars>><</click>>

Live demo

Demo Twee code:

:: Start
<<link "Show check vars.">><<checkvars>><</link>>