Game Development Community

Getting all mision object

by M Mahmud Hasan · in Torque Game Engine · 12/04/2006 (11:34 am) · 2 replies

Hi,

I don't know if this problem seems novice to others, but I need this very badly.
I need to get all the object from a sim group.

I saw a code for getting the spawn point like this:

function getSpawnPoint ()
{
%groupName = "MissionGroup/SpawnPoints";
%group = nameToID(%groupName);

if (%group != -1) {
%count = %group.getCount();
if (%count != 0) {
%spawn = %group.getObject(%radarName);


return %spawn.getTransform();
}

....

}

So by %group.getCount(); we are counting the object in the group.
Now what I need to do is get all the objectID in the group one by one and put them in a list.
But I don't know how to do the job.

Can any one help me to figure it out?? Thanks a lot in advance :-)

Regards.

#1
12/04/2006 (11:39 am)
Something like this

for(%x=0; %x < %group.getCount(); %x++)
{
%obj[%x] = %group.getObject(%x);
}
#2
12/04/2006 (12:25 pm)
Thank you mb. Thanks a lot!!