Hi,
I'm looking into creating a visual novel type game, and I'm thinking Twine would be an awesome editor for the text. I'm coding my own game engine though, so I really need the text passages exported to a simple data format that I can create my own parser for. Would that be possible with Twine? Or perhaps there is a parser that can convert the HTML output to something like Snowman or another comprehensible format?
Comments
You could either create your own story format contain just the twine data, create a story format containing the data and your javascript engine, or if using Twine 1 export the story project as a TWEE file and process the passages yourself.
With Twine 1 you can export to Twee code, which is just the most basic information (a list of passage names and passage contents).
If you go down to the menu in the bottom left, you'll see a "view proofing copy" option. You can then copy paste that output.
The "raw text" is wrapped in HTML (like the <tw-passagedata> tag) which would possible need to be ignored / removed if you wanted to process the contents of the proofing copy.
I also recommend that you check out Yarn. It has a built-in JSON exporter, but it is only plain data (no inheritance).
It is a Twine-like editor https://github.com/InfiniteAmmoInc/Yarn