Something like this ... sorry not tested - just typed into the post ..
Function SaveMap() Count = 0 for t.tile = each tile Count = Count + 1 next mapout = writefile( "Blah" ) writeint( mapout, count ) for t.tile = each tile writeint( mapout, t\xnum) writeint( mapout , t\ynum) writeint( mapout, t\mode ) next closefile mapout
function LoadMap() mapin = readfile( "Blah" ) count = readint( mapin ) for l = 1 to count t.tile = new tile t\xnum = readint( mapin) t\ynum = readint( mapin) t\mode = readint( mapin) next closefile mapin end function