var/save_directory = "Savefiles/[src.key]/slot_1.sav"
if(fexists(save_directory))
winset(src,"loginpane.slot1text","text='Character detected in slot #1'")
var/savefile/s = new(save_directory)
var/mob/m = new
//somehow grab icon and overlays from savefile
m.screen_loc = "loginpane.slot1preview:1,1"
src.screen += m
Problem description:
I want to create a "character preview" at the login screen of my game (where the player can choose between the saved progressions they have). Unfortunately, my issue, is that I do not know how to read the necessary information from BYOND's savefiles to properly show a preview of the player's saved characters. There's a couple different methods I can think of, but the same hiccup occurs where I don't know how to go about reading the savefile in a way that will allow me to grab information.
Right now, all I know how to do is properly load a mob for the player's client to take control of (I was reading how whenever a mob with a key that matches a connected client's key, loads into the world, BYOND will automatically connect the client to it). But I was moreso wondering if there is a way to read a savefile's mob during runtime without loading the mob.
The first method I thought of is the most intuitive method, where you just read from the savefile directly with savefile["variable"] and stuff, but that didn't work since the only thing to grab from a savefile in my situation is savefile["mob"]. I don't know how to go deeper into the savefile to grab other variables.
The next method was to load the mob anyways, copy it after nulling the key variable, then deleting the loaded mob (keeping the copy to play with for the preview and stuff). But I want to do this preferably without loading a mob entirely. I understand if that's the only way, though.
And the last method, which I haven't tried yet, was to use a separate savefile to be used just for previewing the saved character's appearances for the preview purpose, so I can do the first method without having to delve deeper into the savefile through some awkward manner (most likely file2text() and stuff).
EDIT
After updating to build 510, it's no longer a black square. It's just blank. Nothing happens when I screen_loc a mob and add them to the client's screen.