Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Save to pure data format

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

  • A twine story format is made up of two main parts, the data (the story passages), the javascript engine that processes the data when you open the built/published HTML file in a web-browser.

    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.
  • ChronoDK wrote:

    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?


    With Twine 1 you can export to Twee code, which is just the most basic information (a list of passage names and passage contents).
  • Thank you, both of you - the Twine 1 export to Twee is exactly what I need. Would have liked to use Twine 2 (web-based editor, yay), but Twine 1 should do just fine.
  • Doesn't Twine 2.0 have something similar?

    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.
  • I haven't tried it, but it depends on whether it just prints the text, or includes headers and syntax. I assume that as long as links are shown as links in the proofing copy, you could use it as a dialogue map for another program.
  • It's just the raw text, including markup. Basically a one-page version of the entire collection of passages as they read in the editor.
  • Claretta wrote:

    It's just the raw text, including markup. Basically a one-page version of the entire collection of passages as they read in the editor.

    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.
  • Check out TwineJson: https://github.com/cauli/TwineJson

    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
Sign In or Register to comment.