forums

TNT Basic Forums > Programming Q&A
What am I missing in the creation of a map?
< Last Thread     Next Thread >
Author
Thread        Post A Reply

08-13-2003 01:29

Posted by:
Martin

Click Here to Email Martin   Find more posts by Martin

In the TMAP Info dialog window - generated by "Set Map Dimensions" in the Genesis menu, the first four items, that is the Map Width and Height expressed in tiles and the Tile Width and Height expressed in pixels, are easy to understand, The final item, "Tiles" is not.

First Explanation: In Laval Gagnon"s Map Tutorial that item, "tiles" refers to the "number of tiles you will be using." That makes sense.

Second Explanation: However, in TNT's Maps Section the "Setting the Map Properties," where the illustration shows a Map Width and Height of 10 tiles you would expect 100 tiles but the number 200 has been inserted in the illustration. Not only that, according to this explanation the number that should be placed next to "Tiles" is "number of tiles to cut out of the tile picture."

In John Treece-Birch's example of Tile Base Scrolling the map dimensions are as follows: Map Width 40, Map Height 30, Tile Width 32, Tile Height 32, Tiles 5. Why not 1200 if the Gagnon's explanation is true? Furthermore, if the second explanation why can't I decide not to cut anything out and leave the space blank?

The answer must be simple. I'd very much appreciate if someone could point out what I'm missing and explain the use of that last space next to "Tiles"?

Martin

08-13-2003 15:15

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

OK, it's easy. When you are in the window where you select a tile, when you click on a tile, it shows its ID. Tiles indicates the maximum ID you will be using, therefore the number of tiles. The number can be larger than the number of tiles, you'll just get empty tiles ( ! tiles )

08-14-2003 21:08

Posted by:
Martin

Click Here to Email Martin   Find more posts by Martin

Thanks for the try, Mathew, but it's not as easy as all that. However, you prompted more experimentation on my part. As a result, I not only figured much of what confused me, but accomplished one of my main goals at this stage, and that was numbering all 1200 tiles.

As you no doubt know, the TMAP Dialog will not accept a graphic of 1 tile, 16p x 16p. For some reason, which I haven't figured out yet, it needed three tiles and told me so. So I prepared three tiles in a row and used that. Voila! In the TMAP Dialog's "Tiles" bar a "3" appeared replacing the 1200 that I had inserted which was the product of 40 tiles in width and 30 tiles in height.

Then I was faced with a map of 1200 tiles, all numbered 1. (I had used the paint can tool to create the map). However, I needed each tile to have a unique number and finally worked out the following which numbers the tiles from 0 to 1999.

int tile
int xtiles=40
int ytiles=30
int ntiles=1200
int depth=0
int s,y,z,tn

fade down
hide mouse
graphics mode 640,480
Set framerate 20
Vbl Sync On
fade up
load map 128
Draw Map Section 0,0 to 640,480,0 to 0,0

for y=0 to ytiles-1
for s=0 to xtiles-1
Set Map Tile s,y,z,tn
tn=tn+1
next
next

'I used these few lines to check my work
tile=Map Tile (39,2,0)
Print tn 'The result was 1200
Print tile 'The result was 119

End

I hope this is helpful to someone else who is a new to TNT Basic.

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.