How to create a passage that adds content as user clicks options

Hey everyone! I’m exceptionally new to Twine and I cannot for the life of me find what I’m looking for in a search. Here’s what I’d like to accomplish:

  • Passage prints some content with some clickable links
  • User clicks on one of the links
  • The passage continues printing info, appending it to what was already printed

I wanted to do this within a passage instead of continuing to another so smaller or linked decisions could be shown on screen at once before leaving the scene. I was hoping to find something like a “pause” macro, or an “onclick” type of thing, but I’m having no luck.

Thank you in advance for your help and guidance!

I think @HiEv actually answered this exact same question (though worded slightly differently) just yesterday.

1 Like

Thank you for the reply! I don’t have the slightest idea about JavaScript. Is the answer here that Twine and/or SugarCube doesn’t do what I want, and the only way to accomplish it is to code in JavaScript?

I’m looking for something that is super-light on programming, which is why I was drawn to Twine in the first place. I don’t have the headspace for programming right now, just wanted to focus on the storytelling aspects and was hoping Twine would be a light-weight way of bringing it to life.

Thanks again for the response!

Yep. That’s exactly right, unfortunately. I don’t think there are any standard story formats that do want you want anymore. I believe Jonah was for Twine 1 and used to do that (that’s what the story My Father’s s Long, Long Legs used).

There is this one story format called Paloma that does Jonah style stretch content for Twine 2, but it’s based off of Snowman, not SugarCube. If you’re not familiar, Snowman is the barest bone story format, which is basically just link markup. There’s not even a save system. Everything has to be implemented through Javascript, so again you’d be at the mercy of JS.

Anyway… That’s the situation.

1 Like

Sorry, I misinterpreted your question in my previous answer.

This is a quick and dirty way to do something like you want:

Some text.

<<link 'Add more text' 'Passage1'>>
	<<set $showText += 1>>
<</link>>


<<if $showText >= 1>>
Some more text.

<<link 'Add even more text' 'Passage1'>>
	<<set $showText += 1>>
<</link>>
<</if>>

<<if $showText >= 2>>
Even more text.
<</if>>
  • Passage1 is the name of the passage where the code above is on, so when you click the link it reloads the current passage after updating the variable

You just have to initialize the $showText to 0 on a previous passage (make sure not to set it to 0 on the passage with the code above or once you run the goto it will reset it!)

It’s not perfect since you are actually reloading the current passage once you click the links, but it tecnically doesn’t go to a different passage and adds more text as you click them so…

Let me know if it works as you need it or if you have any questions.

1 Like

This is interesting. It effectively creates a loop by linking to itself. I might give this a test and see if it accomplishes what I’m going for. Thank you!

I just wanted to add that you don’t need to know how to code to add the code Tayruh linked to above. It really is just copy-and-paste from my answer there, and then it will work for you.

If you have any problems with it, just let me know and I’d be glad to help out. :slight_smile: