timer questions

Posted by Tsunami on Tue 07 Feb 2006 07:10 PM — 4 posts, 19,769 views.

USA #0
I have some questions on timers. Specifically I want to use a timer to execute a script function five seconds after some event. As far as I know world.DoAfterSpecial could potentially create thousands of one shot timers (I'll be doing this a lot) so I wanted to use a timer. However, as far as I can tell a timer simply fires every 5 seconds after created, regardless of whether it is enabled or not. This leaves no guarentee that the timer will fire exactly 5 seconds after it is enabled. It could potentially fire at any time within those five seconds.

Is there anyway to ensure that it will fire only 5 seconds after being enabled? I tried using world.ResetTimer, but this did not seem to have any effect.
#1
resettimer is your best bet. Make sure you use it after you've enabled the timer though, or else it won't reset properly.
USA #2
Oh I see, I was reseting it before enabling it. I'll try that now, thanks a lot.
Australia Forum Administrator #3
I have amended the documentation for ResetTimer to make it clear they must be enabled first.