SugarCube Syntax Highlighting Workflow

I just got started with Twine recently and tried all the story formats. However, I went back to Harlowe because I preferred the syntax highlighting and working entirely in the Twine editor. I’m actually quite happy with Harlowe and will finish my project with it, but I just have to ask…

If I want to code with SugarCube and have syntax highlighting, is it really a matter of copying and pasting back and forth between Twine and Notepad++? Is there something that I’m missing? Is there a better way?

It comes at the sacrifice of working directly in the Twine editor, but you can use VSCode and the T3LT extension to get syntax highlighting with Sugarcube.
The VSCode combo also works well for Harlowe (from what I’ve heard, I don’t personally use it), so if you switch formats, it’s not like you have to deal with things living two places.


So any way I slice it, I have to copy and paste between Twine and a code editor? Just making sure I’m understanding things fully.

Are there any pitfalls I should keep in mind when coding this way?

The funny thing is, I always thought that Twine auto-saving the whole story file after every little keystroke was going to burn a hole in my hard drive one day. Working in another editor definitely fixes that concern. :wink:

Oh, and thanks for those links, Jinx!

1 Like

Nope, no copy-pasting needed! You use the Tweego compiler to compile your work from VSCode into an html file (same end product as when using the Twine editor). I use the editor, so I’m not sure of all the details, but @manonamora has this very helpful guide to installing and using (and, according to a little birdy, her itch has some very solid UI templates with a handy VSCode/Tweego guide included) :wink:


Would opening the Twine file up in VSCode be useful?

What I am thinking here is creating the game in Twine as normal, but then checking the file later. This would be the raw data file, not the output file. I already do this to spell check, opening the file in Notepad++. I can edit it directly, save it and then go back to it in Twine later. If I could also do similar with VSCode to check syntax that would be great.