[PLUGIN] TMX importer

Post your completed addons to share with the community

Post » Tue Jun 04, 2013 9:59 am

@rexrainbow
here it is. if you change map to map4.tmx - log to console working, but if using map4_2.tmx - log to console won`t work.
example_tmx_importer2.capx
ImageImage
B
68
S
23
G
7
Posts: 186
Reputation: 9,786

Post » Tue Jun 04, 2013 5:22 pm

@SirG

[code] <tile id="0">
   <properties>
    <property name="tile_type" value="solid"/>
   </properties>
</tile>
<tile id="1">
   <properties>
    <property name="tile_type" value="map_changer"/>
   </properties>
</tile>[/code]

There are 2 tiles which have "tile-properties", tile id="0" , and tile id="1".
And, there are 2 layers named "terrain" , and "upper".
There is no tile id="1" in these 2 layers. Some are tile id="0". tile id="0" is a special tile which means "no tile here" (the start index of tile id is 1), I'm not sure why it has "tile-properties".

In this plugin, it will skip tile with tile id="0". So there is no tile which has "tile-properties" in these 2 layers. No message shown at log.rexrainbow2013-06-04 17:30:49
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Tue Jun 04, 2013 10:50 pm

@rexrainbow
[QUOTE]In this plugin, it will skip tile with tile id="0".[/QUOTE]
okay, now i`m understand where was problem.thanks!
ImageImage
B
68
S
23
G
7
Posts: 186
Reputation: 9,786

Post » Wed Jun 05, 2013 6:06 pm

@SirG

Does version 0.9 only have gzip format for saving? I could not save as uncompressed format or CSV format.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Thu Jun 06, 2013 3:51 am

@rexrainbow
settings - save tile layers as - csv
map - map settings - layer format - csv
ImageImage
B
68
S
23
G
7
Posts: 186
Reputation: 9,786

Post » Thu Jun 06, 2013 5:50 am

@SirG

Thanks, I got it.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Thu Jun 06, 2013 8:42 am

Update:

Try to support compression mode:"zlib" and "gzip"
The decompression lib is comes from imaya / zlib.js.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Thu Jun 06, 2013 2:10 pm

@rexrainbow
[QUOTE]Try to support compression mode:"zlib" and "gzip"[/QUOTE]
great! i`m waited for it)))
ImageImage
B
68
S
23
G
7
Posts: 186
Reputation: 9,786

Post » Sun Jun 09, 2013 3:51 pm

Hey Rex

It seems it's not possible to create a tile object by the tileset name it uses nor the layer it's in. Is that correct?

Here's what I'm trying to do:

I have a tileset named "TS_Blocks" and each tile in it has a property called "Type" that is a string. They are placed as tile objects in an object layer called "TS_Interactive"

I want to check if any tile objects are on the layer "TS_Interactive", then create the tiles, then set their animation to the "Type" property I gave them in the tileset.

I tried...

+On Each Object
+TMXImporter.LayerName = "TS_Interactive"
-Create tile at x,y
-Set animation to TMXImporter.ObjectType("Type")

but that won't even create the tiles. I then tried naming each tile object after its placed, then creating them by the object name instead, but then I could get it to retrieve the property "Type"! Any ideas?
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Mon Jun 10, 2013 6:08 am

@Tokinsom

Sorry, I could not catch your problem.

There is an example for creating tiles manually in first post.

The tileset name could be got by expression:TilesetName. Combined this string with my nickname plugin, you could create tiles by TilesetName. (Or use some string compare conditions)rexrainbow2013-06-10 06:09:59
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests