After adding external tileset .tsx, the map layer do not show anything using Berry Engine

Hi,

I wanted to use an external tileset on my game taken from 

https://opengameart.org/content/lpc-terrains

I am using Berrys tiled engine.

However nothing appears on the map in the simulator

Video link :https://screencast-o-matic.com/watch/cFi33BFJoA

A bit puzzled what is going on. Code used for loading map :

berry = require( ‘pl.ldurniat.berry’ )

local map = berry.loadMap(‘Map/LEVEL-1.json’, ‘tilesets’ )

local visual = berry.createVisual( map )

visual.x = 0

visual.y = 0

@Idurniat : Perhaps you can comment on this?

Hi ahmed_shahjada,

Hi,

I wanted to use an external tileset on my game taken from 

https://opengameart.org/content/lpc-terrains

I am using Berrys tiled engine.

However nothing appears on the map in the simulator

Video link :https://screencast-o-matic.com/watch/cFi33BFJoA

Berry doesn’t support external tilesets. Use only embedded tilesets.

There are two ways to do this :

  1. When you create tileset just make sure you mark ‘Embed in map’ option,
  2. After you created tileset. Click button ‘Embed Tileset’ on bottom of Tileset View.

Have a nice day:)

ldurniat

So this means I cannot use TSX files from another project?

No. You can use .TSX files from another project:)

Follow this steps :

  1. Copy .TSX and images to folder with new map,
  2. Open map in Tiled,
  3. From menu select Map >> Add External Tileset… Choose correct .TSX file
  4. Embed tileset in map.

Note: During work with Tiled I always put maps, tilesets and images in the same folder that way I don’t have to worry about problems with incorrect paths.  

Unfortunately this is what I am getting :

WARNING: pl/ldurniat/TileSet.lua:79: Failed to find image ‘tilesets/terrain-v7.png’

Jul 23 07:08:50.675 ERROR: Runtime error

                    pl/ldurniat/Tile.lua:201: attempt to concatenate field ‘image’ (a nil value)

                    stack traceback:

                    [C]: in function ‘error’

                    ?: in function ‘gotoScene’

                    main.lua:5: in main chunk

It is working now, I realized my assets were not in the “tilesets” folder. This is quite embarrasing  :wacko:  :blink: 

@Idurniat : Perhaps you can comment on this?

Hi ahmed_shahjada,

Hi,

I wanted to use an external tileset on my game taken from 

https://opengameart.org/content/lpc-terrains

I am using Berrys tiled engine.

However nothing appears on the map in the simulator

Video link :https://screencast-o-matic.com/watch/cFi33BFJoA

Berry doesn’t support external tilesets. Use only embedded tilesets.

There are two ways to do this :

  1. When you create tileset just make sure you mark ‘Embed in map’ option,
  2. After you created tileset. Click button ‘Embed Tileset’ on bottom of Tileset View.

Have a nice day:)

ldurniat

So this means I cannot use TSX files from another project?

No. You can use .TSX files from another project:)

Follow this steps :

  1. Copy .TSX and images to folder with new map,
  2. Open map in Tiled,
  3. From menu select Map >> Add External Tileset… Choose correct .TSX file
  4. Embed tileset in map.

Note: During work with Tiled I always put maps, tilesets and images in the same folder that way I don’t have to worry about problems with incorrect paths.  

Unfortunately this is what I am getting :

WARNING: pl/ldurniat/TileSet.lua:79: Failed to find image ‘tilesets/terrain-v7.png’

Jul 23 07:08:50.675 ERROR: Runtime error

                    pl/ldurniat/Tile.lua:201: attempt to concatenate field ‘image’ (a nil value)

                    stack traceback:

                    [C]: in function ‘error’

                    ?: in function ‘gotoScene’

                    main.lua:5: in main chunk

It is working now, I realized my assets were not in the “tilesets” folder. This is quite embarrasing  :wacko:  :blink: