Timers (consistency & resetting)

jaybeebug
04 Sept 2011, 22:59
Hi all,

I've been searching the old threads and haven't found an answer to this problem, so here I am . . .

Two questions, I suppose. First of all, is it possible for some computers to . . . fail at counting? I discovered that on one of my computers, a timer will not be consistent (sometimes it will fire at wildly different lengths of time-- 4 seconds, 10, 25, etc. for a timer that's supposed to be 30 secs-- usually erring on the side of too fast), but on my laptop it keeps perfect time. It's very annoying.

Second of all, assuming I am using a computer that knows how to count (sigh), I'd like to be able to 'reset' a timer. What I'm doing is that I have a computer terminal the Player uses in the game, and I want the computer terminal to 'time out' and turn off after 30 seconds of inactivity. So I have a 'timeout' timer set for 30 seconds when the player turns the little computer on, and what I want to do is 'reset' the 'timeout' timer every time the Player does something on the computer terminal (specificially, I'm using Commands for that, so if the Player gives the Command '1' then it accesses something on the computer terminal, and 'resets' the timer). What I thought would work is simply to 'turn off' the timer and then 'turn on' the timer every time the Player chose a computer Command . . . but it doesn't seem to work; and neither does 'Set a timer interval' to 30 seconds each time the Player chose a computer Command.

I hope I'm giving a decent explanation of the situation. Thanks!

-Jay
edited to make my vague Subject line slightly more specific

Alex
05 Sept 2011, 07:36
I've never heard of timers counting incorrectly - I can't think what might cause it.

For your "reset" timer, what I would do is have a timer that fires every 1 second which increments a numeric variable. When it gets to 30, run your "timeout" script. When the player does something on the terminal, reset the numeric variable to 0.

jaybeebug
05 Sept 2011, 17:54
Ah! Ok, great, I'll give that a try, thanks!

Yeah, at first I thought I was going nuts or just imagining it, but I sat there with a stopwatch to be sure. It's very odd. Maybe when I do an overhaul on my computer and update its operating system it'll behave better.

-Jay