ID:101399
 
BYOND Version:475
Operating System:Windows 7 Home Premium 64-bit
Web Browser:Firefox 3.6.8
Applies to:Dream Seeker
Status: Unverified

Thus far we've been unable to verify or reproduce this bug. Or, it has been observed but it cannot be triggered with a reliable test case. You can help us out by editing your report or adding a comment with more information.
Descriptive Problem Summary:
After granting DreamSeeker permission to load my safefile, I would get this error:
BYOND Error:(Sfile.cpp,1136) failed to open file:
BYOND Error:(Sfile.cpp,1136) ß\Users\USER\Desktop\NotV\Vamp 0.9\playersaves\killer22.sav
proc name: LoadPlayer (/mob/Character/proc/LoadPlayer)
source file: Character Handle.dm,71
usr: null
src: Character (/mob/Character)
call stack:
Character (/mob/Character): LoadPlayer()
Killer22 (/client): Load()
LoadC()

Numbered Steps to Reproduce Problem:
Basically I saved it, when I re-ran the application and attempted to load it, it would give me the previous run-time error.
Code Snippet (if applicable) to Reproduce Problem:
        proc
LoadPlayer()
..()
if(fexists("playersaves/[ckey].sav"))
winset(src, "1-Login", "is-visible=false;is-default=false;")
winset(src, "1-Main", "is-visible=true;is-default=true;is-disabled=false")
winset(src, "health", "is-visible=true;")
winset(src, "health_up", "is-visible=true;")
winset(src, "health_down", "is-visible=true;")
winset(src, "hp", "is-visible=true;")
var/coords[3]
var/savefile/F=new("playersaves/[ckey].sav") //<< Line 71. This is where the run-times directed me.
version=F["version"]
if(version<save_version) alert(src,"Your save file is out dated. The system will attempt to load what variables it can, but you may not receive all or any of the proper data.")
if(F.dir.Find("forum_info"))
F.cd="forum_info"
for(var/V in forum_info) vars[V]=F[V]
if(saveinfo=="true")
winset(src,"forum_user","text=[client.Decryption(username,20)]")
winset(src,"forum_pass","text=[client.Decryption(password,25)]")
winset(src,"forum_save","is-checked=true;")
else src<<"Save Corruption: forum_info could not be found in your save."
if(F.dir.Find("stat_info"))
F.cd="stat_info"
for(var/V in stat_info) vars[V]=F[V]
else src<<"Save Corruption: 'stat_info' could not be found in your save."
if(F.dir.Find("personal_info"))
F.cd="personal_info"
for(var/V in personal_info) vars[V]=F[V]
else src<<"Save Corruption: 'personal_info' could not be found in your save."
if(F.dir.Find("preferences"))
F.cd="preferences"
for(var/V in preferences) vars[V]=F[V]


Expected Results:
Should have loaded all my saved stats.
Actual Results:
Run-time error.
Does the problem occur:
Every time? Or how often?
Yes.
In other games?
This is the only game I've tried to save using this method.
In other user accounts?
I can't say for sure.
On other computers?
I can't say for sure.
When does the problem NOT occur?
It did not occur in the previous version of BYOND.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
I just said it didn't...
Workarounds:
None.
Another thing that occured:

BYOND Error:(Sfile.cpp,1136) failed to open file:
BYOND Error:(Sfile.cpp,1136) èller22.DynShip id=52134&hubpath=Killer22.DynShip&version&type=CÂ4
proc name: LoadPlayer (/mob/Character/proc/LoadPlayer)
source file: Character Handle.dm,71
usr: null
src: Character (/mob/Character)
call stack:
Character (/mob/Character): LoadPlayer()
Killer22 (/client): Load()
LoadC()

"ller22.DynShip id=52134&hubpath=Killer22.DynShip&version&type=CÂ4"

That library is NOT included. Why it would even be mentioned I have no idea.
Also seems to be a bug with DM tags.

Under line 71, this is what it should look like:
version=F["version"]
if(version < save_version) alert(src,"Your save file is out dated. The system will attempt to load what variables it can, but you may not receive all or any of the proper data.")
The version=F["version"] line is incorrect; loading from savefiles doesn't work that way.

To me it sounds like this is not a new bug, that something merely got corrupted in your savefile very recently and it's now loading incorrectly. The timing of the bug may simply be coincidental. It will probably do that on any version. (This is the most likely explanation since savefile code hasn't been touched since 469.) You should fix your code and retest in 475 to be sure something there isn't triggering it, and if it still happens then retest in version 474 to make sure that didn't cause any problems.

As a tip, when you download .zip files for older builds you can install their /bin files in a directory like /bin474 or something. Make sure you close your pager and everything else, and then you can open up that older version of BYOND by double-clicking byond.exe in the folder. If you start your game from the pager then it should run in 474 (be sure you verify which version is running by looking at Options & Messages).

Also just for future reference, it isn't very helpful to say something didn't happen in "the previous version"; you need to be specific as to which version. And to be positive, it's always a good idea to install an older build to retest, since particularly with savefiles the problem could be something that just came up with the file itself and might span versions.
To add on to Killer22's savefile Oddness, Which might be related in some form, I keep getting a bug (Version 475)...

Whenever I use
var/savefile/F = new("filename")
and attempt to write data to it it will return an error:
runtime error: bad output
proc name: Save (/Player/proc/Save)


However, the file is created (Empty), and when you attempt to save again it runs. and saves fine. It seems like Dreamseeker is trying to write the info to the file before creating it.
Then I tried creating a workaround, by making a blank file using text2file(null,"filename")
and saving after it has been created, but that failed, tried it again, Failed.... and on the third time I got this:
BYOND Error:(Sfile.cpp,337) error reading file node


However!!! In version 474 The file is created before data is attempted to be written, and it saves perfectly. So this is new to 475
You didn't specify which code is triggering the "bad output" message. I can't help you if you don't provide complete information.

Again, savefile code did not change in 475 so it is highly unlikely this is a new bug, but I'll need concrete code examples to work with to be sure.
Lummox JR wrote:
The version=F["version"] line is incorrect; loading from savefiles doesn't work that way.

Yes it does o.O Its the same as doing F["version"]>>version or reversed.
You can also just use them like: locate(F["LastX"],F["LastY"],F["LastZ"])
I'm having the same error. I think it might have something to do with ckey/key being in the file name of where it is saving.