ID:146403
 
Code:
mob
proc
Save()
var/savefile/F = new("players/[usr.ckey].sav")
F["x"] << src.x
F["y"] << src.y
F["z"] << src.z
Write(F)
src << "Saved!"

Load()
var/savefile/F = new("players/[usr.ckey].sav")
Read(F)
F["x"] >> src.x
F["y"] >> src.y
F["z"] >> src.z
src.loc = locate(x,y,z)
src << "Loaded!"
src.talkin = 0
src.move = 1
AddOverlays()//proc to add overlays from a list which were removed when you log out.
AddVerbs()// proc to add verbs.. same as above
Ghost()//proc to give a pet-like ghost


Problem description:
My Save/Load code (which i made myself before anyone asks - hence why its so basic >_>) is a little messed up.

I don't know exactly where the problem lies so i'll explain the situation.

Last night I and a few others were doing some testing on my game. I noticed that when i closed the game down and re opened.. only SOME people's games had saved, the others hadn't.

I kept deleting the old save files and trying again, and it happened every so often.

Anyone think they might know what the problem is.

I'm not askin for code to be posted, just help finding where the problem lies.

Cheers,

Farkas.

Did you the save proc in the mob's Logout()? Like so:

mob/Logout()
Save()
..()


It works for me and I can't see any reason your code wouldn't work if you didn't. You also might want to give players a save verb and warn them somewhere in the game that the save proc isn't 100% foolproof.
In response to Fartmonger
Fartmonger wrote:
Did you the save proc in the mob's Logout()? Like so:

> mob/Logout()
> Save()
> ..()
>

It works for me and I can't see any reason your code wouldn't work if you didn't. You also might want to give players a save verb and warn them somewhere in the game that the save proc isn't 100% foolproof.

I put the Save() proc in client/Del()

could that be the cause?

I'll try it out.

Cheers,

Farkas