ID:145566
 
New problem: Now I need a way to display the name of each file as the mob's name was saved. The text I need to grab from the file is inbetween 'name = "' and '"g', though file2text() won't work on "R".

Code:
obj/HUD
Load
icon_state="load"
Click()
var/loading
for(var/R in flist("Savefiles/[usr.ckey]/"))
loading+="<a href=?action=load&load=[R]></a><br>"
if(!loading) {usr<<"You do not have any savefiles.";return}
loading+="<a href=?action=close&target=Load>Close</a>"
usr<<browse(loading,"window=Load,can_close=0,size=300x300")

/*client/Topic()
if("load")
if(!href_list["load"]) return
usr<<browse(null,"window=Load")
usr.client.LoadMob(href_list["load"])

client
proc
LoadMob(T as text)
if(!T) return
var/savefile/F=new("Savefiles/[mob.ckey]/[T]")
F["Mob"]>>mob
mob<<"Successfully loaded."*/


Problem description: Any savefiles that contain spaces, when the link to load them is clicked, everything freezes.
Well, I don't see how a savefile name could have a space if it's based on ckey(), but I'm guessing the appalling strip_text() proc is to blame here.

What you need to do is strip out only a trailing .sav from the filename, not just any period, a, s, or v. Clearly strip_text() is not what you need here.

Of course, one other simple option is to ckey-ify every savefile name, not just the directory.

Lummox JR
In response to Lummox JR
I forgot to update my post- I changed that a long time ago. I figured out that the way I am doing it is the reason it isn't working for some reason or another, because if I ckey() the .sav file's name it works perfectly. Now I need a way to display the name of each file as the mob's name was saved.
In response to Artemio
Best bet is to store their actual name as a value in the savefile, if you're using the default Read() and Write() the 'name' variable should contain what you need (and 'key' for their actual key)
In response to Nadrew
Okay, thanks.