0 votes
by (280 points)
edited by
Hi,

I wanted to shift from Twine2 to Twee2 for more flexibility via command line. However, my entire story built with Sugarcube v2.25.0 in Twine2 looks totally different when translated into Twee2, because the compiler ignores many of the special passages that Twine2 still considers, including the StoryInterface, which is meant to properly replace the entire UI.

Someone so kind to help on this?

thank you

2 Answers

0 votes
by (2.7k points)
edited by

Does twee2 support Sugarcube in that version?

twee2 formats

And did you specify the correct storyformat via parameter --format SugarCube2

by (280 points)
edited by

in twee2 I've added the following string, which supposed to allow using SugarCube2 

Twee2::build_config.story_format = 'SugarCube2'

As of the version, I think I am using locally this 2.24.0 version after installation

However, most of the special passages are totally ignored, resulting in an inconvenient adoption of Twee2 for me.

----------------------------------------

EDIT: by using this 

Twee2::build_config.story_format = 'abs path to latest Sugarcube2 story format'

I've got everything back to work (except the use of some special passages, but I will find a workaround for them) . Thanks!

by (2.7k points)
I am not so familiar with the different parts of the whole Twinery family.

But I downloaded/ installed twee2 recently and was able to put an actual version of Harlowe2 in the right place, so that

twee2 formats

typed in on commandline listed the actual version instead of the included.

Per default only these formats are listed in my twee2 0.50.0:

$ twee2 formats
WARNING: Nokogiri was built against LibXML version 2.9.7, but has dynamically loaded 2.9.8
I understand the following output formats:
 * Harlowe (1.2.2)
 * Paperthin (1.0)
 * Snowman (1.3.0)
 * SugarCube (1.0.34)
 * SugarCube2 (2.7.0)

so what sugarcube2 is shown in your twee2 installation?
0 votes
by (159k points)
edited by

The Twee2 compiler comes with SugarCube v2.7.0 pre-installed and the StoryInterface special passage was added in v2.18.0, this is why that special passage isn't working with you build and view your HTML file.

note: It is the story format engine that knows what to do with this special passage, the compiler is generally only responsible for embedding the relevant Passages within the story format's template to produce the HTML file. In the case of Twee2 it does interpret some of the contents of specific Passages to determine some of it's own settings.

The following steps describe how you upgrade your version of SugarCube to the latest version.

1. Determine where Twee2 installed it's SugarCube2 story format folder.

You start with using the following (ruby) gem command to location the Twee2 installation...

gem which twee2

... this should result in a file path similar (but not exactly the same) to the following.

C:\Ruby23-x64\lib\ruby\gems\2.3.0\gems\twee2-0.5.0\lib\twee2.rb

... and the part you are interested in is..

C:\Ruby23-x64\lib\ruby\gems\2.3.0\gems\twee2-0.5.0\

The above location should contain a storyFormats folder and within that one you will find the SugarCube2 folder.
 

2. Download the latest version of SugarCube 2 from the Downloads section of it's site, you want the compiler related release which should be named something like

For Twine 2.2, Twine 2.1, & Tweego (local/offline) [ZIP archive]

Once you have extracted the contents of this archive file onto your local hard-drive you should have a folder with a name like sugarcube-2.25.0-for-twine-2.1-local which in turn should contain a folder named sugarcube-2 and that folder should contain three files named:

format.js
icon.svg
LICENSE

... theses three files are what makes up the story format.

3. Copy the above three files into the SugarCube2 folder you located in step 1, this should overwrite the older v2.7.0 release of SugarCube2 that came with Twee2 with the latest version.

4. You can test that Twee2 is now using the latest SugarCube2 by first adding a StoryInterface special passage like the example in the SugarCube 2 documentation.

:: StoryInterface
<div id="passages"></div>

... and then using a twee2 command like the following to build your HTML file.

twee2 build my-story.tw2 my-story.html --format=SugarCube2

note: Obviously you will need to replace my-game part in the above with the actual name of your TW2 file.

5. Open the resulting HTML file in your text editor and look at the contents of the head element and you should see a comment that includes a line that starts with.

SugarCube (v2.25.0)

... and if you open the HTML file in a web-browser you should see that the standard SugarCube2 User Interface is now missing.

by (280 points)
Hi all,

thank you for the detailed explanation, very useful. Actually, by linking the latest SC2 story format.js I solved all my issues (see also my edited answer above). I'll mark this as solved

Thank you again

Best
...