Game Development Community

Breackable Glass Class

by RedCore · in Torque Game Engine · 11/26/2003 (11:49 am) · 3 replies

I get this error when i try to put my glass into the game..

TotalControl/server/scripts/Explodables/Glass.cs (47): Register object failed for object (null) of class Glass.
TheGlass
SWEET!

Here's my Glass Code:
http://www.hdcwargame.com/TotalControl/Glass.cc
http://www.hdcwargame.com/TotalControl/Glass.h


These are my Glass datablocks

//-----------------------------------------------------------------------------
// Glass
//-----------------------------------------------------------------------------


datablock DebrisData(GlassShatter)
{
shapeFile = "~/data/shapes/glass/glass1.dts";
lifetime = 10.0;
minSpinSpeed = 100.0;
maxSpinSpeed = 700.0;
elasticity = 0.5;
friction = 0.2;
numBounces = 4;
staticOnMaxBounce = true;
snapOnMaxBounce = false;
fade = true;
};

datablock AudioProfile(breakGlass)
{
filename = "~/data/sound/testing.wav";
description = "AudioClosest3d";
preload = true;
};

datablock GlassData(TheGlass)
{
category = "Glass";
shapeFile = "~/data/shapes/explodable/magnet/magnet.dts";
color = "1 1 1 1";
NumDebris = 20;
DebrisData[0] = GlassShatter;
DebrisData[1] = GlassShatter;
BreakSound = breakGlass;
};

//-----------------------------------------------------------------------------



function GlassData::create(%block)
{
%obj = new Glass() {
dataBlock = %block;
};
echo(%block);
echo("SWEET!");
return(%obj);
}

#1
11/26/2003 (1:08 pm)
ReCreating and reposting this under a different thread won't get you more attention, all the other side, less attention.
#2
11/26/2003 (1:20 pm)
The old thread was obsolete and is deleted.. i fixed all my compiling errors ect. but now i'm having this one..
#3
11/26/2003 (1:32 pm)
First glance tell's me it has failed the SceneObject::AddToScene code..
(correct me if im wrong on the name there .. been a while)

no doubt due to the Matrix representing the object/world position's.

go have a gander at how you instantiate this positional information.