ID:274019
 

LoadCharacter(var/num){var/savefile/F = new("players/[src.ckey][num].dat");F["name"]>>src.name;src.Slot = num;world << "\red Server Information:<B>[src] the [src.race] has logged</B><font color = green> ON";world << src.Slot;src<<browse(null,Settings);return}

Problem:When i load my character its a black screen and my location doesn't show.
Post the Save proc and try setting the location to something when he loads. Maybe the location is not being saved.
In response to Avainer1 (#1)
Save(){var/savefile/F1 = new("players/[src.ckey][src.Slot].dat");F1["name"] << src.name; src<<"\red You have just saved!"}
In response to King-okal (#2)
See. You are not saving the usr's loc. So when he logs in, he has no location. That's why he faces a black screen. Make sure that it is being saved.
In response to Avainer1 (#3)
        LoadCharacter(var/num)
var/savefile/load
load = new ("players/[usr.key][num].dat")
load["mob"] >> usr
load["x"] >> usr.x
load["y"] >> usr.y
load["z"] >> usr.z
world << "\red Server Information:<B>[src] the [src.race] has logged</B><font color = green> ON"
src<<browse(null,Settings)
return

Says there isn't a defined varible called num
In response to King-okal (#4)
You must define LoadCharacter(var/num) when loading the proc ... ...

LoadCharacter(1)
In response to A.T.H.K (#5)
A.T.H.K wrote:
You must define LoadCharacter(var/num) when loading the proc ... ...

LoadCharacter(1)

Why var/num anyway?
Shouldn't it be LoadCharacter(num)? It's an argument after all.
In response to Kccmt (#6)
Kccmt wrote:
A.T.H.K wrote:
You must define LoadCharacter(var/num) when loading the proc ... ...

LoadCharacter(1)

Why var/num anyway?
Shouldn't it be LoadCharacter(num)? It's an argument after all.

I just followed suit of OP
In response to A.T.H.K (#7)
A.T.H.K wrote:
Kccmt wrote:
A.T.H.K wrote:
You must define LoadCharacter(var/num) when loading the proc ... ...

LoadCharacter(1)

Why var/num anyway?
Shouldn't it be LoadCharacter(num)? It's an argument after all.

I just followed suit of OP

Sorry, wasn't intended as a question to you as much as a general one :-)
In response to King-okal (#4)
mob/proc
LoadCharacter(slot)
var/savefile/load = new("players/[src.key]\[[slot]].dat")
ASSERT(load) //If savefile does not exists, the proc crashes.
load["mob"] >> src
src.loc = locate(load["x"], load["y"], load["z"])
if(src.loc == locate(0,0,0))src.loc=locate(1,1,1)

world << "\red Server Information:<b>[src] the [src.race] has logged</b> \green ON \red ."
src<<browse(null,Settings)
return TRUE //This way will allow you to make a check of type; if(usr.LoadCharacter(1))usr<<"Loaded!";return


That must do the trick, I will also make a save for you;

<dm>
mob/proc
SaveCharacter(slot)
if(fexists("players/[src.key]\[[slot]].dat"))fdel("players/[ src.key]\[[slot]].dat")
var/savefile/save = new("players/[src.key]\[[slot]].dat")
save["mob"] << src
save["x"] << src.x
save["y"] << src.y
save["z"] << src.z