Page 1 of 2

How to use Tiled

Posted: 21 Mar 2010, 09:39
by swimmy
screenshot(2010-03-21 18.34.29).png
screenshot(2010-03-21 18.34.29).png (160.59 KiB) Viewed 3509 times
Can you tell me how to use it? I can make it, but don't know how to edit.

Re: How to use Tiled

Posted: 21 Mar 2010, 12:44
by lien
swimmy wrote:
screenshot(2010-03-21 18.34.29).png
Can you tell me how to use it? I can make it, but don't know how to edit.
when you're on the object layer , when you're mouse is just on the object
right click
Image
"properties..."

Re: How to use Tiled

Posted: 21 Mar 2010, 13:03
by swimmy
Oh got it. Thanks. :)

Re: How to use Tiled

Posted: 21 Mar 2010, 13:21
by swimmy
2010-03-21 22.19.44).png
2010-03-21 22.19.44).png (18.91 KiB) Viewed 3473 times
Well, what's this mean, "dest_x" or "dest_y" ?
I thought it was a tile, but seems not.

Re: How to use Tiled

Posted: 21 Mar 2010, 13:37
by enchilado
-> Note: I haven't done this on a Mac, but it should be the same.

Adding Tiles

First of all, you need to tell Tiled what image you're going to use for your tileset. So, hit the button that says Map and select New Tileset...

Choose the image you want, and give it a name - anything will do. Make sure that Tile Width and Height are set to 32, and that Margin and Spacing are both 0.

A box should now appear alongside the Layers dialogue with all the tiles in it you can use. This is just the image you selected cut up into bits. Place the tiles where you want them, but remember to use the layers correctly according to the Mapping Guidelines on the Wiki. To add a layer, go Layer -> Add Tile Layer....


Adding Objects

Select Layer in the whatever-that-bar-is-called-on-a-Mac, then New Object Layer.... Now just click on the map wherever you want your object to appear and drag it to the right size.


Warp Points

Right-click the object and select Properties.... Fill it out like this:

Code: Select all

Name: toYourMap
Type: warp
You'll need three properties for a warp. Add them, and fill out the Name sides like this:

Code: Select all

dest_map
dest_x
dest_y
Then fill out the Value column:

Code: Select all

mapname
x coordinate (pixels)
y coordinate (pixels)
For example, if you wanted the warp to send you to the steps of Auldsbel's house, which in tiles is 51x 68y: because you need the coordinates in pixels, just take your tile coordinates and multiply by 32 (tiles are 32 pixels across), then add 16 so the player appears in the centre of the tile.

Code: Select all

Name: toWoodland
Type: warp
dest_map | 011-1
dest_x | 1648
dest_y | 2224
You can find the coordinates of a tile by holding the cursor over the tile you want in-game or in Tiled. In-game, hit F10 to display the Debug window, which has the map name and coordinates of the tile on it note that this is the tile with the cursor over it, not the tile you are standing on.
In Tiled, the coordinates should be displayed somewhere. On Ubuntu it is in the bottom left, I can't see the bottom left corner of Tiled in that screenshot but I assume it is the same.


Monster Spawn Points

Code: Select all

Name: Monstername
Type: spawn
This time, you'll need to put some properties like this:

Code: Select all

eA_death
eA_spawn
max_beings
monster_id
eA_death gives the minimum delay before respawning after the death of the entire mob, and eA_spawn is the minimum delay between spawns - both in milliseconds, probably.
Max_beings is the highest number of monsters allowed to spawn from that point, and monster_id is of course the monster's ID. A (probably) complete list of monsters and their IDs can be found here.
For example, three squirrels that take a while to respawn if you kill them all, but respawn very quickly if you only kill one:

Code: Select all

eA_spawn | 500
eA_death | 120000
max_beings | 3
monster_id | 36

Hope this helped, and thanks Freeyorp for showing me most of this :)

Re: How to use Tiled

Posted: 21 Mar 2010, 13:41
by swimmy
Okay, thanks for your help :)

Re: How to use Tiled

Posted: 21 Mar 2010, 14:30
by Crush
The target coordinates for map warp areas are in pixel coordinates, not tile coordinates. To get the pixel coordinates multiply the tile coordinates with 32.

Re: How to use Tiled

Posted: 21 Mar 2010, 14:34
by swimmy
Okay. I understand.
This topic is good for everyone also.

Re: How to use Tiled

Posted: 21 Mar 2010, 15:11
by Jaxad0127
Crush wrote:The target coordinates for map warp areas are in pixel coordinates, not tile coordinates. To get the pixel coordinates multiply the tile coordinates with 32.
Adding 16 too is preferred so characters land on the center of the tile. Most warps don't at the moment.

Re: How to use Tiled

Posted: 21 Mar 2010, 23:19
by swimmy
To be center, I calculated <tile number>*32-16. Or, <tile number>*32+16 preferred?

Re: How to use Tiled

Posted: 21 Mar 2010, 23:41
by Crush
plus 16

Re: How to use Tiled

Posted: 22 Mar 2010, 00:00
by enchilado
Actually, wouldn't -16 be better? If you want the player to appear on 2,2 then if you add 16 he's going to be on 3,3.
plusorminus.png
plusorminus.png (28.42 KiB) Viewed 3417 times
Blue shows 48,48 (minus 16) and red shows 80,80 (plus 16). 48,48 is actually on the 2,2 tile, whereas 80,80 is the tile to the top right of that.

Re: How to use Tiled

Posted: 22 Mar 2010, 00:04
by Crush
Poison ivy, two things are wrong in your line of reasoning.

1. Our coordinate system begins in the upper left corner, not the lower left.
2. Our coordinate system counts from 0, not from 1.

The upper left tile is tile 0:0.

The upper left pixel, which is the upper left corner of tile 0:0, is also 0:0.

Thus the center of the tile 0:0 is pixel 16:16.

Re: How to use Tiled

Posted: 22 Mar 2010, 00:32
by enchilado
I had the red in the bottom corner at first, then thought that was probably wrong. it doesn't matter anyway.

And okay, so it starts from zero. But what if I count the tiles beginning with zero? Use the same image. I count the first tile as zero, and the second as one; I want to make my player appear on 1,1. Same thing.

If you count the first tile as zero when counting out the tile, take 16; add 16 if you count the first tile as one.

If you get your tile coordinate from the game via the debug window, take 16, since this takes the tiles as they are numbered (beginning at zero).

Re: How to use Tiled

Posted: 22 Mar 2010, 02:00
by Crush
poison_ivy wrote:If you count the first tile as zero when counting out the tile, take 16; add 16 if you count the first tile as one.
Maybe you mean the other way around?

When you have tile 0:0 and you would subtract 16 you would be at -16.