Game Development Community

Tilemaps not saved properly

by nahum hernandez · in Torque Game Builder · 08/18/2010 (6:48 pm) · 1 replies

Hi, I am having some problems when using the tilemap editor in tgb 2d.

I can use it without any issue, but after a few saves, randomly when I click the Save button, the tile layer only gets clean! and my work goes to only god knows where, i tried reloading the project after save, but it only screws the layer, it loses all setup information like tile size, height and weight. So everything gets deleted and I stay with some bugged 1x1 tile layer.

This is the second time I lose an almost finished layer with no apparently reason. Can anyone help?

I am working on windows 7, if this has something to do with.

Thanks in advance.

About the author

Recent Threads


#1
08/19/2010 (1:08 pm)
This kind of buggy behavior is a good reason to avoid the level editor. If you can figure out how to build your tile maps using code, your work will be much easier. I recently started playing around with tile maps. Example:

function fogLayer::createFog(%this, %cntX,%cntY,%sizeX,%sizeY,%pos)
{
   %this.createLayer(%cntX,%cntY,%sizeX,%sizeY);
   %this.size = %cntX * %SizeX SPC %cntY * %SizeY; 
   %this.position=%pos;
   
   for (%x=0;%x<%cntX;%x++)
      for(%y=0;%y<%cntY;%y++){
         %this.setStaticTile(%x,%y, blackboxImageMap,0); 
         %this.setTileCollisionActive(%x,%y,true);
         %this.setTileCustomData(%x,%y,1);
      }
}