mob/proc/saveAllOverlays()
for(var/image/I in usr.overlays) // find every image in the overlays
usr.savedOverlays += I // save every image to a new list
usr.overlays = null // nullify the old list
for(var/image/I in usr.takeOffOverlays) // find every image that can be taken off
usr.TakeOffOverlays += I // save the images to a new list
usr.takeOffOverlays = null // nullify the old list
mob/proc/loadAllSaved()
for(var/image/I in savedOverlays) // find the saved images
usr.overlays += I // add the images back to the users overlays
usr.savedOverlays = null // nullify the saved images list
for(var/image/I in usr.TakeOffOverlays) // find the saved takeoff images
usr.takeOffOverlays += I // add the images back to the takeoff list
usr.TakeOffOverlays = null // nullify the saved takeoff images
mob
proc
Save() //this works but gotta figure out how to save location too
if(usr.x==9&&usr.y==42&&usr.z==1)
return // no saving at title_screen
F = new("/players/[usr.ckey].sav")//"/players/[usr.ckey].sav")
usr.saveAllOverlays() // call the saving all images procedure
usr.last_x = usr.x
usr.last_y = usr.y
usr.last_z = usr.z
F["mob"] << usr
F["last_x"] << usr.last_x
F["last_y"] << usr.last_y
F["last_z"] << usr.last_z
usr << "You're progress has been saved.[F]"
Load()
if(fexists("/players/[usr.ckey].sav"))
F = new("/players/[usr.ckey].sav")
F["mob"] >> usr
F["last_x"] >> usr.last_x
F["last_y"] >> usr.last_y
F["last_z"] >> usr.last_z
usr.loc = locate(usr.last_x, usr.last_y, usr.last_z) // locate the user where they last were
usr << "Welcome back [usr.handle]."
usr.loadAllSaved() // load all the images back
else
usr << "There are currently no saved files with your information."
return
verb/save()
usr.Save()
Problem description:The usr.saveAllOverlays() procedure doesn't even work ... like nothing happens ...? It has to work so all the images can be saved so that when you log out they're still there, and when you log in they return back to their original lists to be manipulated again (like being able to remove them and put them back on)
Lummox JR