Game Development Community

No texture on the mini pack crates

by Wolfgang Kurz · in Torque Game Engine · 05/22/2007 (8:01 am) · 6 replies

Hello everyone,

i bought the create-minipack and i add the crates to my mission like this as i use them as ammo packs:
function createAmmo(%pos){
   %obj = new StaticShape(AmmoItem) {
      dataBlock = AmmoPack;
      static = true;
      rotate = false;      
   };   
   %obj.setTransform(getWords(%pos,0,2)@" 0 0 0 0"); // where to put it

   %obj.startFade(0, 0, true);   

   // Shedule a reapearance 
   %obj.schedule(1100, "startFade", 1000, 0, false);
}

function createHealthPack(%pos){
   %obj = new StaticShape(HealthItem) {
      dataBlock = HealthPack;
      static = true;
      rotate = false;      
   };   
   %obj.setTransform(getWords(%pos,0,2)@" 0 0 0 0"); // where to put it

   %obj.startFade(0, 0, true);   

   // Shedule a reapearance 
   %obj.schedule(1100, "startFade", 1000, 0, false);
}

datablock StaticShapeData( AmmoPack )
{
  shapeFile = "~/data/shapes/pickups/SmlCrate02.dts"; // <-- our model    
};

datablock StaticShapeData( HealthPack )
{
  shapeFile = "~/data/shapes/pickups/WoodenCrate01.dts"; // <-- our model  
};

i have tried it as itemdata too but i am getting the same reults:-(
the creates apear but they dont have any textures

#1
05/22/2007 (8:43 am)
Did you check the console for error?
#2
05/22/2007 (9:21 am)
Wolfgang,

Please email me back on the question I ask you in the email regarding this. Have you determined if in fact the texture is going missing or if you are just seeing the collision hulls being rendered?
#3
05/22/2007 (10:19 am)
Hi Todd,

Email sent.

@Fucifer There are no errors in the console :-) i would have posted them :-)
#4
05/22/2007 (12:21 pm)
Ok wierd thing:

when i create the objects like this:

function createAmmo(%pos){
   %obj = new TSStatic(AmmoItem) {
      shapeName = "~/data/shapes/pickups/WoodenCrate01.dts";
    
   };   
   %obj.setTransform(getWords(%pos,0,2)@" 0 0 0 0"); // where to put it

   %obj.startFade(0, 0, true);   

   // Shedule a reapearance 
   %obj.schedule(1100, "startFade", 1000, 0, false);
}

function createHealthPack(%pos){
   %obj = new TSStatic(HealthItem) {
      shapeName = "~/data/shapes/pickups/WoodenCrate01.dts";
        
   };   
   %obj.setTransform(getWords(%pos,0,2)@" 0 0 0 0"); // where to put it

   %obj.startFade(0, 0, true);   

   // Shedule a reapearance 
   %obj.schedule(1100, "startFade", 1000, 0, false);
}

everything works fine

no clue what the problem is
#5
05/22/2007 (1:03 pm)
Could it be that in your first sample you're defining your datablocks after referencing them?
#6
05/22/2007 (1:39 pm)
Well i would imagine, then i would get the error that the datablock is not a member of the gamebase but i get no error at all