i currently use.
#define savedir "Saves/[copytext(ckey,1,2)]/[ckey].sav"
#define savedirtxt "Saves/[copytext(ckey,1,2)]/[ckey].txt"
mob/proc/Save()
var/txtfile = file(savedirtxt)
var/savefile/F = new(savedir)
src.icon = null
src.overlays = null
key = null //DEBUG -- I need to remove the key from the save file
// so that when i use the save file (it gets read) it doesn't muck with my system.
// it needs to turn the savefile into an additional mob (3 to be exact) for displaying.
// but i want the player to still be able to play on. but when key goes null we all know what happens..
// WHAMMY disconnection which is an obvious reaction i knew it before i even typed it but other attempts failed.
F["Slot[src.player_slot]"] << src
fdel(txtfile)
F.ExportText("/",txtfile)
src.Builder_Player()
so pretty much using the code above i need to be able to change the directory of the save preferably using F.cd and i need to navigate to "key" then remove it - AFTER all the rest has been saved in. that way - heres hoping- players can play on after clickin the verb that links directly to that proc and not be disconnected.
also i need it to delete the location or w.e so its not on the map while it gets outputted (as it does atm)
because as it stands currently it creates the mob in the same location as usual things (as expected) but currently does not delete them/move them outta a view range so others may be confused by it.
Further code snips for reference.
mob
proc
login_previews()
src << "Vaaaa"
if(fexists(savedir))
var/savefile/F = new(savedir)
var/mob/slotone
F["/Slot1"] >> slotone
src << "[slotone.name]"
slotone.Builder_Player() //this just makes the char with vars instead of savin info.
src << output(slotone, "login_preview1:2,2")
// the above code is the reason i need to remove key.
//and heres a cut of my save file using the current proc in the first dm tags.
Slot1 = object(".0")
.0
type = /mob/human/player
savefile_version = 1
player_slot = 1
player_active = 1
strength = object(".0")
.0
type = /statpad
baselevel = 1
expcurrent = 0
expneeded = 50
dexterity = object(".0")
.0
type = /statpad
baselevel = 1
expcurrent = 0
expneeded = 50
control = object(".0")
.0
type = /statpad
baselevel = 1
expcurrent = 0
expneeded = 50
unknown = object(".0")
.0
type = /statpad
baselevel = 1
expcurrent = 0
expneeded = 50
stamina = object(".0")
.0
type = /valuepad
baselevel = 10
expcurrent = 0
expneeded = 100
maximum = 100
current = 100
mana = object(".0")
.0
type = /valuepad
baselevel = 10
expcurrent = 0
expneeded = 100
maximum = 100
current = 100
holder_obj1 = list()
equipment = list()
banked = list()
skills = list()
skills2 = list()
name = "Dsdsdsdsd"
SavedX = 9
SavedY = 9
SavedZ = 2
i think i supplied enough information to try get a solution. if not just post and ill supply any needed info.
Ive had no luck with using cd so far to the ends that i need them after quite afew different attempts. knowing me its prolly something simple, id prefer to use the simple and clean f << src method of saving as its cleaner as opposed to the currently popular f << "mana", f << "hp etc etc.
i guess the most effective way is if i can get the reading of the savefile to work properly is to just pull the vars needed and export them to a new mob as opposed to loading the entire mob. and then just dump the mobs in a zone.. but then ill need some way to delete those mobs so there not causing unneeded clutter..
or i could try make an "image" of everything of slotone (the mob preview) and just display that. but im having no luck with that either =\
Need thoughts
Thanks in Advance.
~Midget