client/proc/Load(char_name)
var/mob/new_mob
var/savefile/F = base_PlayerSavefile()
_base_player_savefile = null
var/char_ckey = ckey(char_name)
F.cd = "/players/[ckey]/mobs/"
var/list/characters = F.dir
if(!characters.Find(char_ckey))
mob << "Savefile was not found."
return null
F["[char_ckey]/mob"] >> new_mob
if (new_mob)
mob = new_mob
new_mob.base_InitFromSavefile()
// If we're doing verbs, set them now.
if (base_save_verbs && new_mob.base_saved_verbs)
for (var/item in new_mob.base_saved_verbs)
new_mob.verbs += item
return new_mob
return null
client/proc/SaveMob()
if (!mob || !mob.base_save_allowed)
return
// If we're saving verbs, move them over now.
if (base_save_verbs)
mob.base_saved_verbs = mob.verbs
var/savefile/F = base_PlayerSavefile()
var/mob_ckey = ckey(mob.name)
var/directory = "/players/[ckey]/mobs/[mob_ckey]"
F.cd = directory
F["name"] << mob.name
F["mob"] << mob
_base_player_savefile = null
Problem description:
I set the game to save whenever a verb is pressed or when the person logs out, and the Load() proc is called whenever someone clicks a load game button.
Problem is, the game cannot find the savefile, and before I changed the coding to this, the game did load, but only if the saved mob's name was the same as your key...
Please help.