ID:146453
 
Code:
mob
proc
ChooseCharacter()
var/list/characters = src.CharacterList()

var/newCharacterChoice = "New Character"
var/DeleteCharacterChoice = "Delete Character"
var/list/menu = new()
menu += characters
menu += newCharacterChoice
menu += DeleteCharacterChoice

var/result = input("Character Creation") in menu

if (result == newCharacterChoice)
src.CreateCharacter()
if (result == DeleteCharacterChoice)
src.DeleteCharacter()
src.ChooseCharacter()
else
var/success = src.client.LoadMob(result)

if (success)
del(src)
else
src.ChooseCharacter()


client/proc/LoadMob(char_ckey)
var/firstletter=copytext(src.ckey, 1, 2)
var/savefile/F = new("players/[firstletter]/[src.ckey].sav")
F["/[ckey]/[char_ckey]"]>>src.mob

Problem description:
When i click Load character it loads their character but ur standing right in the middle of the title screen.

its mostly because you haven't saved the last location of the player >.>.

it loads the vars of the player. not the last location the player had.

heres a example:
client/proc/SaveMob()
usr.lastx=usr.x
usr.lasty=usr.y
usr.lastz=usr.z
var/firstletter=copytext(src.ckey, 1, 2)
var/savefile/F = new("players/[firstletter]/[src.ckey].sav")
var/char_ckey = cKey(src.mob.name)
F["/[ckey]/[char_ckey]"]<<src.mob

var/firstletter=copytext(src.ckey, 1, 2)
var/savefile/F = new("players/[firstletter]/[src.ckey].sav")
F["/[ckey]/[char_ckey]"]>>src.mob
src.loc=locate(usr.lastx,usr.lasty,usr.lastz)


I'm a little tired at the moment, so I think I did something wrong but I think it'll work.


O-matic
i may look stupid, but isnt that the Zeta Saving Code?
In response to SSJ4 Compufreak
SSJ4 Compufreak wrote:
i may look stupid, but isnt that the Zeta Saving Code?

yeah it is >.>

I aint good a save files, neither at charhandling. And I have a Zeta envoirment here, and I wanted to help. so I did it >.>.

but the save proc is ok you can use t there aren't any probs with it

btw I am using that save/load proc myself And I dont have any trouble with it.

O-matic
In response to O-matic
It can't be from zeta cause its from a rpg some1 made. and ur save proc is dif from mine