Game Development Community

Adding a member variable to TSShapeInstance

by Ian Omroth Hardingham · in Torque 3D Professional · 09/04/2012 (2:13 am) · 6 replies

Hey guys.

I'm trying to add a member var to TSShapeInstance, but I get a heap crash on mission load whenever I do. Can anyone advise?

Cheers,
Ian

#1
09/04/2012 (2:20 am)
I ran into issues similar to this with the NameSpace class/object. There are functions that create the memory by allocating it as a memory. So this keeps one from deriving from that class and adding variables. I eventually gave up trying to alter that object and solved my problem another way.

I don't know what is causing your issue, but it may be something similar. Or it could be a pointer issue. Without seeing the code I cannot tell. Maybe throw up a snippet to give us an idea?
#2
09/04/2012 (2:28 am)
Hi Frank.

I literally just added:

Point3F oldPoints[256];

To the class definition.

Ian
#3
09/04/2012 (2:56 am)
If it is not an allocation issue (where the class storage is allocated outside its initialization) then it could be you need to rebuild the engine. Other than that I haven't a clue.
#4
09/04/2012 (3:34 am)
I just tested this, added Point3F oldPoints[256]; to tsShapeInstance.h, recompiled and everything runs OK.
#5
09/04/2012 (3:37 am)
Did you load a mission with a player object in it? If so, weird... I wonder what I've broken elsewhere!

Ian
#6
09/04/2012 (6:57 am)
@Ian, yes loaded missions and shot stuff etc....