{"action":"created","issue":{"url":"https://api.github.com/repos/bjorn/tiled/issues/946","labels_url":"https://api.github.com/repos/bjorn/tiled/issues/946/labels{/name}","comments_url":"https://api.github.com/repos/bjorn/tiled/issues/946/comments","events_url":"https://api.github.com/repos/bjorn/tiled/issues/946/events","html_url":"https://github.com/bjorn/tiled/issues/946","id":76685684,"number":946,"title":"Auto-mapping rule map is inflexible and cumbersome for complex rules, allow lua script instead","user":{"login":"JonasT","id":1573352,"avatar_url":"https://avatars.githubusercontent.com/u/1573352?v=3","gravatar_id":"","url":"https://api.github.com/users/JonasT","html_url":"https://github.com/JonasT","followers_url":"https://api.github.com/users/JonasT/followers","following_url":"https://api.github.com/users/JonasT/following{/other_user}","gists_url":"https://api.github.com/users/JonasT/gists{/gist_id}","starred_url":"https://api.github.com/users/JonasT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonasT/subscriptions","organizations_url":"https://api.github.com/users/JonasT/orgs","repos_url":"https://api.github.com/users/JonasT/repos","events_url":"https://api.github.com/users/JonasT/events{/privacy}","received_events_url":"https://api.github.com/users/JonasT/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-15T10:34:31Z","updated_at":"2015-05-15T18:54:56Z","closed_at":null,"body":"I've just read through the auto-mapping introduction and while it seems useful for basic replacements, it seems way too cumbersome to maintain and use for advanced replacements like detecting all sort of wall tiles, then checking downwards to the distance of the next floor tile, and doing some shadow thing or something.\r\n\r\nOn the other hand, this would seem much more easily doable with a Lua script to me.\r\n\r\nTherefore, is there any possibility you could add an alternate way of providing auto mapping via a Lua script? The Lua script should have a callback issued that is triggered always when the user places a tile, and should then get access to the changed tile coordinates as well as all tilelayer contents + tile layer names + filename of the tileset used on them (this allows to apply special rules according to the tileset image name being \"watertiles01.png\" or something, or a tile layer being named \"ceiling\")."},"comment":{"url":"https://api.github.com/repos/bjorn/tiled/issues/comments/102491119","html_url":"https://github.com/bjorn/tiled/issues/946#issuecomment-102491119","issue_url":"https://api.github.com/repos/bjorn/tiled/issues/946","id":102491119,"user":{"login":"bjorn","id":531764,"avatar_url":"https://avatars.githubusercontent.com/u/531764?v=3","gravatar_id":"","url":"https://api.github.com/users/bjorn","html_url":"https://github.com/bjorn","followers_url":"https://api.github.com/users/bjorn/followers","following_url":"https://api.github.com/users/bjorn/following{/other_user}","gists_url":"https://api.github.com/users/bjorn/gists{/gist_id}","starred_url":"https://api.github.com/users/bjorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjorn/subscriptions","organizations_url":"https://api.github.com/users/bjorn/orgs","repos_url":"https://api.github.com/users/bjorn/repos","events_url":"https://api.github.com/users/bjorn/events{/privacy}","received_events_url":"https://api.github.com/users/bjorn/received_events","type":"User","site_admin":false},"created_at":"2015-05-15T18:54:56Z","updated_at":"2015-05-15T18:54:56Z","body":"Well, a Python plugin was indeed already written, but I didn't write it and I don't like the generated API code so it's unlikely to be integrated further into Tiled, at least by me.\r\n\r\nFor me the choice is between Lua and JavaScript. I used to lean more towards Lua because it's a simpler language and it's used a lot in game development. But now I lean more towards JavaScript. This is mainly because having JavaScript API available should eventually also help with moving towards a Qt Quick based version of Tiled (I've made a little progress with this on the `wip/qtquick` branch).\r\n\r\nIn any case, adding scripting support is something I already wanted to do for a long time but didn't get around to yet, as with many things. [Supporting me on Patreon](https://www.patreon.com/bjorn) helps me get around to things like this since I could spend more time on Tiled."}}