Game Development Community

TorqueScript: Reading ShapeName value?

by Stephan - viKKing - Bondier · in Torque Game Engine · 10/22/2007 (2:57 pm) · 3 replies

I'm looking to read ShapeName value (from a TSStatic object).
Quote:shapeName= "~/data/shapes/blah/myshape.dts";

So far it doesn't seem to be possible.

Any help appreciated.
Thanks. 8-)

#1
10/23/2007 (4:59 am)
Really no clue?
I'm very disappointed there is no getShapeName method or something in the like for non DataBlock objects.

I wanted to compare my objects based upon their filename and the shape being used.
#2
10/23/2007 (5:39 am)
Well...

I have a TSStatic object named Pyramid1.

When I go into my console and type:

echo(Pyramid1.shapeName);

It replys with the path and filename of it's DTS.

Quote:shapeName= "~/data/shapes/blah/myshape.dts";

The field name that you set is "shapeName", it is the same field that you would access if you want to read it again.


Example:
new TSStatic(MyStaticTS) {
          shapeName= "~/data/shapes/blah/myshape.dts";
          myCustomVariable = "some value";
   };

   echo(MyStaticTS.shapeName);          // replys: ~/data/shapes/blah/myshape.dts
   echo(MyStaticTS.myCustomVariable);   // replys: some value
#3
10/23/2007 (5:52 am)
Thanks Brian, I only feel more stupid now, I tried objectID.shapename(); but it is objectID.shapename; instead.

Why isn't there any use of the parenthesis with this method? it would already be solved. ;-)

Thanks again.
It was really bugging me down.

Edit: because it is not a method!