Game Development Community

Giving items/objects behaviors (newbie question)

by Paul Sisneros · in Torque Game Engine · 02/04/2007 (9:08 am) · 2 replies

So, i understand how to create things and give them their prescripted behaviors like rotating, But how do i make something follow a new behavior? I cant just put a loop in a data block obviously. So if i want to make a function (or something like it if theres another thing i should use for this) and have all instances of a item/object follow it without messing with eachother varaibles how is that done? I figure it must be fairly routine since all games need to do it, but i cant figure out how. Im thinking i need to call some function when its created and have that function call itself, but Im not sure how to handle the variables so that multiple instances could use it.

lets say i make an item and for example purposes it does something simple like sliding around and changing its direction randomly every few seconds, and i want to be able to make as many of these as I like. How do I do it?

#1
02/04/2007 (10:36 am)
You may want to look at chapter3 Allin1 second edition programmed movent (moveshape.cs). I am still new to this book and have never made anything with this engine there is probally better solutions. You would have to set definte identifer (number was how it was done in the exercise enter in the consule) for the object. rewrite

I'm on chapter18. and have no previous programming experince

I did a game with FPSC and a another example was using a waypoint with a floating platform was a define path for it to travel. (not sure if this will help)
#2
02/04/2007 (1:04 pm)
Thanks, I had forgotten about that part, but its what i needed