Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

Click and Append in Twine 2, Sugarcube 2

$
0
0
I used Twine 2 + Sugarcube 2 for Ludum Dare over the weekend, and ran into a problem with <<click>> and <<append>>.

My goal is to show a conversation unfold, where each paragraph ends with a clickable > that adds the next line of the conversation below it. I was able to get this 95% working with <<click>> and <<append>>. The problem is that you can click the > multiple times and get the text to repeat down the page. I tried nesting a <<remove>> in the <<click>> but it didn't seem to work because the <<click>>s themselves are nested--so removing the first also removes the code that makes subsequent <<click>>s work.

Is there an easier way to accomplish this? Here's a sample of how I have it implemented without the <<remove>> (the version that repeats text if you click > more than once).

Thanks!

"It's ugly as sh..." The girl begins but a hissed "Iris!" from her mother cuts off the profanity midway.<<click " >">>
<<append "#conv1">>"Can I look around?" the boy asks, and he's already looking through the doorway into the small downstairs bathroom. <<click " >">>
<<append "#conv2">>"Yes, but we won't be here long today. This is just to see if there's anything we need to fix or replace before we move in next week."<<click " >">>
<<append "#conv3">>The boy pelts upstairs immediately. The mother looks at Iris, then smiles. "Check the downstairs with me?"<<click " >">>
<<append "#conv4">>Iris shrugs. "Sure." The pair walk into the living room together. You [[watch|DFoyer P1_T1]] them leave.
<</append>><</click>>
<</append>><</click>>
<</append>><</click>>
<</append>><</click>>

<span id="conv1"></span>
<span id="conv2"></span>
<span id="conv3"></span>
<span id="conv4"></span>

Viewing all articles
Browse latest Browse all 1844

Trending Articles