Display static countdown

OurJud
07 Dec 2016, 01:31Would there be any way to have a countdown triggered and have it display as a fixed element somewhere (towards the bottom of the page would be best).
Not only that, I would need the timer to 'kill' the player if it reaches zero before they reach the end of the game.
I understand Quest isn't particularly reliable when it comes to timers, so I don't know if this would be fraught with problems even if it could be done.
NB: I've looked through all the relevant data a forum search brings up, and the only relevant one has a demo posted by Pertex which doesn't work (probably meant for an older version of Quest.)
http://textadventures.co.uk/forum/quest/topic/3020/displaying-a-countdown-timer-is-it-possible
hegemonkhan
07 Dec 2016, 04:49laughs... the odds of this being asked for... laughs...
(I'm laughing, as this gives me the chance to show off this horrible but functional countdown timer, lol)
if you want a really convoluted but innovative way (well not really, I'm just adjusting the digits as needed) of doing a countdown timer:
http://textadventures.co.uk/forum/samples/topic/4162/countdown-timer-code

OurJud
07 Dec 2016, 13:24Thanks very much, hege. I was thinking about this last night and on reflection have decided to take a different route. All the solutions seems complex and are probably fraught with issues anyway.
The method I settled on is to have one-minute, incremented timer scripts which display a message and play a voice announcing the time, so something like this in the game's start script:
wait 10
msg ("Remaining air supply estimated at five minutes")
wait 60
msg ("Remaining air supply estimated at four minutes")
wait 120
msg ("Remaining air supply estimated at three minutes")
All the way down to zero and then a move script to kill the player. Got to work out how to cancel the move script if they escape in time, though.
The Pixie
07 Dec 2016, 16:12Possibly the best way (not necessarily simple to implement) would be a JavaScript counter, and when it gets to zero it calls a Quest function that just ends the problem. That would avoid any issues Quest has with timing, and as it was running entirely in the browser would not be affected by slow server or connection. You could probably even show tenths of a second.

OurJud
07 Dec 2016, 16:14Thanks. I actually prefer my revised idea, but there's till the issues with Quest's timer reliability.
Could I JS my above method, baring in mind I would want audio?