structures and groups
by Ian Omroth Hardingham · in Torque Game Engine · 03/25/2002 (10:52 am) · 2 replies
Well, I'm pretty sure you can't just use any old struct command in script but can anyone tell me how to make my own Group?
I'm not sure what they are but they appear to be bins full of pointers with a getCount and a getObject command.
I'm not sure what they are but they appear to be bins full of pointers with a getCount and a getObject command.
About the author
Designer and lead programmer on Frozen Synapse, Frozen Endzone, and Determinance. Co-owner of Mode 7 Games.
Torque 3D Owner Joel Baxter
SimGroup is derived from SimSet. To tell you the truth I'm not exactly sure what the difference is between them, although I think that SimGroup uses a hash table to more quickly find objects in the group on findObject.
For an example of creating a SimGroup object (and SimSet should work the same way) just look at any mission file. The whole .mis file is an object creation statement for a SimGroup object named MissionGroup. Inside that statement a lot more object creation goes on, and those objects get added to MissionGroup since their creation statements are contained inside the MissionGroup creation statement. And MissionGroup can contain more SimGroup or SimSet objects, which themselves can contain other objects, etc.
You can also add to a SimGroup or SimSet after creating it, or remove from it. Check out the various ConsoleMethod declarations in console/simBase.cc for SimSet, to see all the functions you can call on SimSet and SimGroup objects.