Game Development Community

Post if you use Behaviors, Please

by Charlie Patterson · in Torque Game Builder · 02/06/2012 (10:41 am) · 24 replies

Hi everyone. I'm feeling kind of lonely in my use of behavior scripts. Does anyone else use these?

I ask partly because I've run into a handful of bugs with them and am getting the sinking feeling that they were never finished and even abandoned, although nobody told me. :P

Thanks.
Page«First 1 2 Next»
#21
02/10/2012 (12:43 pm)
The components are (I believe) the "back end" of the script behaviors - where the heavy lifting is done. It handles some interesting stuff for you, and if you need to you can derive specialized components to take care of complex behaviors in the executable. For instance, A* pathfinding is a good candidate for a behavior - the heavy lifting in the engine, the control and parameters in script behaviors.
#22
02/10/2012 (12:49 pm)
@Ronny, could be but doesn't appear so. I've drawn some pretty extreme charts of the guts of T2D. :)

To oversimplify, a t2dSceneObject will run all the BehaviorInstances it has. Those are the "behaviors" we use. Then it (actually its base class) will run all the SimComponents the C++ has given it, but I can't find any actually used! Finally, it will run the "class" script for your scene object.

Speculating here, it feels like they are in a re-factoring stage similar to the article you sent me. Someday, I imagine the physics and the blending and the other properties you see as sections in the editor will become components. Who knows!
#23
02/10/2012 (1:06 pm)
Sorry - forgot to mention this because it's still new to me: you can catch script callbacks for t2d objects in a behavior. So, if you have an animated sprite object with a behavior on it you can implement the onAnimationEnd() callback in that behavior instead of needing the script class to catch it. This works because the script class and behaviors both use callMethod() in the engine.

Just used this recently to make an object play a firing animation before actually firing and I was stuck using a script class. I also wanted a static sprite to share some features of the script class but this is not allowed since two different engine classes can't share the same script class or superclass. Kyle Miller and David Wyand pointed this feature out to me and the problem was solved.
#24
02/10/2012 (2:48 pm)
I always do raw scripting first then I convert the script into behaviors, It actually makes me a better scripter and the behaviors are really useful for rapid prototyping. I also right my own methods, I may be able to convert those into behaviors as well. hmmm...
Page«First 1 2 Next»