obj/geoglyph
name = "Dark Mark"
icon = 'geoglyphs.dmi'
layer = MOB_LAYER -1
condor/icon_state = "condor"
proc/make_dark_mark(mob/M,objtype,ico_state,cx,cy,cz,xsize,ysize,newname)
set background=1
var/obj/Z
var/xl = 0
var/yl = 0
while(1)
Z = new objtype(locate(cx+xl,cy+yl,cz))
Z.icon_state = "[ico_state] [xl],[yl]"
Z.name = "[newname] Geoglyph"
yl+=1
if(yl>ysize-1)
yl = 0
xl += 1
M.ObjGrid += Z
if(xl<xsize) continue
break
mob/verb/Make_Geoglyph()
make_dark_mark(usr,/obj/geoglyph/condor,"condor",src.x-14,src.y-15,src.z,29,30,"Condor")
//for(var/turf/T in view(30,usr)) if(T.z == z) T.overlays += /obj/geoglyph/shade
mob/verb/Del_Geoglyph()
for(var/obj/geoglyph/G in usr.ObjGrid) del G
Problem description:
When i press Make Geoglyph its almost instant as it appears on the map. However when i press Del Geoglyph Dream Seeker seems to pause for quite a few seconds before it finally vanishs.
I added the objects to a list connected to the mob (ObjGrid), to avoid it having to sweep the world for those objects and hopefully saving some processing time/lag etc.
I'm not sure why it takes longer to delete the objects than it does to create them. Any thoughts? I'm a little concerned how the removal is going to affect the world on a live server.
Additionally, ive noticed what when i hit Close on the Dream Seeker window (while one of these is placed down on the map) then it takes its sweet time to close! About 3-5 seconds. Where as, closing it in all other circumstances its instant. Some issue with the code? I'm not really sure what though i think its about as good as it can be for the purpose of drawing a rather large 928x928 pixel image on a game map in real-time.