Game Development Community

Schedule

by Temasek Polytechnic · in Torque Game Engine · 07/04/2006 (6:37 pm) · 3 replies

Is it possible to add 2 schedules to an AIPlayer:

%ai.schedule(10000,"think");
%ai.schedule(50,"check");

#1
07/04/2006 (6:42 pm)
Yes, you can have as many as you want. BTW - for something like this where a simple experiment can answer your question it's often VERY smart to do the experiment. People are fallible, the code will always act however it acts. :P
#2
07/09/2006 (7:57 pm)
Ok.
So now i've got 2 schedules:

%ai.schedule(10000,"think");
%ai.schedule(50,"check");

Let's say i would like to cancel one of them.
i can't do this coz it will cancel both the schedules:

%ai.cancel();

So how do i cancel just one of them?
#3
07/09/2006 (8:39 pm)
Treat each schedule as a separate object like so...

%ai.event1 = %ai.schedule(10000,"think");
%ai.event2 = %ai.schedule(50,"check");


Then cancel whichever one you like using...


cancel(%ai.event1);
 
or
 
cancel(%ai.event2);