ID:262579
 
Code:
mob/verb/save()
var/savefile/F = new()
F << usr //write the player's mob
usr.client.Export(F)
usr<<"\blue<u><i><b>Saved!"


Problem description:
Heres the problem: Whenever i click save... it doesnt save. Can someone please send me coding in a way that it works or at least tell me wuts wrong?
Well, for one, you did not specify a file name. Secondly, I think you may want to use brackets just in-case you need to save something extra later. So, try
mob/verb/Save()
src<<"Saving..."
var/savefile/F=new("[src.key].sav")
F["Mob"]<<src
src.client.Export(F)
src<<"Saved!"
mob/verb/Load()
src<<"Loading..."
var/T=src.client.Import("[src.key.sav]")
var/savefile/F=new(T)
F["Mob"]>>src
src<<"Saved!"


It could be something wrong with your Read() and Write() proc if you have overwritten them.
In response to CaptFalcon33035
it says
insert proc.dm:944:error:src.ckey.sav:undefined var
In response to Ss4 core
Yes, he made the brackets too early. Instead of [src.key.sav] do [src.key].save .
Between, you don't need the src. I think...
In response to CIB
it still doesnt save anything not even my statistics
In response to Ss4 core
Well, it should actually work...
In response to CIB
Yeah, I ended the brackets too late, but apparently, you can't import files like that. Anyway, this should work.
mob/verb/Save()
src<<"Saving..."
var/savefile/F=new("[src.key].sav")
F["Mob"]<<src
src.client.Export(F)
src<<"Saved!"
mob/verb/Load()
src<<"Loading..."
var/T=src.client.Import()
if(!T) return
var/savefile/F=new(T)
F["Mob"]>>src
src<<"Loaded!"

As far as going to a different game and saving files to your computer, I don't know if it will work.
In response to CaptFalcon33035
how do i make it so i can import files like that?
In response to CaptFalcon33035
client.Import takes a query string. I believe hublib documents this in hubmsg.dm, but I'm not sure.
In response to Audeuro
Audeuro what do you mean?
In response to Ss4 core
Look up Import (client) in the reference. It says this is the prototype:

'Import(query)'

Then it describes the query, saying that it's documented in hublib.
In response to Audeuro
so your saying i cant add a save verb to my game?
In response to Ss4 core
what do i have to do to make it work?? do i have to start my coding all over again? or do i have to delete things or wut is it that i must do pllz tell me
In response to Ss4 core
If you happen to be using Deadron's saving system by any chance, the proc to call for saving is base_SaveMob()
In response to Sinoflife
That will be server-side saving unless that proc is modified
In response to Ss4 core
No, he's saying that it takes a query string. If no other games you play happen to be using client side-saving, nor any of the other games that the players of your game play use client side-saving, then you're fine using the following like stated before, but you've obviously not tested it.
mob/verb/Save()
src<<"Saving..."
var/savefile/F=new("[src.key].sav")
F["Mob"]<<src
src.client.Export(F)
src<<"Saved!"
mob/verb/Load()
src<<"Loading..."
var/T=src.client.Import()
if(!T) return
var/savefile/F=new(T)
F["Mob"]>>src
src<<"Loaded!"


He's also stating to look up hublib as the details of the query string are supposedly listed in there. So, study it. all you have to do is read.
In response to CaptFalcon33035
i have tested it