2 min read

Creating a single continuous passage in Twine

I'd like to set up a Twine game that works like this:

  1. The game starts with a complete passage (passage 1) of text ending with a fork.
  2. Now say you're in a passage, call it passage X. At the start X = 1.
  3. X has a fork at the end.
  4. X has some other text after the fork, but it won't display yet.
  5. You pick one of the choices at the end-of-passage fork.
  6. Once you pick a choice, the fork disappears and is replaced by the continuation of the appropriate passage — call that passage X+1.
  7. That is: The text from passage X remains visible.
  8. If X included any text after the fork, it should appear now after the embedded passage X+1.
  9. Go back to step 2.

This seems tricky to do in Chapbook. In a normal story you click a link and it takes you to passage X + 1, leaving X behind. Or you embed the next passage in the previous one, or you reveal-link X to X + 1.

I tried two approaches and neither worked. Using a fork with content after it didn't do what I meant. Using a manually-constructed fork with JavaScript to move things around was too much work.

First, I tried using a fork in the middle of a passage using multiple lines like > {reveal link: "text", passage: "some passage"}. This doesn't work. Everything after the fork appears before you click the fork.

Second, I tried manually constructing a fork. I made a <div style="text-align: center" id="fork1"> with a few reveal-links inside it separated by <hr>. I then embedded in the options a passage of JavaScript that manually finds and removes the div. This works, mostly, but it's a pain to construct each fork. It also doesn't allow you to consrtuct

There are two options that might work anyway. The first a chunk of SugarCube 2 code called Click to Proceed. The other is by combining reveal links with "manually delete fork," compromising a little on the details.

I won't say anything about Click to Proceed as I didn't try it, but it sounds like roughly the right thing.

In retrospect, I think reveal links plus manually deleting forks mostly handles this. I would have to give up on revealing text after the fork, but that's okay. Twine does not include a "Find Text" facility or other ways of navigating a passage, so it seems best to keep passages relatively short. Keeping things short means you wouldn't want to do that anyway.

The idea here is to use reveal links inside a fork to embed the next passage. Each next-passage also embeds, at the top, a separate passage that deletes the first fork if there are multiple. This should work with Twine's default fork HTML so that one can use the > -style forks and avoid manually writing HTML in a passage.

This is probably good enough. It's still more work than seems worthwhile to me. I'm giving up and giving in to the default setup of navigating to a new passage for every choice. It's so much easier to go with the workflow the tool was designed for. (Imagine.)