Lua plugin: Write out tile terrain information

Turns out I need this for a my current project so it must be useful.