StaticShape objects not Loading
by Phoenix Online Studios · in Torque Game Engine · 07/29/2005 (3:41 pm) · 15 replies
When I try to add StaticShape objects to the world, I am getting errors. And when I manually try to add them to the mission file, I'm getting the same errors. The name of the animated object is "Door". The errors in the console.log file are:
Object 'Door' is not a member of the 'GameBaseData' data block class
path/data/missions/mission.mis (0): Register object failed for object Door of class StaticShape.
I am execing door.cs before the mission loads. The door.cs file contains:
datablock StaticShapeData(Door)
{
category = "Bedroom";
shapeFile = "./Door.dts";
};
//animations
function Door::open(%obj) { %obj.playThread(0, "doorOpen"); }
function Door::close(%obj) { %obj.playThread(0, "doorClose"); }
The mission file contains:
new SimGroup(Bedroom) {
new StaticShape(Door) {
position = "0 0 100.01";
rotation = "1 0 0 0";
scale = "1 1 1";
dataBlock = "Door";
};
new Camera() {
position = "0 0 100.1";
rotation = "1 0 0 0";
scale = "1 1 1";
dataBlock = "Observer";
};
};
Does anyone know what I'm doing wrong?
Object 'Door' is not a member of the 'GameBaseData' data block class
path/data/missions/mission.mis (0): Register object failed for object Door of class StaticShape.
I am execing door.cs before the mission loads. The door.cs file contains:
datablock StaticShapeData(Door)
{
category = "Bedroom";
shapeFile = "./Door.dts";
};
//animations
function Door::open(%obj) { %obj.playThread(0, "doorOpen"); }
function Door::close(%obj) { %obj.playThread(0, "doorClose"); }
The mission file contains:
new SimGroup(Bedroom) {
new StaticShape(Door) {
position = "0 0 100.01";
rotation = "1 0 0 0";
scale = "1 1 1";
dataBlock = "Door";
};
new Camera() {
position = "0 0 100.1";
rotation = "1 0 0 0";
scale = "1 1 1";
dataBlock = "Observer";
};
};
Does anyone know what I'm doing wrong?
#2
Object 'Door' is not a member of the 'GameBaseData' data block class
path/data/missions/mission.mis (0): Register object failed for object Door1 of class StaticShape.
07/29/2005 (6:18 pm)
Nope. Now it says:Object 'Door' is not a member of the 'GameBaseData' data block class
path/data/missions/mission.mis (0): Register object failed for object Door1 of class StaticShape.
#3
07/30/2005 (5:41 am)
Ok is this the right path shapeFile = "./Door.dts"; ?
#4
07/30/2005 (6:59 am)
Yup, the .dts is in the same folder as the .cs file and that is the correct filename.
#5
07/30/2005 (8:06 am)
You should try setting your path to '"~/server/scripts/Door.dts" (this is assuming it's in the server scripts section) and it should work.
#6
07/30/2005 (8:08 am)
Oh, actually both the door.cs and Door.dts are in a subdir under /data, but I'll try your suggestion of using the whole path instead of a relative one and see if it works.
#7
07/30/2005 (8:16 am)
Nope. I still get the same errors.
#8
If so then i guess it must be the path, Id say should be something like this
"mymod/data/scripts/Door.dts"
mymod being case sensitive.
07/30/2005 (9:54 am)
You sure that cs file is compiling to .dso?If so then i guess it must be the path, Id say should be something like this
"mymod/data/scripts/Door.dts"
mymod being case sensitive.
#9
I've also been using case sensitive paths all along... :/
EDIT: I just tried using mymod instead of the ~ and I still get the same errors.
07/30/2005 (9:59 am)
Yes. I've deleted the door.cs.dso, ran and a new door.cs.dso was compiled by Torque.I've also been using case sensitive paths all along... :/
EDIT: I just tried using mymod instead of the ~ and I still get the same errors.
#10
07/30/2005 (1:30 pm)
So, just to clarify, are you executing door.cs in the game.cs file? Or are you executing it manually?
#11
07/30/2005 (1:37 pm)
I'm executing it in mymod/data/init.cs
#12
07/30/2005 (5:17 pm)
Well, I don't know if it has any effect, but your creating the DataBlock before the server is even created...I think you should move the exec command into the game.cs file. If you have one that is. If you don't have one, you should add it to the file that has this function in itfunction onServerCreated()
{
// Server::GameType is sent to the master server.
// This variable should uniquely identify your game and/or mod.
$Server::GameType = "FPS Starter Kit";
...
exec("./player.cs");
exec("./chimneyfire.cs");
[b]// Add your exec command like this
exec("./door.cs");[/b]
}Be sure to put the door.cs into the folder that contains game.cs (or the other file containing OnServerCreated()).
#13
07/31/2005 (1:04 pm)
Matthew is onto something. Datablocks are deleted and recreated between missions in order to minimize the amount of data transmitted over the wire.
#14
Thanks anyway guys. :)
07/31/2005 (1:43 pm)
I tried adding it there, but I still get the same errors. The odd thing is that I wasn't getting these errors before, so I think I'm just going to trace line by line all the changes I made since the working version and try to figure it out.Thanks anyway guys. :)
#15
sequence0 = "./doorOpen.dsq doorOpen";
sequence1 = "./doorClose.dsq doorClose";
Even though those *.dsq files don't exist. Once I added those two lines, the errors vanished and animations worked perfectly. :)
08/15/2005 (1:53 pm)
For those wondering, I was able to get this to work again. Apparently, the door.cs file needed to contain these lines in the constructor:sequence0 = "./doorOpen.dsq doorOpen";
sequence1 = "./doorClose.dsq doorClose";
Even though those *.dsq files don't exist. Once I added those two lines, the errors vanished and animations worked perfectly. :)
Torque 3D Owner Billy L
change to new StaticShape(Door1) or something else.