Twine Analyzer
KDocumentationTools
KDocumentationTools
The Twine Analyzer is a Twine HTML parser that lets you visualize, select, and export passages to other formats. It requires that your Twine stories follow specific Syntax for the parsing to work.
The Twine Analyzer exists as a main screen plugin you can swap to at the top of Godot's editor window. Twine analyses can be opened in 3 ways in a Godot project:
Create a new KDTTwineAnalysis resource. Double-clicking any resource will open a Twine analysis that also saves the Twine HTMLs you import into that resource.
Right-click a Twine HTML file and select at the bottom of the context menu "View In Twine Analyzer". This will create a temporary Twine analysis that does not save any data.
The TwineAnalysisWidget can be embedded inside of a Board which can link to either a KDTTwineAnalysis resource or Twine HTML file. Opening a resource will save data, opening a Twine HTML will be temporary and not save anything.
The Twine Analyzer plugin provides a few quality of life features to make coordinating between Godot and Twine easier. Twine must be installed for this to work.
You can open a Twine HTML file in Twine from Godot by right-clicking the HTML file and selecting "Open In Twine" at the bottom of the context menu. This will automatically open Twine with the library folder set the location of the HTML file, allowing it to be selected without having to manually set the library folder every time Twine is opened.
If you want to create a new Twine HTML in a specific folder, you can right-click the folder and select "Open Twine Here". This will open Twine with the library folder set to the location so any new stories will be automatically created in your chosen folder.
View multiple Twine stories at the same time. Use the "Show" and "Scope" buttons to set what stories are visible and considered when searching for text. Hold Ctrl to multiselect.
Use the search box to find passages that contain certain text. By default, all story passage names and passage texts are considered. To limit seach scope:
Set the story scope using the "Scope" button.
Begin your query with "n" followed by a space to only search passage names.
Begin your query with "t" followed by a space to only search passage text.
You can selectively view passages via the Script panel by selecting any number of passage nodes in the graph view. The passages will be populated in tree order so they can be read linearly. You can select a node and all of it's parents by Shift-clicking a node.
The Info panel provides summarized information about imported stories. This panel is also used to remove stories from the analyzer.
The built-in exporter panel allows you to export your selected passage nodes into various formats.
Adjacent to the Twine Analyzer tab is a shortcut to open the Batch Exporter.
Automatic refresh when returning to the Godot editor or refocusing the Twine Analyzer panel.
CsvLines - Export all lines from selected passages for the selected characters CSV files.The data is formatted as Line,Speaker,Receiver,Direction. A line is considered any text that is not enclosed in Syntax.
Script - Exports the selected passages as a text file with script formatting, removing all parsing syntax and adjusting text like a screenplay (all text is still left aligned unlike the Script view in the Twine Analyzer).