Game Development Community

Objects losing class/identity?

by Enrico Falk · in iTorque 2D · 04/10/2009 (6:22 am) · 2 replies

Hi,
I currently have a problem with my gamepieces randomly losing their class (t2dAnimatedSprite) inheritance or so it seems to me.
They still exist but strangely they have little more than the knowledge of the custom class(NameSpace) I assigned to them.
Even calling a SimObject method like getName() will only yield me an error message - the weird thing is that even the error message ("Unknown Command etc.") can no longer output the name and inheritance hierarchy of the object, although the object itself clearly still does exist.

Anyone ever experienced this before?

Here's a little info about my setup:
I have different types of datablocks to instantiate different types of gamepieces and most those datablocks extend some "parent" gamepiece-datablock.
The gamepiece types also have different custom classes assigned to them via the datablocks.
I also name all the gamepieces and frequently change their names ingame.
All those pieces are instantiated as t2dAnimatedSprite, using t2dSceneObjectDatablocks.

I already had lots of problems with namespaces, datablocks, objectnames etc. since they all seem to conflict each other and had a lot of namespace unlink errors ( Namespace::unlinkClass - cannot unlink namespace parent linkage ).
Now I managed to fix most of them, but this error I cant get rid off - especially since it appears to be mostly random.

Any Help or Suggestions would be greatly appreciated.

best regards

#1
04/17/2009 (1:59 am)
Ok, since answered I'll just start to speculate.
My suspicions are:
1. That it either has got something to do with the Objects names permanently being changed, which was probably not intended this way. They are all being saved in a Simset too, though.
2. That maybe the safeDelete() function does not work correctly and just damages the objects killing their class hierarchy, but not the whole object.
3. It's something completely different which I am missing altogether.

Any thoughts?

#2
05/14/2009 (5:28 am)
A small update for anybody who is interested.
I got rid of all names for my gamepieces and am now using a special "dead" state scheduling a safeDelete() for later, since this function appears to be somehwat unreliable.
It seems that did the job.