ID:139881
 
Code:
client
proc
Save()
var/savefile/F = new("[ckey].sav")
F["mob"] << mob
// Do not add anything more to be saved here
Load()
if(fexists("[ckey].sav"))
var/savefile/F = new("[ckey].sav")
F["mob"] >> mob
// Do not add anything more to be loaded here

mob
Write(var/savefile/F)
..()
// Add any special processing for saving here
F["x"] << src.x
F["y"] << src.y
F["z"] << src.z
Read(var/savefile/F)
..()
F["x"] >> src.x
F["y"] >> src.y
F["z"] >> src.z
// Add any special processing for loading here


Problem description: My question is: How do I make it so that it works in the first place, and it saves your loc, verbs, and vars?

1) Learn the language so you know what to do other than copy code from the forums. This is not an overnight process.
2) Read on saving and use the forum search if necessary.
In response to Kaioken
1: I have learned it.
2: This stopped working out of the blue.
3: I didn't post this to get lectured on being lazy.
4: Once again, it worked, then broke for no reason.
Now please give me an answer.
In response to Colin1011
That code works fine.

So as kaio said it is advised to learn the language.

There is nothing wrong with that code besides lacking other stuff that could make it better but isnt needed.
In response to Colin1011
Colin1011 wrote:
1: I have learned it.

Well, I'm afraid otherwise is seen in your posts.
And at any case, you're certainly not good enough with the basics or doing something very wrong if you need to make 3 help topics in a single day.

3: I didn't post this to get lectured on being lazy.

Where was laziness mentioned? I'm telling you to learn to swim before you dive right in and drown, like you're doing now.
And if you want, you're free to learn lazily and take your time with it. =) Nothing's rushing you.

4: Once again, it worked, then broke for no reason.

If so, then how do you expect anyone to help you? It broke for no reason. There is no source problem here.
Needless to say, note that you also haven't even mentioned how it worked before and what is the exact issue now.

Now please give me an answer.

To what, precisely?
That code itself is functional, other than the location loading, which you've borked up after copying the code from Garthor's post. What you have there now looks like it'd work, but it won't.
So other than that, it should work, but you're not showing when you're even calling those procs, so we can't tell if you're doing it right.

About saving verbs and vars: that code saves the player's mob object, so most of its vars are automatically saved. Of course, you'd know this if you actually understood the code you swiftly copied. You'd also probably know how to add in saving the verbs list if you're comfortable with the language as well.

Until you are, there's not much I can help you with. I can feed you more code for you to blatantly copy, but that wouldn't improve or help anything. You'd just come running to the forums again afterward because you still don't know what you're doing nor do you fully understand the code you've copied.
In response to Kaioken
I'm sorry, it was late, and I was grouchy... but honestly, I've tried my best to learn this thing. It's just not working, so can you please help? You said that it should work, so I've changed it to client proc, like Garthor originally said, but that just gives me Connection Failed everytime I try to log on... please help. And as for multiple posts, the ones that were answered helped me learn more coding, so I don't have to post them all over again. The only one that keeps coming back to bite me in the butt is saving.
In response to Colin1011
Once again:
-The coordinates loading will NOT function properly.
-You haven't shown how and where you're actually attempting to call the procs you've shown.

Getting "connection failed" has nothing to do with saving itself. You're probably screwing things up in client/New(), not letting players log into the game (/ a mob) properly. I guess you're not ever calling the default function ( ..() ) or otherwise assigning the connecting player to a mob in client/New().

When you hook into object procs by writing "object/ProcName()" (note the lack of the "proc/" declaration), you're overriding those procs. That means what you wrote in the body of the override runs instead of the parent or default versions of the proc. To let the original proc actually run you need to call the parent (or default when applicable) proc in your override, which is done by the "..()" call.