Game Development Community

Cycling through objects

by Chris Norpchen · in Torque Game Engine · 07/09/2004 (2:10 pm) · 3 replies

Is there an easy way to cycle through the objects in the game and find all of them within a certain category in script? (I know there has to be)
I know how to cycle through the clients:
%count = %ClientGroup.getCount();
and then use that number in a for loop with this:
%client = ClientGroup.getObject(%cl)
But, can you do %CoinsGroup.getCount()?? if you have a Coins category of objects. I remember reading somewhere that identifying types of objects by adding a category in their Datablock was so you could access them and cycle through them. But, what is the command???
Have I been missing something?
please help.

#1
07/09/2004 (2:44 pm)
Client group is a SimGroup. By default all game objects are add to the SimGroup named MissionGroup. You can create subgroups of this and add specific objects there. To have a look at all the SimGroups type tree(); into the console.
#2
07/09/2004 (2:46 pm)
By default all MAP objects are added to the MissionGroup. Once a match or game has started almost all objects are added to MissionCleanup from there on out.
#3
07/09/2004 (5:18 pm)
Thanks! That's exactly what I was looking for.
So, I can do this then:
%count=%MissionGroup.getCount();
and then use that for this:
%obj=MissionGroup.getObject(%cl);