ID:1616504
 
Keywords: autojoinproblem
(See the best response by Ter13.)
Here is a screenshot of my issue (see the red circles). It forms perfectly as you can see looking at the purple, I just need to add additional corners to complete the edges (which I have).

The issue is how? The only solution coming to mind is creating the objects at runtime, but I've done that once before and it's not the best solution (it was terribly slow of course). All I'm looking for is a way to complete the edges without having to have them remade (again) or generating new objects/overlays/or images at runtime. Any suggestions?
My suggestion, make the interior corners objects that you can overlay ontop of the water that's already there which needs an interior waterline.



obj/Overlay

Water
layer = 3 // Change if needed. 3 is above turf which is 2.

Interior_NW
icon_state = "Interior NW"

Interior_NE
icon_state = "Interior NE"

Interior_SW
icon_state = "Interior SW"

Interior_SE
icon_state = "Interior SE"

turf
Water

proc/autoJoin()
// lade dade de

if(NW)
overlays += "Interior NW"

if(NE)
overlays += "Interior NE"

if(SW)
overlays += "Interior SW"

if(SE)
overlays += "Interior SE"
Best response
I actually made two libraries recently that I think will help you with this problem:

http://www.byond.com/developer/Ter13/AutotileEditor
http://www.byond.com/developer/Ter13/AutoMerge

My autotile editor will automatically generate all 47 variations of your autotile from a file that looks like this:



or like this:



Just export your dmi file, and include it in your project.

Next, set up your project to use autotiles by including this code into your project:

world
New()
..()
initialized = 1

var
initialized = 0

proc
fix_autotile(at)
. = 255
if((at & 7)!=7)
. ^= 2
if((at & 28)!=28)
. ^= 8
if((at & 112)!=112)
. ^= 32
if((at & 193)!=193)
. ^= 128
. &= at

turf
tile
var
tile_id = "tile"
autotile
var
prejoined = 0 //whether this autotile should be considered already initialized by the automerge utility
list/autotile_matches //the list of tile_ids this tile will merge with.
proc
retile()
var/list/l = list(get_step(src,NORTH),get_step(src,NORTHEAST),get_step(src,EAST),get_step(src,SOUTHEAST),get_step(src,SOUTH),get_step(src,SOUTHWEST),get_step(src,WEST),get_step(src,NORTHWEST))
. = 0
for(var/count=1;count<9;count++)
if(hasmatch(l[count]))
. += 2 ** (count-1)
. = fix_autotile(.)
src.icon_state = "[.]"

hasmatch(turf/tile/t)
if(t==null)
return 1
if(!istype(t,/turf/tile))
return 0
if(autotile_matches && t.tile_id in src.autotile_matches)
return 1
return 0
New()
if(global.initialized)
retile()
..()


Lastly, start plopping down instances of your autotiles on the map, then import the map into AutoMerge, and export the autojoined map.

The Automerge project will update your DMM to have autojoined tiles, then re-export it as a DMM for use again.

Enjoy!