ID:263123
 
Code:
mob
proc
Load()
switch(alert("Which Savefile do you wish to load?","Load?","SaveSlot 1","SaveSlot 2","SaveSlot 3"))
if("SaveSlot 1")
if(fexists("savefiles/[src.ckey]1.sav"))
var/savefile/F = new("savefiles/[src.ckey]1.sav")
var/newX
var/newY
var/newZ
src<<"TEST1"
F["lastx"] >> newX
src<<"TEST2"
F["lasty"] >> newY
src<<"TEST3"
F["lastz"] >> newZ
src<<"TEST4"
F["usr"]>>src
src<<"TEST5"
src.loc=locate(newX,newY,newZ)
src<<"TEST6"
else
alert("No savefile found in the directory","ERROR")
return


Problem description:ok some reason the proc quits at test 4 what can i do to make go past that?

eh, probably a dumb idea sicne i cant code very well...but shouldent there be a space in

F["usr"]>>src
?
In response to Doom989
no it dont matter.
In response to National Guardsmen
well at least i can make you keep it tidy, eh?
In response to Doom989
I think this will work, not sure though since I am not any good with savefiles.

var/mob/M
F["usr"]>>M
src.client.mob=M
//other stuff.
del(src)


Also make sure you saved the mob into the savefile as "usr".

-Exophus
In response to Exophus
Bump. that didnt help it still wont place the user at the right location
In response to National Guardsmen
Try...
mob
proc
Load()
switch(alert("Which Savefile do you wish to load?","Load?","SaveSlot 1","SaveSlot 2","SaveSlot 3"))
if("SaveSlot 1")
if(fexists("savefiles/[src.ckey]1.sav"))
var/savefile/F = new("savefiles/[src.ckey]1.sav")
var/mob/M
F["lastx"] >> M.x
F["lasty"] >> M.y
F["lastz"] >> M.z
F["usr"]>>M
src.client.mob=M
del(src)
else
alert("No savefile found in the directory","ERROR")
return


I think that will work.