ID:151639
 
Okay I'm trying to find a way to make a map view of a Z level.

I looked at crispy's mapper and modified it a little.. to include a marker to show where the mob is.

Generally it provided a lot of lag and the browser map displayed after like 5 minutes, which is pointless to someone who wants a quick idea where they are. let alone a lot of lag.


So the reason I am posting is because I am about to start work on a sort of Z level overview that's sort of different from crispy's. I was hoping to use predefined maps to minimise the lag factor and have the map only locate the mobs. Should I go ahead and modify crispy's library even further to work with predefined maps( if I can ) or is there an easier way to do this.

EDIT:Current "Modified" Crispy Mapper Proc

turf
var
dontshow=0//turfs i dont want to be shown on map
mob/proc/cr_browsermap(zlevel=1,tilesizex=16,tilesizey=16,denytypes[0],windowname="map",browseopt="")
////////Send the map to the mob's browser window
var/filename="tmp_files/crmap[ckey].tmp"

//Display "please wait" message
src << browse("<body bgcolor=black text=white><p align=center>\
<font size=5 face='Verdana'>...please wait...</font></body>"
,"window=[windowname],\
size=
[min(world.maxx*16+50,630)]x[min(world.maxy*16+150,450)],[browseopt]")

var/html="<html><body bgcolor=black><table border=0 cellspacing=0 cellpadding=0>"

//If the temp. file exists, delete it
if (fexists(filename)) fdel(filename)

//Display everything in the world
for (var/y=world.maxy,y>=0,y--)
html+="</tr><tr>"
text2file(html,filename)
html=""
sleep()
for (var/x=1,x<=world.maxx,x++)
//Turfs
var/turf/T=locate(x,y,zlevel)
if (!T) continue
var/icon/I=icon(T.icon,T.icon_state)
var/imgstring=dd_replacetext("[T.type]-[T.icon_state]","/","_")

//Movable atoms
var/icon/G='target2.dmi'
var/icon/H='target3.dmi'
for (var/atom/movable/A in T)
//Make sure it's allowed to be displayed
if(A==src)//attempt
I.Blend(icon(G),ICON_OVERLAY)
imgstring+=dd_replacetext("__[G]","/","_")
if(A==src.targeted)//attempt
I.Blend(icon(H),ICON_OVERLAY)
imgstring+=dd_replacetext("__[H]","/","_")

//Output it
src << browse_rsc(I,"[imgstring].dmi")
html+="<td><img src=\"[imgstring].dmi\" width=[tilesizex] height=[tilesizey]></td>"

text2file("</table></body></html>",filename)

//Display it
src << browse(file(filename),"window=[windowname],\
size=
[min(world.maxx*16+50,630)]x[min(world.maxy*16+150,450)],[browseop