Game Development Community

Adding Datablock to class (fxRenderObject)

by August Jokela · in Torque Game Engine · 11/11/2005 (3:03 pm) · 5 replies

I am trying to add a datablock to the fxRenderObject resource. I am actually having fxRenderObject inherit from ShapeBase instead of SceneObject. I have looked at different classes (player, boatvehicle, item, etc) that inherit from ShapeBase that have datablocks that inherit from ShapeBaseData. From what I can tell the classes just have a pointer to its respecitive datablock called mDatablock.

For instance the Player class has PlayerData* mDatablock;

I also added the function onNewDatablock which they all have.

My problem is when I compile I get an error saying that mDatablock is a private variable of ShapeBase.

What is needed to get a datablock included into a class like fxRenderObject?

#1
11/11/2005 (3:13 pm)
I found out the problem.

I had the initPersistFields function in for fxRenderObject. I commented that out and then it worked fine.
#2
12/29/2005 (12:12 am)
Hey August,

I've been playing with adding objects through code and a datablock for fxRenderObject is exactly what I need next! (I'm following what's on http://www.garagegames.com/mg/forums/result.thread.php?qt=10131)

Would you mind posting the code for everyone's benefit?
#3
12/29/2005 (9:42 pm)
Why not inherit off of GameBase instead? It is SceneObject + datablocks (and other stuff).
#4
03/30/2006 (4:55 am)
August: Did you manage to get a DTS shape loaded and onscreen when inheriting from shapebase?
#5
04/10/2007 (4:28 am)
*Bump*

I Would still like to know if anyone managed to load a DTS using this.