Game Development Community

OnTimerEvent questions

by Keiran · in Technical Issues · 10/10/2006 (3:22 pm) · 4 replies

I am not new to programming at all, but I am quite new to Torque scripting. First and foremost, is there complete documentation for all the functions, objects and methods that comes with it?

And secondly, is there a way that I could say something like this:

function SomeObject::onSomeTimerEvent(%this, %arg1.....)
{
Do something in here;

}

In script already? or would I have to make my own timer event?

Thanks all.

Corran

#1
10/10/2006 (3:26 pm)
Yes, there is. In TDN here or in the documentation/reference folder when you download it.

There are multiple ways to do timed callbacks. Timer methods and scheduling can both be used.
#2
10/10/2006 (5:04 pm)
Rock on, thanks
#3
10/11/2006 (2:01 pm)
Can you please give me some example of schedule() function?
i am tryuing to make it work for days, but nothing works...
#4
10/11/2006 (2:13 pm)
There are a whole bunch in the tutorials.
Here's a simple object based one:
function Player::doSomething(%this)
{
   %pos = %this.getPosition();
   
   echo("something done!");
   
   %this.schedule(200, "doSomething");
}