ID:2409951
 
(See the best response by Kaiochao.)
Code:
    Login()
usr << "Welcome to Existance"
if(src.Loadproc())
world<<"[src] has Returned"
client.screen += src.contents
else
loc = locate(/turf/start)
client.screen += src.contents

Logout()
world << "Farewell, [src] has logged out."
src.Saveproc()
del src


mob/proc/Saveproc()
var/FileName="Players/[ckey(src.key)].sav"
if(fexists(FileName)) fdel(FileName)
var/savefile/F=new(FileName)
F["Level"]<<src.Level
F["Exp"]<<src.Exp
F["Nexp"]<<src.Nexp
F["Life"]<<src.life
F["Maxlife"]<<src.Maxlife
F["Str"]<<src.Str
F["Def"]<<src.Def
F["Lastx"]<<src.x
F["Lasty"]<<src.y
F["Lastz"]<<src.z
F["items"]<<src.contents
src<<"Character Saved"


mob/proc/Loadproc()
var/FileName="Players/[ckey(src.key)].sav"
if(fexists(FileName))
var/savefile/F=new(FileName)
F["Level"]>>src.Level
F["Exp"]>>src.Exp
F["Nexp"]>>src.Nexp
F["Life"]>>src.life
F["Maxlife"]>>src.Maxlife
F["Str"]>>src.Str
F["Def"]>>src.Def
F["items"]>>src.contents
src.loc=locate(F["Lastx"],F["Lasty"],F["Lastz"])
src << "Character Loaded..."


Problem description:

for some reason its not saving or loading? my mob location anymore.... it was working earlier dunno what i did. i always start in the start turf now instead of my last location. the inventory saves but i had to add client.screen += src.contents in the else for the screen inventory to show up when i log on.help! please.
Best response
The condition in Login that decides whether to send you to start depends on the return value of Loadproc, which appears to never return true.
so just add return TRUE? that seems to work... thanks!

Login to reply.