Game Development Community

DataBlockGroup different on client and server?

by Josh Albrecht · in Torque Game Engine · 04/18/2002 (7:32 pm) · 0 replies

What exactly IS DataBlockGroup? In the scripts, I use it as follows:

function setArmorArray()
{
$armorIndex = 0;
for(%i = 0; %i < DataBlockGroup.getCount(); %i++)
{
   %obj = DataBlockGroup.getObject(%i);
   echo(%obj.getClassName());    //PlayerData
   echo(%obj.getname());         //LightMaleHumanData
   echo(%obj.shapeFile);         //File
   if(strncmp("fps/data/shapes/player/*.dts", %obj.shapeFile, 22) == 0)
   {
   if(%obj.getClassName() $= "ItemData")
   {
   $armor[$armorIndex] = %obj;
   $armorIndex++;
   }
   }

}
$currentArmor = 0;
}

Note: strncmp is a function I created to compare the first x characters of two strings.

I use this function to see if an object has a shape file in a certain directory, and if it does, I add it to an array. I use this later with teh 3d model viewing to allow people to cycle through the array, and click a button to buy what they see.

It works great on the server, and the local client. I get hundreds of things echo printed.

However, as a remote client, NOTHING is echoed. There are no errors either. This leads me to believe that DataBlockGroup is empty. What is the purpose of this thing? What exaclty is DataBlockGroup? How should I be using it? Is there a better way to get all of the datablocks that have an appropriate shapFile value?

Thanks for any help! :)