Game Development Community

Why would a .dso not compile?

by Natalia M · in Technical Issues · 06/01/2006 (2:20 pm) · 3 replies

I have a .cs file that does not generate a .dso when I run Torque;
What could be a possible problem?
This is the content of the .cs file:

datablock ShapeBaseData(water)
{
category = "Misc";
shapeFile= "~\data\shapes\water_test\water.dts";
};

function Flag::onAdd(%this,%obj)
{
%obj.playThread(0,"ambient");
}

function ShapeBaseData::create(%block)
{
%obj = new StaticShape();
{
dataBlock = %block;
};
return(%obj);
}

#1
06/01/2006 (2:31 pm)
The only problem I can is that you're trying to define a ShapebaseData object. This is the first mistake I made in torquescript. You can't instantiate shapebase objects. You have to choose one of it's derived classes.
#2
06/01/2006 (2:33 pm)
When a .cs file isn't compiled it usually means there's a syntax error (check your console!).

In this particular case you have a ; too much. It should be:
%obj = new StaticShape()
{
   dataBlock = %block;
};
#3
06/01/2006 (2:40 pm)
It worked!!
Thank you thank you=)