He was startled awake by the sound of his phone alarm. The harsh tone blared as <<linkappend 'he fumbled to turn it off.'>>
After a few tries, he managed to stop the alarm. He squinted at the time.
<<linkappend '"Hnng…is it seven already…?"'>>
More text here.<</linkappend>><</linkappend>>
Nesting a lot of them can get unwieldy, though. Another thing you can do is break up the text into various passages and use the <<include>> macro:
:: passage1
He was startled awake by the sound of his phone alarm. The harsh tone blared as <<linkappend 'he fumbled to turn it off.'>>
<<include passage2>><</linkappend>>
:: passage2
After a few tries, he managed to stop the alarm. He squinted at the time.
<<linkappend '"Hnng…is it seven already…?"'>>
<<include passage3>>
<</linkappend>>
Thank you so much. That worked. I am unfamiliar with how the macros work so that was really helpful. I actually tried doing it manually via jquery, which was actually insane.
This is a related question, but do you know if there’s a macro that would make it so I have to click X number of times before the link append triggers?
There’s no macro to do that, but you can do something like this:
<<set _i = 0>>
<span class="foo">
<<link "Click this three times.">>
<<set _i++>>
<<if _i >= 3>>
<<replace .foo>>
Click this three times.
More text.
<</replace>>
<</if>>
<</link>>
</span>
That said, I’d recommend against doing this. If I’m playing a game and nothing happens when I click a link, I’m probably going to assume it’s a bug and close the game. I don’t doubt that others would do the same.
I actually intended on triggering some kind of visual response until the third click. I haven’t figured out how to do that kind of thing, but for example, the link shifts visually to the right.
I see what you mean though. It would be misleading without an obvious interaction response that signals you should keep clicking.
Our if curiosity, can you also nest <<linkreplace>>? I assume it works the same as append?