GameBaseData ?
by combitz · in Torsion · 11/29/2008 (9:11 am) · 7 replies
I have been playing with placing triggers in a level but even after saving the level on reloading it the trigger does not appear and I get the error in the console
object 'x' is not a member of the gameBaseData data block class.
I also get this error after I have moved a map from a test area to my game maps.
I know it can't find something but I can't see anything missing in the code or dts involved. All the difs are showing
is there somewhere I can read more about gameBaseData?
Cheers
object 'x' is not a member of the gameBaseData data block class.
I also get this error after I have moved a map from a test area to my game maps.
I know it can't find something but I can't see anything missing in the code or dts involved. All the difs are showing
is there somewhere I can read more about gameBaseData?
Cheers
About the author
#2
I know it is a static shape, the dts file is there and it makes the dso file so i'm confused as to why it can't see it
11/29/2008 (12:31 pm)
The log still just states the same thing*** LOADING MISSION: starter.fps/data/missions/PlayerSelect.mis *** Stage 1 load *** Stage 2 load Executing starter.fps/data/missions/PlayerSelect.mis. Object 'MyItem' is not a member of the 'GameBaseData' data block class starter.fps/data/missions/PlayerSelect.mis (0): Register object failed for object No1 of class StaticShape. Object 'MyItem' is not a member of the 'GameBaseData' data block class starter.fps/data/missions/PlayerSelect.mis (0): Register object failed for object No2 of class StaticShape. Object 'MyItem' is not a member of the 'GameBaseData' data block class starter.fps/data/missions/PlayerSelect.mis (0): Register object failed for object No3 of class StaticShape. *** Mission loaded
I know it is a static shape, the dts file is there and it makes the dso file so i'm confused as to why it can't see it
#3
If you see it in static shapes, and not shapes, make sure you tell the editor it is a shape.
You'll need a datablock telling the editor about it. Something like:
Only you'll want to make it specific to your item.
11/29/2008 (2:13 pm)
Do you see your object in shapes? or static shapes? (in the in-game editor)If you see it in static shapes, and not shapes, make sure you tell the editor it is a shape.
You'll need a datablock telling the editor about it. Something like:
atablock ItemData(HealthKit) // Name your item in the parenthathis here.
{
// Mission editor category, this datablock will show up in the
// specified category under the "shapes" root category.
category = "Health"; // Make this something you'll recognise.
// Basic Item properties
shapeFile = "~/data/shapes/items/healthKit.dts"; // make sure this points to your item.
mass = 1;
friction = 1;
elasticity = 0.3;
emap = true;
// Dynamic properties defined by the scripts
pickupName = "a health kit"; // This adds the chat message.
repairAmount = 50;
};Only you'll want to make it specific to your item.
#4
I'm not sure if something is corrupt as I can't add triggers either. If write the datablock for the trigger and write a function to add it. I can then call addtrigger in the console and the trigger appears in the level, I save the level but on a reload it fails to load it.
It does not show in editor under shapes>Items.
I don't understand why it cant see it. I've triedwith and without telling the server init.cs file to exec it. no joy either.
11/29/2008 (3:22 pm)
I have the datablock and its located in the server folder which it was in the previous test level but it does not show in the editor under shapes.I'm not sure if something is corrupt as I can't add triggers either. If write the datablock for the trigger and write a function to add it. I can then call addtrigger in the console and the trigger appears in the level, I save the level but on a reload it fails to load it.
It does not show in editor under shapes>Items.
datablock StaticShapeData(MyItem)
{
category = "Items";
shapeFile = "~/data/shapes/3dtorquelogo/torque_logo.dts";
};
function MyItem::onCollision(%this, %obj, %col)
{
if(%col.getClassName() $= "Player")
{
//get which collision object
$playerSelection = %obj.getName();
//case statement here for load level
switch$ ($playerSelection)
{
case "No1":
.....
case "No2":
.....
case "No3":
.....
default:
}
}
}I don't understand why it cant see it. I've triedwith and without telling the server init.cs file to exec it. no joy either.
#5
It should be just under item.cs. If the script is loaded after torque wants to add the item, torque won't know about the functions. Aside from this, and barring any problems in the console.log, the only other thing I can think of is to make sure there is a compiled dso file for it.
11/29/2008 (5:13 pm)
Are you exec'ing the file in server/scripts/game.cs? If so, where in the lineup?It should be just under item.cs. If the script is loaded after torque wants to add the item, torque won't know about the functions. Aside from this, and barring any problems in the console.log, the only other thing I can think of is to make sure there is a compiled dso file for it.
#6
11/29/2008 (5:46 pm)
Thanks, it's working. Still new and lots to learn. ;)
#7
Glad you got this working. :-)
11/29/2008 (6:56 pm)
You'll find that no matter how long you use an engine, any engine, there are always new things to learn. Glad you got this working. :-)
Torque Owner Mike Rowley
Mike Rowley
As for the error message, it's a generic message telling you there is a problem. Most of the time, it's a problem in script.