Game Development Community

SetTimerOn() uses Milliseconds, not Seconds?

by David Higgins · in Torque Game Builder · 08/16/2006 (6:39 pm) · 1 replies

I believe the documentation for the setTimerOn() function is incorrect.

It states that the parameter is a float, which represents the number of 'seconds', which in testing it appears to be the number of 'milliseconds'

setTimerOn(%timePeriod)
Purpose
Sets a timer on the object that, when it expires, will cause the object to execute the onTimer
callback.
Syntax
%timePeriod - Float
The period of time, in [b]seconds[/b], between each callback.
Notes
* The timer event will continue to occur at regular intervals until setTimerOff() is called.


I would assume that 0.5 would be 500 milliseconds, where as 500 appears to be a more accurate representation of this. Also, when setting the %timePeriod parameter to anything below 0.01 (ie; 0.001 or 0.009) I seem to recieve errors from Visual C++ stating that Internal Memory state is corrupted, and the engine just stops running. I do have VC++ installed, so that may be a debugger message from VS rather then an actual message from Windows ...

#1
08/17/2006 (6:54 am)
Yeah I found that out when I did the same thing. I set mine to 0.25 and it locked on me. Its definately not seconds.