Game Development Community

How to access the MissionGroup objects?

by Liu Yi · in Torque Game Engine · 12/12/2006 (2:08 am) · 1 replies

I know that in the scripts, the MissionGroup objects can be accessed using a statement like this:

%obj="MissionGroup/Tank".getObject(%i);

Is there any similar way in the engine to access the objects in the MissionGroup?

Thanks

#1
12/15/2006 (12:05 am)
If you search for MissionGroup in all of the engine files you will get 14 locations where it is used. Here is a code snippet from one of these locations:

SimSet * missionGroup = static_cast<SimSet*>(Sim::findObject("MissionGroup"));
   if(missionGroup)
   {
      mConsoleRendering = true;
      glEnable(GL_DEPTH_TEST);
      glDepthFunc(GL_LEQUAL);

      for(SimSetIterator itr(missionGroup); *itr; ++itr)
      {
         char buf[2][16];
         dSprintf(buf[0], 16, (*itr)->isSelected() ? "true" : "false");
         dSprintf(buf[1], 16, (*itr)->isExpanded() ? "true" : "false");
         Con::executef(*itr, 4, "onEditorRender", getIdString(), buf[0], buf[1]);
      }

      glDisable(GL_DEPTH_TEST);
      mConsoleRendering = false;
   }

Sim::findObject("MissionGroup") seems to be the way to access the MissionGroup.