Game Development Community

List all objects

by Thomas Bang · in Torque Game Engine · 12/15/2008 (4:57 am) · 3 replies

Is there a way to list all loaded objects? Not only objects from the MissionGroup. Also all other objects which are created during runtime.

#1
12/15/2008 (11:34 am)
Tree()
#2
12/15/2008 (12:26 pm)
This thread reminded me to resource-ify a utility i added a while ago to do the same thing as Tree() but just dump the results to the console.

here's the pending-approval resource.
#3
12/16/2008 (3:48 am)
Ah, i got it. All objects are under the RootGroup.
I wrote these functions...


function ListRootGroup()
{
   if (isObject(Rootgroup))
   {
      %count = RootGroup.getCount();
      
      for (%i=0; %i<%count; %i++)
      {
         %obj = RootGroup.getObject(%i);
         echo(%obj.getID() SPC ":" SPC %obj.getName() SPC %obj.getClassName());
      }
   }
}

function CheckMissionGroup()
{
   if (isObject(MissionGroup))
   {
      echo("MissionGroup exists");
   } 
   else
   {
      echo("MissionGroup? No, not here!!!");
   }
}