@sebitttas, Tiled gives you a pretty good description of your tile map in Lua. The code generated looks like this:
[lua]return {…}[/lua]
How would I go about importing this? return without a function wrapper seems a little strange to me.
@Danny, I don’t really feel up to investing in Lime at this point.
Here’s a full code listing of some Tiled Lua output.
[lua]return {
version = “1.1”,
luaversion = “5.1”,
orientation = “orthogonal”,
width = 15,
height = 10,
tilewidth = 32,
tileheight = 32,
properties = {},
tilesets = {
{
name = “Scenery”,
firstgid = 1,
tilewidth = 32,
tileheight = 32,
spacing = 0,
margin = 0,
image = “…/Documents/X-Code/TileMappApp_1/Resources/Scenery.png”,
imagewidth = 192,
imageheight = 192,
properties = {},
tiles = {}
}
},
layers = {
{
type = “tilelayer”,
name = “Background”,
x = 0,
y = 0,
width = 15,
height = 10,
visible = true,
opacity = 1,
properties = {},
encoding = “lua”,
data = {
1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1,
1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1
}
},
{
type = “objectgroup”,
name = “Objects”,
visible = true,
opacity = 1,
properties = {},
objects = {
{
name = “SpawnPoint”,
type = “”,
x = 237,
y = 172,
width = 0,
height = 0,
properties = {}
}
}
}
}
}[/lua] [import]uid: 98652 topic_id: 20531 reply_id: 80695[/import]