Game Development Community

How to open and edit map tiles (Tile editor not working)

by Adam Johnston · in Torque Game Builder · 09/27/2005 (5:24 pm) · 9 replies

OK I posted this in another thread
but my problem is different...

I have done all the tutorial, played with the effects
but I can't figure out how to OPEN even the
map files that come with the examples.
Whenever I launch the TileEditor (I put the
maps in Torque2D\SDK\example\tileeditor\client\maps)
but it can't load them. Until now I only have been able to
view a empty black screen with *nice* blue lines.

Please... somebody has been able to edit this maps already?

#1
09/27/2005 (6:18 pm)
Hi,

I can't load them either. I have a feeling, maybe I'm wrong, but in the tilemap folder there are directories for images, brushes, and layers that have nothing in them. Maybe they designed the map with that data, but it's not included in the release, only the .map file. If we had the images, layers, and brushes in those folders maybe we could open up the scroller.map file instead of getting a "load error" message.

They probably created the tile map separately and then added it to the final demo release.

Steve
#2
09/28/2005 (9:13 am)
Hi Steve
I relly need this working, first of all we need to discover
from were are the brushes been loaded and if we can create a
map and load in a demo.
Today I'm going to analize the tileeditor code...
#3
09/28/2005 (9:26 am)
There's really no need to analyze the tile-editor code.
The standard brushes you have there are all fxImageMap2Ds defined in "T2D/client/demoDatablocks.cs", which gets loaded from client.cs. This is for the example game, naturally.
The tile-editor, by default, saves your map in "tileeditor/client/maps", this is probably not where you want them, try moving them to "T2D/client/maps".

However, just as a side-note. Under Linux you'll find that your maps, along with your .dso files and a bunch of other stuff doesn't end up where you'd expect them. It has to do with PREF_DIR_ROOT in engine/platformX86UNIX/platformX86UNIX.h, but that's another story.

--
Hans
#4
09/28/2005 (10:09 am)
@Hans: Thank you pal. Have you been able to modify the scrollbar map?
#5
09/28/2005 (10:30 am)
Well, what you could try doing is moving the "spacescroller/client/maps/scroller.map" to "tileeditor/client/maps"
Oh, and the black, empty screen with the *nice* blue lines, that's just because the tile-editor automatically selects the top-most layer in the tilemap. Go into the "View" menu and change the layer.

--
Hans
#6
09/28/2005 (10:55 am)
I have done that

And It didn't work

I've even paste the images of the scrolldemo in the folder:

Torque2D\SDK\example\T2D\client\images
Torque2D\SDK\example\tileeditor\client\images

and just for sake created a folder brushes with all the images in

Torque2D\SDK\example\T2D\client\brushes

until now, I can open the scrolldemo map...
#7
09/28/2005 (12:10 pm)
LOL I've saved myself... :)

The demo ships with a full working tile editor (blame on me)
BUT if you need to edit the scrolldemo map you need to:

Put the image tiles in:

Torque2D\SDK\example\tileeditor\client\images

AND add this code to

C:\Torque2D\SDK\example\tileeditor\client\datablocks.cs

datablock fxImageMapDatablock2D(bgHills01ImageMap)
{
mode = full;
textureName = "~/client/images/bg_hills_01";
};

datablock fxImageMapDatablock2D(bgHills02ImageMap)
{
mode = full;
textureName = "~/client/images/bg_hills_02";
};

datablock fxImageMapDatablock2D(bgHills03ImageMap)
{
mode = full;
textureName = "~/client/images/bg_hills_03";
};

datablock fxImageMapDatablock2D(bgHills04ImageMap)
{
mode = full;
textureName = "~/client/images/bg_hills_04";
};

datablock fxImageMapDatablock2D(bgHills05ImageMap)
{
mode = full;
textureName = "~/client/images/bg_hills_05";
};

datablock fxImageMapDatablock2D(bgHills06ImageMap)
{
mode = full;
textureName = "~/client/images/bg_hills_06";
};

datablock fxImageMapDatablock2D(bgHills07ImageMap)
{
mode = full;
textureName = "~/client/images/bg_hills_07";
};

datablock fxImageMapDatablock2D(bgHills08ImageMap)
{
mode = full;
textureName = "~/client/images/bg_hills_08";
};

datablock fxImageMapDatablock2D(bgHills09ImageMap)
{
mode = full;
textureName = "~/client/images/bg_hills_09";
};

datablock fxImageMapDatablock2D(bgHills10ImageMap)
{
mode = full;
textureName = "~/client/images/bg_hills_10";
};

datablock fxImageMapDatablock2D(bgHills11ImageMap)
{
mode = full;
textureName = "~/client/images/bg_hills_11";
};

datablock fxImageMapDatablock2D(bgHills12ImageMap)
{
mode = full;
textureName = "~/client/images/bg_hills_12";
};

datablock fxImageMapDatablock2D(bgHills13ImageMap)
{
mode = full;
textureName = "~/client/images/bg_hills_13";
};

datablock fxImageMapDatablock2D(bgHills14ImageMap)
{
mode = full;
textureName = "~/client/images/bg_hills_14";
};

datablock fxImageMapDatablock2D(bgHills15ImageMap)
{
mode = full;
textureName = "~/client/images/bg_hills_15";
};

datablock fxImageMapDatablock2D(bgHills16ImageMap)
{
mode = full;
textureName = "~/client/images/bg_hills_16";
};

datablock fxImageMapDatablock2D(bgMountains01ImageMap)
{
mode = full;
textureName = "~/client/images/bg_mountains_01";
};

datablock fxImageMapDatablock2D(bgMountains02ImageMap)
{
mode = full;
textureName = "~/client/images/bg_mountains_02";
};

datablock fxImageMapDatablock2D(bgMountains03ImageMap)
{
mode = full;
textureName = "~/client/images/bg_mountains_03";
};

datablock fxImageMapDatablock2D(bgMountains04ImageMap)
{
mode = full;
textureName = "~/client/images/bg_mountains_04";
};

datablock fxImageMapDatablock2D(bgBuildings01ImageMap)
{
mode = full;
textureName = "~/client/images/bg_buildings_01";
};

etc... (the forum don't let me post all the code) just define all the datablock
#8
09/28/2005 (12:43 pm)
Actually, you don't have to touch the tileeditor at all. Just as long as all those datablocks gets loaded, which they do if you start the shooter demo, they should be available in the tileeditor. So it's not enough to just start T2D, you need to start it with runshooter.bat to initialize the spaceshooter module.

--
Hans
#9
09/28/2005 (1:34 pm)
Currently you can't change which folder the tilemap editor is loading from

to get around this, I went into the the following file: Torque2D/SDK/tileeditor/client/editorScreen.cs , and made some adjustments

// the following is the one I edited so that i could load my tilemaps - line 117

tileScreenMenu.scriptCommand["File", 1] = @
                    "getLoadFilename(\"T2D/client/tilemaps/*.*\", loadMap);";

// Edit - had to break the above into 2 lines cuz it was too long for the code block.

it now points to where all my tilemaps are for my game - which is located here: Torque2D/SDK/T2D/..

or you could just make all your tilemaps in the the editors folder and then move them to your games tilemaps folder and vice versa

I suggest before making any changes to editors and what not... you make sure you have a clean copy somewhere