Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Can I make a timer count down across multiple passages? (SugarCube 1.0.34)

Hi everyone! I'm very new to Twine and coding in general, so please bear with me. I'm trying to create an invisible timer that will count down across multiple passages, and then redirect the player to a new, designated passage when time is up. I'm currently using User L's timedgoto macro (adapted for SugarCube by Lectronice), which I have attached as a .txt, but the problem is that the timer stops if the player clicks out of the passage it was referenced in.

Anyone know how I can make this timer work across multiple passages? Again, I barely know any code, so please explain as if you were teaching it to a child :P Any help would be unfathomably appreciated!

P.S. if anyone has already done something exactly like this and doesn't mind sharing sample code, that would be tops!<img src="https://twinery.org/forum/uploads/Uploader/fd/ffb1a568510de0bece39169e639b20.txt"; /><img src="https://twinery.org/forum/uploads/Uploader/fd/ffb1a568510de0bece39169e639b20.txt"; />

Comments

  • edited December 2016
    I'm having the exact same issue, only I want my timer to be visible. You can see the progression of my attempts (and where it fails) here: twinery.org/forum/discussion/8001/visual-countdown-timer-sugarcube2-11-0
  • This comment in the Global timer for Sugarcube 2 thread includes an example of one way to implement a global countdown.

    If you don't want the countdown to start when the story itself starts then you will need to execute the related Javascript using a <<script>> macro within the passage you want the countdown to start in.
  • Thank you, but I need to make it redirect to another passage when the timer is expended, and I don't really know how to do that.
  • edited December 2016
    As I said in an earlier post I was looking for exactly the same thing - at least I think we're after the same thing.

    Anyway, if that is the case your answer is here: http://twinery.org/forum/discussion/8001/visual-countdown-timer-sugarcube2-11-0 (the relevant instructions start with my post on December 2nd)

    This countdown is auto-triggered in the passage of your choosing, runs seamlessly across multiple passage, displays in the side bar (and can be styled with CSS) and then kills (or in your case sends them to a passage of your choosing) when the timer runs out.

    There also an allowance for beating the time by reaching a 'win' passage before it runs out.

    NB: This method applies to SG2 so I'm not sure how much (if any) adapting would be required.
Sign In or Register to comment.