Game Development Community

RC2 bug in datablock.cs writing bad info

by Patrick Shaw · in Torque Game Builder · 06/10/2006 (5:05 am) · 1 replies

I started with this in my datablock.cs -

new t2dSceneObjectDatablock(basicBlocksDatablock) {

...

CollisionPolyList = " -1 -1 1 -1 1 1 -1 1";

...
};


After running my game multiple times, that line becomes:


CollisionPolyList = " -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 1 1 1 1 1 1 -1 1 -1 -1 1 1 -1 1 -1 -1 -1 -1 -1 -1 1 1 -1 1 -1 -1 1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 1 -1 -1 1 1 -1 1 -1 -1 -1 -1 -1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1";

Which causes a buffer overrrun.


As a quick fix, is there a way of disabling the datablock.cs autosave?

#1
06/14/2006 (4:20 am)
I don't know if this is related or not but I've noticed that copying datablock munges the collisionPolyList. In my project I have:

new t2dSceneObjectDatablock(basicDatablock) {

CollisionPolyList = " -1 -1 1 -1 1 1 -1 1";
}

new t2dSceneObjectDatablock(bulletGeneric : basicDatablock) {

// no CollisionPolyList field specified

}

new t2dSceneObjectDatablock(bulletLaser : bulletGeneric ) {

// no CollisionPolyList field specified

}

However, when I run the game, the datablocks have the following polylists

basicDatablock " 1 1 -1 1 -1 -1 1 -1" [8 values]

bulletGeneric " 1 1 1 1 1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 -1 -1 1 -1 1 1 -1 1 -1 -1 -1" [28 values]

bulletLaser " 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 1 1 1 1 1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 1 1 1 1 1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1" [~110 values]