Tying Objects into C++ code?

54 views
Skip to first unread message

Axel Evans

unread,
Feb 18, 2012, 1:02:27 AM2/18/12
to Tiled Map Editor
Is there a specific way to give objects actual properties? And if it's
possible in Tiled, is there a page or document or something that
explains all of the different properties and object types in detail?
I'm looking to use Tiled to create maps for the game I'm working on,
but I can't quite figure out how I'm supposed to do more than draw the
map in the game, and then draw a sprite onto it. After that, I have no
idea what to do, because the program itself doesn't really explain
this too well.

If it's not possible in Tiled, can you explain how I'm supposed to
connect each object in the maps to specific code that makes it react
how I want it to? Like collision tiles, warp tiles, triggers, etc
etc...

Here's hoping there's an easy solution to my problem. Other than that,
the program is so easy and helpful.

sebbu

unread,
Feb 18, 2012, 9:23:52 AM2/18/12
to mape...@googlegroups.com
Hi,

The documentation of Tiled is pretty much in the wiki at https://github.com/bjorn/tiled/wiki, specifically TMX map format.
First, you create the map, add tileset(s), use tile layer(s) and put tiles on it.
For collisions, either you put properties on the tiles in the tileset(s), either you use a special tile layer (and a special tileset) in the map to say if the case is blocked or not, or which movements are blocked.
Warp tiles, triggers, etc... would usually be made using objects.
You can specify colors in the preferences for a type of objects to recognize them on the map.

Thorbjørn Lindeijer

unread,
Feb 18, 2012, 11:32:28 AM2/18/12
to mape...@googlegroups.com
On Sat, Feb 18, 2012 at 07:02, Axel Evans <aevan...@gmail.com> wrote:
> Is there a specific way to give objects actual properties? And if it's
> possible in Tiled, is there a page or document or something that
> explains all of the different properties and object types in detail?
> I'm looking to use Tiled to create maps for the game I'm working on,
> but I can't quite figure out how I'm supposed to do more than draw the
> map in the game, and then draw a sprite onto it. After that, I have no
> idea what to do, because the program itself doesn't really explain
> this too well.

I think what should be mentioned in addition to what sebbu said, is
that currently to edit the properties of an object you need to
right-click them and choose 'Properties...'.

> If it's not possible in Tiled, can you explain how I'm supposed to
> connect each object in the maps to specific code that makes it react
> how I want it to? Like collision tiles, warp tiles, triggers, etc
> etc...

Usually you fill in the type of the object in Tiled (in the object
properties dialog), and then use this type in your engine to determine
how to interpret the object and whatever custom properties it has.

> Here's hoping there's an easy solution to my problem. Other than that,
> the program is so easy and helpful.

That's always good to hear. :-)

Best regards,
Bjørn

Axel Evans

unread,
Feb 18, 2012, 2:05:32 PM2/18/12
to Tiled Map Editor
Okay, so, what I'm getting here is:

Any property set on an object is set in name only, and you have to
code in what it means in your source code or set it up to work
correctly in whatever else you're using.

In other words, if I wanted an area set to block the player from
stepping there, I'd have to set up an object in Tiled, and then tell
the system what the properties do, right?

I misunderstand people easily, is the only reason I ask. I just want
to make sure I don't mess this up.

Thorbjørn Lindeijer

unread,
Feb 18, 2012, 4:06:35 PM2/18/12
to mape...@googlegroups.com

You're exactly right. Tiled is a generic tile map editor, so it tries
to make minimal assumptions about what you may want to do with your
maps. Custom properties allow you to add the usually necessary
meta-information to your maps inside the editor, and you make your
engine interpret them the way you want. Of course some use-cases won't
be covered this way, but for many things it works fine.

Best regards,
Bjørn

Axel Evans

unread,
Feb 18, 2012, 4:11:14 PM2/18/12
to Tiled Map Editor
Okay, thanks. This helped a lot. I think I understand the whole thing
now. Thank you for the help! :)
Reply all
Reply to author
Forward
0 new messages