Game Development Community

setting layer woes(solved)

by rennie moffat · in Torque Game Builder · 04/30/2010 (1:45 pm) · 4 replies

Hi guys I have used setLayer in a behavior, often used, however, sometimes I notice that, it doesn't always answer my call.


if, in theory I setLayer(x);


then later setlayer(y); in a different function, called later, on schedule, in a behavior, moving n object, layer to layer like that, is it always difficult?












as I say i am able to use it, it is just not always perfect.
should this be an issue with TGB?
are behaviors, less smooth then not?

About the author

My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.


#1
04/30/2010 (3:37 pm)
related to this, is the behavior I am writing.

the level is essentially playing like a slide show. I have one owner object with 12 subObjects. each is called in and out, by layer placement on a schedule. So the way I have built, tho it seems glitchy is...


function loadObject1()
{
%this.object1.setLayer(%this.layer0);
%this.schedule(1000, loadObject2);
}


function loadObject2()
{
%this.object1.setLayer(%this.layer0);
%this.object2.setLayer(%this.layer31);
%this.schedule(1000, loadObject3);
}



and so on, covering all the 12 objects.
What I am wondering is it better, generally, in programming, when using so many schedules to use schedule method calls, vs, schedule function calls? or is there no difference?


#2
04/30/2010 (5:22 pm)
the problem was scheduling tempos.



::)()(
#3
04/30/2010 (7:33 pm)
What is the difference between methods and functions in torquescript?
#4
04/30/2010 (7:45 pm)
I am not entirely sure.


Perhaps you can clarify.


Specifically to this question tho, schedules can reference a function or a method. My thinking was/is a method, is with in a function, a function is not with in method.