Game Development Community

Problems with scheduletr

by Konik · in Torque Game Builder · 12/11/2012 (10:49 am) · 6 replies

Hello everyone. I have a problem with schedule. If I call it in 10 milliseconds - works, but if you put 100 or more - do not want to work. Please tell me what could be the problem? Tried in this way to cause schedule (10,0, "someAction") and% this.schedule (10, "Action") ...

Thank you very much for your help!

#1
12/11/2012 (1:43 pm)
You used 10 ms in both of your examples.
First of all, 10ms will usually be 32 ms (due to Torques tick speed) so in other words, you can never have a schedule below 32ms (or whatever your tick rate is)
I don't know why 100ms wouldn't work can you give us some more information? Like what error you get, and the code that fails to run?
#2
12/11/2012 (2:43 pm)
I've noticed that anything below 500 isn't visible.
#3
12/11/2012 (4:15 pm)
I've never heard of this - I routinely schedule events from 32 ms (any less and it usually gets pushed to the next tick anyway) to 10000ms with no problems. You should get a crash if you schedule an event for a negative time, but any positive value up to the maximum that a signed 32bit integer can handle is valid.
#4
12/11/2012 (11:40 pm)
Lukas Joergensen, I'm trying to call a function which enhances alpha object scene. In this function I calls itself recursively until the alpha less than 1. But when debugging, schedule does not call for values over 10 ms, and at low values - everything works fine. In the console log also no errors.

I call
function TestBehavior :: onMouseDown(%this)
{
%this.schedule(1000,showWindow);
}

function TestBehavior :: showWindow(%this)
{
%winAlpha = %this.finalWindow.getBlendAlpha();
if(%winAlpha < 1)
{
%this.finalWindow.setBlendAlpha(%winAlpha + 0.01);
%this.schedule(10, showWindow);
}
}
#5
12/12/2012 (2:37 am)
Hmm if possible I would like to see the whole console.log file.
#6
12/12/2012 (3:41 am)
I'm sorry. I found a problem. I tried to work with the behavior of the object that was removed from the scene. :(