The code pasted below is a stand-alone snippet found in the DM reference under the topic "Export proc (client)". Whenever I run the dmb and use the save() verb, upon the FIRST execution I get the following error which ultimately causes a proc crash:
runtime error: bad output
proc name: save (/mob/verb/save)
usr: Lethal Dragon (/mob)
src: Lethal Dragon (/mob)
Lethal Dragon (/mob): save()
The second, third time, etc, do not cause problems. The file saves as 0.sav inside my KeyInfo folder as a client side save, but not until the SECOND execution of the verb.
var/savefile/F = new()
F << usr //write the player's mob
var/client_file = Import()
var/savefile/F = new(client_file) //open it as a savefile
F >> usr //read the player's mob
This could very easily be related to Problem #1. In my code file I've written three procedures (as mob verbs). They save, load and delete the client side save. EACH of them work without error, except if I trigger the issue. I hit save, the file saves in my KeyInfo folder. I then hit delete, the file is removed from the KeyInfo folder and from memory. ***HOWEVER*** if I save the file, then either load it or try to overwrite it prior to deleting it, the file becomes "locked". By this I mean the file cannot be deleted at runtime nor can it be overwritten because it is being used by the program, apparently. So it is the case that the file, if altered or loaded, cannot be deleted until after closing out of the dmb file. Very bizarre.
if( !client.Import() )
var/savefile/SAVE = new()
SAVE = new() // Seems redundant but, if not included, this proc crashes upon its FIRST execution
SAVE["name"] << "Fish"
client.Export( SAVE )
var/savefile/SAVE = new( client.Import() )
var/HERE = SAVE["name"]
world << HERE