mob
Login()
usr.loc = locate(5,5,2)
Rules()
..()
mob
proc
CreateChar(mob/M)
var/prompt_title = "Character Creation"
var/help_text = "What is your Character's name?"
var/default_value = "[usr.ckey]"
var/char_name = input(src, help_text, prompt_title, default_value) as null|text
if (!char_name)
alert("You have not chosen a name, please go back and do so now.")
src.CreateChar()
return
help_text = "What gender do you wish to be?"
var/list/gender = list("Male","Female")
default_value = "Male"
var/char_gender = input(src, help_text, prompt_title, default_value) in gender
switch(char_gender)
if("Male")
icon = 'boy.dmi'
level = 1
hp = 50
maxhp = 50
mp = 25
maxmp = 25
strength = 15
defense = 15
magicattack = 10
magicdefense = 10
speed = 1
gold = 2000
exp = 0
maxexp = 200
modlevel = 0
focus = 0
weapon = 0
armor = 0
access = 0
style = "Young Boy"
style_level = 0
style_exp = 0
style_maxexp = 100
if("Female")
icon = 'girl.dmi'
level = 1
hp = 50
maxhp = 50
mp = 25
maxmp = 25
strength = 10
defense = 10
magicattack = 15
magicdefense = 15
speed = 1
gold = 2000
exp = 0
maxexp = 200
modlevel = 0
focus = 0
weapon = 0
armor = 0
access = 0
style = "Young Girl"
style_level = 0
style_exp = 0
style_maxexp = 100
usr.loc = locate(5,2,1)
usr.sight = 0
char_name = name
world<<"<font color=red><b>[usr.name] has entered the stuggle for power.</b></font>"
..()
SaveChar()
var/savefile/F = new("players/[src.ckey].sav")
F["char_name"] << name
F["X"] << usr.x
F["Y"] << usr.y
F["Z"] << usr.z
F["Mob"] << usr.client.mob
verb
Save()
set category = "Chat"
usr.SaveChar()
usr << "Please Standby..."
sleep(5)
usr << "Your character has been saved."
mob
proc
LoadCharacter()
var/savefile/F = new("players/[src.ckey].sav")
var/X
var/Y
var/Z
var/mob/newmob = new()
F["char_name"] >> name
F["X"] >> X
F["Y"] >> Y
F["Z"] >> Z
F["Mob"] >> newmob
usr.loc = locate(usr.x,usr.y,usr.z)
world << "<font color=red><b>[usr.name] has entered the struggle for power.</b></font>"
mob
Logout()
world<<"<font color=red><b>[usr.name] has left the world.</b></font>"
del(src)
Problem description: Okay, first off, when you load a character it doesn't relocate the mob to its previous locate, like it should in the "usr.loc = locate(usr.x,usr.y,usr.z"). The second problem is that when you load a game, it says "(Your Byond Key Here) has left the world." instead of saying "([usr.name] has entered the struggle for power.". Now, the beginning piece works fine, I mean creating the character and so forth. The problem I guess is just basically the load proc. Any help is greatly appreciated.
Think you could try out my libary for your game? It's basicly whta you have here, you just have to overwride the NewGame(), and everything else is done for you.
http://developer.byond.com/hub/FlameSage/SavingLibary
If you can, this would help me out alot!