Game Development Community

Validation flag for ImageMapDatablock.

by Ecliptic · in Torque Game Builder · 01/01/2009 (4:52 pm) · 1 replies

I have this simple ImageMapDatablock to setup a cell mode image that needs to be mounted to an t2dAnimatedSprite.
datablock t2dImageMapDatablock( PictureConfig )
{
   imageName = "game/data/images/testImage";
   imageMode = CELL;
   cellcountX = 4;
   cellcountY = 4;
};

When the game tries to run the LinkPoints.AddLinkPoint() section of the level script it gives back an error saying it can not find that object. Then says that the imageMapDatablock "PictureConfig" is an invalid datablock..
//Create the new images (Animated selections).
	%image = new t2dAnimatedSprite()
	{
		sceneGraph = %this;
		config = "ImageConfig";
	};
	%image.LinkPoints.AddLinkPoint();
	//Create the Picture file for Puzzle.
	%picture = new t2dStaticSprite()
	{
		sceneGraph = %this;
		imageMap = "PictureConfig";
		class = "picture"; // the class that will be associated with the object
		layer = 2; // the render layer
		size = "20 20"; // the size of the object
	};
	%picture.Mount(%image);
I was reading up on this issue and I have found that it does a validation check prior to letting you ue the datablock. But since I have no errors in syntax I am slightly confused what is making my datablock invalid?

Thanks guys,
Dane

#1
01/03/2009 (3:01 pm)
For those wondering who MIGHT of had the same problems. This is just an issue of how the cell was set up. You need to make sure you put the dimensions of the cells. I thought it could generate it off the cellcountX and Y. I read somewhere it could, but would not work for me as long as I left the dimensions out.

Dane