StaticShapes & RegisterObject
by Stefan Lundmark · in Torque Game Engine · 10/24/2004 (3:44 am) · 22 replies
I have tried to get StaticObjects work with my 1.1.2 release but to no avail. I have not modified anything regarding this area.
What could be wrong when the console says this?
I noticed there was no create() function for staticshapes in the editorgui.cs, so I added it.
Still the same error message though. Nothing changed.
The following is the block from the .mis file that I'm trying to use.
IF I chose to create a Static Shape from within the World Editor, it creates a TSStatic instead. I'm very confused.
What could be wrong when the console says this?
Quote:
data/enviorment/desert.mis (0): Register object failed for object Door of class StaticShape.
I noticed there was no create() function for staticshapes in the editorgui.cs, so I added it.
function StaticShapeData::create(%data)
{
%obj = new StaticShape() {
dataBlock = %data;
};
return %obj;
}Still the same error message though. Nothing changed.
The following is the block from the .mis file that I'm trying to use.
new StaticShape(Door) {
position = "-221.9 492.47 234.441";
rotation = "0 0 -1 90";
scale = "3.2 2.5 3.4";
dataBlock = "Door";
isOpen = false;
};IF I chose to create a Static Shape from within the World Editor, it creates a TSStatic instead. I'm very confused.
About the author
#22
11/20/2004 (2:20 pm)
Lol, that works. I never thought of that, actually. Thanks guys.
Torque Owner Gonzo T. Clown
You are absolutely correct I should have seen that myself and yet I now know that I was trying to hard to figure it out and once again missed the obvious answer.
Stefan, it only took me about 20 seconds to confirm the exact error you were getting, by naming a staticshape with it's own datablock name. You can actually get a variety of errors depending on if you try items, statics, or whatever. But I would say he hit it dead on with that for sure.
Great job Michael