Howdy, Stranger!

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

How safe is it to combine two story files by pasting tw-passagedata from one into the other?

edited July 2015 in Help! with 2.0
So one thing I really like about Twine 1.4.n is its increasing capacity to contain so many assets in the final HTML file. With Twine 2, I’m learning to import images and fonts as data, and to take advantage of some of the latest Harlowe features to use several style-sheets across a single story with the flick of a variable.

But I always write my twines both in English and Spanish, and Twine 1’s <<include>>s were really great for that. When I finished a project I would copy the file, translate the copy, and include the translation in the original, so the final HTML file contained both languages. It was neat.

With Twine 2, I found I can duplicate a story, translate it, export both, copy every <tw-passagedata> tag from one file and paste it into the original, and the result seems to work: a single file with both versions (an originally broken link will perfectly direct to an accordingly named passage from the other file). I can then import the resulting file, the only problem being the passages’ positions on the node map.

So I actually have two questions:

1) Is there any terrible side-effect I’m not considering with this approach that will make Twine react against it (like maybe the story knows how many passages I exported so it might break if the file now has a “passage surplus”)?

2) Is there any more or less practical way to adjust the translated passages’ position so they don’t overlap the old ones?

Comments

  • 1) The one thing I can think of that is not-quite-good, but should not pose a problem is that every <tw-passagedata> element has a pid attribute that should be unique. The only time that I think story formats care about this is that the <tw-storydata>'s startnode property references this.

    2. Offhand, I'd look at tweaking the passage attributes before you re-insert them. They're stored in the position attribute of the <tw-passagedata> elements. It really depends on what tools you're used to.
  • 1) Great!

    2) It didn’t even occur to me that there must be editors that semi-automatically edit a given element’s properties. I’ll look into it. (Another possible solution would be to select every translated passage on the editor, before exporting, and dragging them to the right so they don’t overlap their original position, but I haven’t found dragging Twine passages to have a very predictable behavior just yet.)
Sign In or Register to comment.