Tiled (Map Editor)

The place for any Hollywood tutorials

Tiled (Map Editor)

Postby Bugala » Tue Apr 09, 2013 12:01 pm

This is not actually a tutoria, but just thought to share knowledge about this, since others might find this useful too.

There is this Map Editor called "Tiled": http://www.mapeditor.org/


It has an option to Export your map file as .lua file.

This file will result in foloowing:

Code: Select all
return {
  version = "1.1",
  luaversion = "5.1",
  orientation = "orthogonal",
  width = 20,
  height = 11,
  tilewidth = 96,
  tileheight = 96,
  properties = {},
  tilesets = {
    {
      name = "isometric_grass_and_water",
      firstgid = 1,
      tilewidth = 96,
      tileheight = 96,
      spacing = 0,
      margin = 0,
      image = "Programs/Tiled/examples/isometric_grass_and_water.png",
      imagewidth = 256,
      imageheight = 384,
      properties = {},
      tiles = {}
    }
  },
  layers = {
    {
      type = "tilelayer",
      name = "Tile Layer 1",
      x = 0,
      y = 0,
      width = 20,
      height = 11,
      visible = true,
      opacity = 1,
      properties = {},
      encoding = "lua",
      data = {
        1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        1, 1, 1, 1, 3, 4, 1, 1, 1, 1, 1, 0, 3, 3, 3, 0, 0, 0, 0, 0,
        1, 1, 1, 1, 5, 6, 1, 1, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0,
        1, 1, 1, 1, 7, 8, 1, 1, 1, 1, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0,
        1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
        0, 3, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 3, 0, 0, 0, 0, 0,
        0, 3, 3, 3, 3, 3, 3, 3, 3, 0, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
      }
    }
  }
}



As Hollywood is based upon LUA, you can easily see how this is almost right away usable to any hollywood project.


Tiled has quite a lot of features in it on making your maps, and this was just example code of simple 1 layer 2 dimension map without any extras like tile properties, objects...
Bugala
 
Posts: 642
Joined: Sun Feb 14, 2010 8:11 pm

Re: Tiled (Map Editor)

Postby tolkien » Tue Apr 09, 2013 11:56 pm

Very interesting and usefull....Lets try it.
tolkien
 
Posts: 147
Joined: Sun Oct 17, 2010 10:40 pm
Location: Spain


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest