I believe my primary problems here are
1. Getting some mysterious runtimes that I can't find any information about what they would mean in this context, so I would assume they are unusual, they only show up twice as shown below, which is unusual since they should show up hundreds/thousands of times or not at all.
BYOND Error: failed to write new icon. at :
proc name: New (/icon/New)
usr: Deangelo Jerome (/mob/dead/observer)
src: /icon (/icon)
usr.loc: the floor (154,258,1) (/turf/simulated/shuttle/floor)
call stack:
/icon (/icon): New('icons/turf/space.dmi', "19", 2, 1, 0)
getFlatIcon(space (2,28,1) (/turf/space), 2, 1, 0)
Clusterfack (/client): nanomapgen DumpTile(1, 1)
Clusterfack (/client): maprenders()
runtime error: BYOND Error: failed to write new icon.
proc name: New (/icon/New)
usr: Deangelo Jerome (/mob/dead/observer)
src: /icon (/icon)
usr.loc: the floor (154,258,1) (/turf/simulated/shuttle/floor)
call stack:
/icon (/icon): New('icons/turf/space.dmi', "19", 2, 1, 0)
getFlatIcon(space (2,28,1) (/turf/space), 2, 1, 0)
Clusterfack (/client): nanomapgen DumpTile(1, 1)
Clusterfack (/client): maprenders()
04:09:52 Runtime detected
bad icon operation at :
proc name: Blend (/icon/proc/Blend)
usr: Deangelo Jerome (/mob/dead/observer)
src: /icon (/icon)
usr.loc: the floor (154,258,1) (/turf/simulated/shuttle/floor)
call stack:
/icon (/icon): Blend(/icon (/icon), 3, 1, 1)
getFlatIcon(space (2,28,1) (/turf/space), 2, 1, 0)
Clusterfack (/client): nanomapgen DumpTile(1, 1)
Clusterfack (/client): maprenders()
runtime error: bad icon operation
proc name: Blend (/icon/proc/Blend)
usr: Deangelo Jerome (/mob/dead/observer)
src: /icon (/icon)
usr.loc: the floor (154,258,1) (/turf/simulated/shuttle/floor)
call stack:
/icon (/icon): Blend(/icon (/icon), 3, 1, 1)
getFlatIcon(space (2,28,1) (/turf/space), 2, 1, 0)
Clusterfack (/client): nanomapgen DumpTile(1, 1)
Clusterfack (/client): maprenders()
2. I'm not getting any files outputted into my directory which I'm not sure if I'm just bad at using the file procs (which I am), or whether the runtimes above are preventing my code from running properly, or whether something internal is breaking which is a definite possibility with this magnitude.
Code:
/client/proc/maprenders(var/currentz = 1, var/allz = 0)
var/icon/map = new/icon('maprender.png') //Size 16000x16000 pixels
to_chat(world, "Map Render: <B>GENERATE MAP FOR [allz? "ALL ZLEVELS" : "LEVEL [currentz]"]</B>")
for(var/z = 1 to 1) //Allz has yet to be implemented
for(var/x = 1 to world.maxx)
for(var/y = 1 to world.maxy)
//Finding turf and all turf contents
var/turf/currentturf = locate(x,y,z)
var/list/allturfcontents = currentturf.contents.Copy()
allturfcontents += currentturf
//Preparing variables
var/atom/holder
var/p
var/player
var/j
var/jlayer
//Simple Insertion sort Algorithm by layer
for(var/sort = 1 to (allturfcontents.len - 1))
p = allturfcontents[sort+1]
holder = p
player = holder.layer
j = sort
holder = allturfcontents[j]
jlayer = holder.layer
while(j >= 1 && jlayer > player)
allturfcontents[j+1] = allturfcontents[j]
j = j - 1
if(j)
holder = allturfcontents[j]
jlayer = holder.layer
allturfcontents[j+1] = p
//Preparing to blend get flat icon of (getflaticon may need to be replaced here)
for(var/atom/A in allturfcontents)
var/icon/icontoblend = getFlatIcon(A)
map.Blend(icontoblend, ICON_OVERLAY, (x-1)*world.icon_size, (y-1)*world.icon_size)
sleep(1)
world.log << "Completed row [x]"
var/icon/result_icon = new/icon()
result_icon.Insert(map, "", SOUTH, 1, 0)
fcopy(result_icon, "map[z].png")