Game Development Community

Creating a ShapeBase Object

by Ian Dale · in Torque Game Engine · 12/22/2004 (6:24 am) · 5 replies

I have torque 1.3 with Lighting pack 1.2.

I'm having difficulty creating a shapebasedata object. My code is:

datablock ShapeBaseData(CRock)
{
ClassName = "Collectable";
category = "Collect";
emap = true;

shapeFile = "~/data/shapes/rock/rock.dts";

};

function ShapeBaseData::create(%data)
{
%obj = new ShapeBase() {
dataBlock = %data;
};
return %obj;
}

The dts object is correct as are it's textures. When I add the object through the editor all I get is a box outline and the XYZ handles and nothing else. No errors appear in the console log.

Any ideas would be greatly appreciated.

TIA.

#1
12/22/2004 (6:43 am)
Try using StaticShape or Item instead of ShapeBase.
#2
12/22/2004 (7:50 am)
I thought about doing that but I do not know how to expose the extra member functions that shapebase has in its' derivatives such as item and staticobject.
#3
12/22/2004 (7:56 am)
Just change ShapeBaseData to ItemData and see what happens.
#4
12/23/2004 (6:15 am)
Did Eric's suggestion work ?
#5
12/25/2004 (8:01 pm)
Eric,

Sorry, that idea didn't work.