ID:230535
 
I'm trying to make it so I can save and loads the players type as a /mob/PC instead of /mob/Guest.

When the player first logs in the game treats them as /mob/Guest, after creating a character their type gets changed to /mob/PC. Now upon exiting the game and loading again they get changed back to /mob/Guest.

        Save()
var/savefile/F = new("Players/[src.key].sav")
F["dir"] << src.dir
F["icon"] << src.icon
F["icon_state"] << src.icon_state
F["overlays"] << src.overlays
F["underlays"] << src.underlays
F["name"] << src.name
F["contents"] << src.contents
F["hp"] << src.hp
F["max_hp"] << src.max_hp
F["mp"] << src.mp
F["max_mp"] << src.max_mp
F["level"] << src.level
F["class"] << src.class
F["race"] << src.race
F["exp"] << src.exp
F["tnl"] << src.tnl
F["gold"] << src.gold
F["bank_gold"] << src.bank_gold
F["items"] << src.items
F["affects"] << src.affects
F["str"] << src.str
F["con"] << src.con
F["dex"] << src.dex
F["int"] << src.int
F["wis"] << src.wis
F["cha"] << src.cha
F["last_x"] << src.x
F["last_y"] << src.y
F["last_z"] << src.z
src<<"Character Saved Succesfully."

Load()
if(fexists("Players/[src.key].sav"))
var/savefile/F = new("Players/[src.key].sav")
F["dir"] >> src.dir
F["icon"] >> src.icon
F["icon_state"] >> src.icon_state
F["overlays"] >> src.overlays
F["underlays"] >> src.underlays
F["name"] >> src.name
F["contents"] >> src.contents
F["hp"] >> src.hp
F["max_hp"] >> src.max_hp
F["mp"] >> src.mp
F["max_mp"] >> src.max_mp
F["level"] >> src.level
F["class"] >> src.class
F["race"] >> src.race
F["exp"] >> src.exp
F["tnl"] >> src.tnl
F["gold"] >> src.gold
F["bank_gold"] >> src.bank_gold
F["affects"] >> src.affects
F["items"] >> src.items
F["str"] >> src.str
F["con"] >> src.con
F["dex"] >> src.dex
F["int"] >> src.int
F["wis"] >> src.wis
F["cha"] >> src.cha
F["last_x"] >> src.last_x
F["last_y"] >> src.last_y
F["last_z"] >> src.last_z
src.loc=locate(last_x, last_y, last_z)
src<<"Character Loaded Successfully."
src.verbs += typesof(/mob/Basic/verb)
return 1
else
src<<"Character Unsuccesfully Loaded. Contact Liko if you feel this an error."
return 0
Just change their mob before loading their saved variables?
In response to Falacy
Falacy wrote:
Just change their mob before loading their saved variables?

I have tried. Then it loads with just the icon and the who command nothing else.
In response to Rikishi
Rikishi wrote:
Falacy wrote:
Just change their mob before loading their saved variables?

I have tried. Then it loads with just the icon and the who command nothing else.

Never mind. Got it work. Your idea work I just need to make it
src.client = new/mob/PC()
^ Huh?
In Load() proc before it loads the players save file. I have it switch its client to PC instead of Guest
Shouldn't it be src.client.mob?