Game Development Community

What is the command for a delay in torque script

by Anthony Messier · in Torque Game Engine · 03/27/2007 (5:01 pm) · 3 replies

I tried sleep(5000); but that does not work. sleep,delay,wait,nop?

I have look thur "http://tdn.garagegames.com/wiki/TorqueScript_Console_Functions" without any luck.

#1
03/27/2007 (5:33 pm)
Maybe you want schedule?
#2
03/27/2007 (5:49 pm)
There isn't one, use a schedule.
schedule(1000, 0, "someFunction", %foo);

   // or

   %foo.schedule(1000, "someFunction");
#3
03/28/2007 (9:54 am)
I think I need to use objID.schedule( t , methodName, arg0, ... , argN )

This is happening in my AIManager() what happens right now is the bot gets stuck flip-flopping between the two actions.

if(a!=b)
{
//do stuff
%bot.setPosition(%here);
}
else
{
//do some other stuff
%bot.setPosition(%over_there);
}
//wait here


So your telling me I need to use the schedule with my setPosition something like this?
%bot.schedule( 5000 , setPosition, %here ) ;