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.
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.
Torque 3D Owner mb
for(%x=0; %x < %group.getCount(); %x++)
{
%obj[%x] = %group.getObject(%x);
}