Game Development Community

GetDeployTransform for StaticShapeData deployment?

by Jeff Trier · in Torque Game Engine · 07/15/2003 (7:20 am) · 2 replies

Hey guys,

I am in the process of trying to get a StaticShapeData object to spawn. I can spawn players and vehicles, but I can't seem to set the transform for StaticShapeData objects.

Since there is no setTransform command for these types of dataBlocks, how is it done? The closest I have found are the commands "getDeployTransform" and "checkDeployPos". Both of which seem to be more for data retrieval than for positional setting.

Also, for getDeployTransform(%pos, %normal) I am not sure what exactly a normal is in this context.

I can't find any documentation anywhere on this, so I was wondering if I could get some help from you all. :)

Here is what I have for the spawning command:
function serverCmdAddSpawner (%client){

echo("Spawner Being Added");
   if (%client.player $= "" )
      return;

   %spawner = new StaticShapeData()
   {
      datablock = DeploymentBunker;
   };
   %spawner.mountable = true;
   //%spawner.setEnergyLevel(60);

//%spawner.setShapeName(%SetName);

   // Get the spawn position. 
   %pos = $testBuildLoc;
   %x = getWord(%pos, 0);
   %y = getWord(%pos, 1);
   %z = getWord(%pos, 2);
   %x += 5.0;
   %y += 5.0;
   %z += 10.0; // was 0
   %spawner.getDeployTransform(%x SPC %y SPC %z, "0 0 0");
   //%spawner.setTransform(%x SPC %y SPC %z); // not recognized
   MissionCleanup.add(%spawner);
}

Thanks guys!
-Jeff

About the author

Originally a Classical/Metal musician, I've always been attracted to anything involving computers, including: Networking, PC Building and Repair, software design and coding. I've been involved with game design and development for over 10 years.


#1
07/15/2003 (7:36 am)
Doh! got it working...

function serverCmdAddSpawner (%client){
DeploymentBunker.dump();
echo("Spawner Being Added");
   if (%client.player $= "" )
      return;


   // Get the spawn position. 
   %pos = $testBuildLoc;
   %x = getWord(%pos, 0);
   %y = getWord(%pos, 1);
   %z = getWord(%pos, 2);

   %Spawnpos = %x SPC %y SPC %z;

   %spawner = new StaticShape() {
      position = %Spawnpos;
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "DeploymentBunker";
   };

   %spawner.mountable = true;

   //%spawner.position = %spawner.getDeployTransform(%x SPC %y SPC %z, "0 0 0");
   //%spawner.setTransform(%x SPC %y SPC %z);
   MissionCleanup.add(%spawner);
}

Thanks!
-Jeff
#2
08/03/2003 (10:44 am)
Where do you put this code and how do you reference it in order to spawn a new StaticShape object. I'm trying to get an object to spawn and follow the Player around on the client side, but I don't really know how to do it.