With Sugarcube 2, I'm using a variable to tweak a countdown timer, but the whole nature of a variable is being thrown about due to my limited knowledge of how the system I'm configuring might work.
Basically, I want something like this.
<<set $var to 10>>
Countdown: <span id="countdown">$var</span> seconds remaining!
<<silently>>
<<timed 1s>><<replace "#countdown">><<set $var -= 1>>$var<</replace>>
if $var is NOT zero, repeat the above line
if $var is zero, <<goto "Passage1">>
<</timed>>
<</silently>>
Instead, for ten seconds, I'm putting in something like...
<<timed 1s>><<replace "#countdown">><<set $var -= 1>>$var<</replace>>
<<next>><<replace "#countdown">><<set $var -= 1>>$var<</replace>>
<<next>><<replace "#countdown">><<set $var -= 1>>$var<</replace>>
<<next>><<replace "#countdown">><<set $var -= 1>>$var<</replace>>
<<next>><<replace "#countdown">><<set $var -= 1>>$var<</replace>>
<<next>><<replace "#countdown">><<set $var -= 1>>$var<</replace>>
<<next>><<replace "#countdown">><<set $var -= 1>>$var<</replace>>
<<next>><<replace "#countdown">><<set $var -= 1>>$var<</replace>>
<<next>><<replace "#countdown">><<set $var -= 1>>$var<</replace>>
<<next>><<replace "#countdown">>Too Late!<</replace>>
<</timed>>
See what I mean?
Any help would be greatly appreciated.
Comments
note: I moved the <<set>> from inside the <<replace>> to just before it because all you really want to be inserted into the target span is the result.