ID:141693
 
Code:
mob/verb/Savenow()
set name ="Save"
if(src.cansave)
var/savefile/F = new()
src.xco = src.x
src.yco = src.y
src.zco = src.z
F << src
src.V = src.verbs
src.client.Export(F)
src<<"<font color=red><b>Saved"

mob/proc/LoadPlayer()
var/client_file = src.client.Import()
if(client_file)
var/savefile/F = new(client_file)
F >> src
for(var/stuff in src.V)
src.verbs += stuff
world<<"<font size=1><font color=red><B>Info: <font color=white>[src]([src.key]) has logged in..."
src.loc=locate(src.xco,src.yco,src.zco)
client.view=6
src.OOC = 1
src.cansave=1
src.Frozen = 0
src.logincrap()
else
usr<<"No Savefile Found!"
return ..()


Problem description:
runtime error: Cannot execute null.Export().
proc name: SaveK (/mob/proc/SaveK)
usr: Jbozza (/mob)
src: Jbozza (/mob)
call stack:
Jbozza (/mob): SaveK()
Jbozza (/mob): Logout()
Jbozza (/mob): LoadPlayer()
Load (2,6,20) (/turf/Load): Click(Load (2,6,20) (/turf/Load), "default.map1", "icon-x=20;icon-y=27;left=1;scr...")
runtime error: wrong type of value for list
proc name: LoadPlayer (/mob/proc/LoadPlayer)
usr: Jbozza (/mob)
src: James (/mob)
call stack:
James (/mob): LoadPlayer()
Load (2,6,20) (/turf/Load): Click(Load (2,6,20) (/turf/Load), "default.map1", "icon-x=20;icon-y=27;left=1;scr...")

when I load I get that and i can't see a problem
The error shows you the problem is with SaveK() when the person logs out (meaning when SaveK() is called in Logout()).

mob/Logout() and client/Del() are both called when the client leaves. This means that you cannot have a client-side saving done in these procedures. The best you can do is auto-save every so often, or as I prefer, after an important event (ex: drop/pick up item, level up, spending/gaining money, etc).
In response to GhostAnime
i took out the auto save bit from Logout() but i still get an error msg when i load and it relogs me.

Info: Jbozza the Owner has joined the server!
runtime error: wrong type of value for list
proc name: LoadPlayer (/mob/proc/LoadPlayer)
usr: Jbozza (/mob)
src: James (/mob)
call stack:
James (/mob): LoadPlayer()
Load (3,6,20) (/turf/Load): Click(Load (3,6,20) (/turf/Load), "default.map1", "icon-x=7;icon-y=26;left=1;scre...")
Info: Jbozza() has logged out!
Info: Jbozza the Owner has joined the server!

could it be somthing to do with Login()
In response to Jbozza
It looks like the error is being caused by adding to the verbs list:
        for(var/stuff in src.V)
src.verbs += stuff


Is it possible that something other than a verb is in <code>src.V</code>?

Also, you should be able to replace your loop with a single line:
        src.verbs+=src.V
In response to Nickr5
It never did any of this for my old saving stuff just when I incorporated the Export() and Import()
In response to Jbozza
You need to embed the verb paths as text to the list, then when the list is added to the player's verbs, use text2path(). I ran into the same problem ;p
In response to Mizukouken Ketsu
For SAVING? I think not. You may be thinking of input().
In response to Jbozza
Info: Jbozza the Owner has joined the server!
runtime error: wrong type of value for list
proc name: LoadPlayer (/mob/proc/LoadPlayer)
usr: Jbozza (/mob)
src: James (/mob)
call stack:
James (/mob): LoadPlayer()
Load (3,6,20) (/turf/Load): Click(Load (3,6,20) (/turf/Load), "default.map1", "icon-x=7;icon-y=26;left=1;scre...")
Info: Jbozza() has logged out!
Info: Jbozza the Owner has joined the server!


The multiple logins/logout is probily becasue you are creating a new mob, then switching clients...it logs out the old mob and logs into the new one?

I always start the player as mob/newbie - then create mob/player, then load the save and the client into player.

Also, your adding the mob to F before the mob contains the verbs.
Code:
> mob/verb/Savenow()
> set name ="Save"
> if(src.cansave)
> var/savefile/F = new()
> src.xco = src.x
> src.yco = src.y
> src.zco = src.z
> F << src
> src.V = src.verbs
> src.client.Export(F)
> src<<"<font color=red><b>Saved"
In response to GhostAnime
GhostAnime wrote:
The error shows you the problem is with SaveK() when the person logs out (meaning when SaveK() is called in Logout()).

mob/Logout() and client/Del() are both called when the client leaves. This means that you cannot have a client-side saving done in these procedures. The best you can do is auto-save every so often, or as I prefer, after an important event (ex: drop/pick up item, level up, spending/gaining money, etc).


What about editing the skin to save on closing the window, then quitting?