Getting class name
by Tetraweb · in Torque Game Builder · 02/19/2007 (6:44 pm) · 3 replies
I must be missing something basic. In the editor, I assign an object to a class, and in the CLASSNAME::onLevelLoaded() everything works great, but if in that I put echo(%this.getClassName()); I get the parent class, usually t2dStaticSprite, not the class the object is in.
I came across this because in my onCollision routine I was trying to use
if (%dstObject.getClassName()$="someClass") {
and it didn't work.
First poster to point out the obvious mistake I must be making wins a beer.
Greg
I came across this because in my onCollision routine I was trying to use
if (%dstObject.getClassName()$="someClass") {
and it didn't work.
First poster to point out the obvious mistake I must be making wins a beer.
Greg
#2
Greg
02/19/2007 (7:07 pm)
Thanks very much. I just put a beer in your fridge, behind the orange juice. It's on me.Greg
#3
In TGB "class" and "superclass" are actually simply additional namespaces that are available, and have nothing to do with any c++ concept of "underlying c++ class that is used to implement the object", while getClassName does return the underlying c++ class that the object has as it's base when it is created.
02/20/2007 (8:09 am)
TGB greatly re-defined the concept of "class" and "superclass" during it's beta stages, and getClassName() simply wasn't brought up to speed, since it's actually a left over from the original concept of "class" in Torque Core.In TGB "class" and "superclass" are actually simply additional namespaces that are available, and have nothing to do with any c++ concept of "underlying c++ class that is used to implement the object", while getClassName does return the underlying c++ class that the object has as it's base when it is created.
Torque 3D Owner Richard McKinney
Default Studio Name