How do I use the Tiled map editor with construct 2?

Get help using Construct 2

Post » Sun Aug 21, 2016 3:28 am

Message: tuskiomi can only post plain text URLS until they have 500 rep. 3 URLS modified. Why?
Hello all!

I've used a software for my level designing in c++ and java in the past called tiled: http://www.mapeditor.org/

I want to try to get the following map working from mapeditor into construct 2:
Image
This map is 64 x 64 tiles, and uses the tiles as palleted here:
Image

Tiled outputs a JSON file, in this case, the map's JSON file can be found on pastebin: http://pastebin.com/06qAUJKr

I have seen the tutorial here: https://www.scirra.com/tutorials/978/example-load-data-from-json-to-array-and-populate-game-card load data from json to array, but the lack of diverse examples still puzzles me. here is my current attempt, simmilar to the tutorial:
Image

and this produces the incorrect tileset, as it seems to look like so:
Image


This obviously means that the array isn't loading the data properly, but I cannot figure out for the life of me why it is not loaded, I've popped the data into multiple online parsers, yet this still baffles me. Could someone please enlighten me to the error of my ways?
B
4
S
1
Posts: 6
Reputation: 312

Post » Sun Aug 21, 2016 3:49 am

I'm not very familiar with tilemaps myself, but can't you load json data directly into the tilemap object? I don't think you need an intermediate array...
Mistakes were made.
B
49
S
24
G
107
Posts: 1,581
Reputation: 60,303

Post » Sun Aug 21, 2016 5:34 am

I might be missing the point of what you are trying to do, but is there any reason you don't want to use the tilemap object? You could import the tmx file and your tiles straight into C2 with that?
B
66
S
46
G
57
Posts: 387
Reputation: 35,721

Post » Sun Aug 21, 2016 5:43 pm

I'm trying to let my artists make maps and levels, and then be able to export them directly to JSON, which will then be loaded into construct 2.
B
4
S
1
Posts: 6
Reputation: 312

Post » Sun Aug 21, 2016 7:34 pm

you have two on start on layout ...it might be paralleling the action Try to take out the 2nd on start and use a timer delay of say 2 sec and then create the map. You might need to let the system process the data for the array before letting it populate i had the same problem well not in array but Ive had one instance where the dictionary for various things would not all load so it ended up glitching my learning of zelda tutorial.

Try that see if you come up with a different result?
B
51
S
24
G
6
Posts: 391
Reputation: 7,820

Post » Tue Aug 23, 2016 9:11 pm

Message: tuskiomi can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
So, I've figured out how to use this with the JSON plugin from here: https://github.com/FrenchYann/JSON_for_construct2

The problem now is; I cannot access the JSON nessecary for layers.

The JSON looks something like

Code: Select all
{
"layers":[
        {
         "name":"layer1",
         "data":[...]
        },
        {
         "name:"layer2",
         "data":[...]
        }]
}




As you can see, there is an array inside an array. Thus, I've changed my script to the following:
Image

However, the tilemap still comes out as above (only 15x15.)
B
4
S
1
Posts: 6
Reputation: 312

Post » Fri Aug 26, 2016 2:24 pm

bump
B
4
S
1
Posts: 6
Reputation: 312

Post » Mon Oct 24, 2016 6:44 pm

@tuskiomi
Have you figured out a solution yet? I recommend using TMX Exporter v2 by @rexrainbow. I would start with the older thread for the first version of the plugin because the operation is explained there in detail.
B
34
S
11
G
1
Posts: 62
Reputation: 2,666

Post » Mon Oct 24, 2016 11:35 pm

rex_tmx_importer_v2 could load tmx string, parse and fill the result into official tilemap object.
B
108
S
26
G
260
Posts: 4,435
Reputation: 146,193


Return to How do I....?

Who is online

Users browsing this forum: alextro and 1 guest