ID:141987
 
Code:
runtime error: Cannot execute null.LoadUp().
proc name: Click (/turf/Load/Click)
source file: turfs.dm,768
usr: null
src: Load (14,27,1) (/turf/Load)
call stack:
Load (14,27,1) (/turf/Load): Click(Load (14,27,1) (/turf/Load), "mapwindow.map", "icon-x=11;icon-y=12;left=1")


Problem description:Well... it makes the game crash...

Whatever clicked it isn't there anymore, so you can't load it. Add a little sanity check if(clicker).
In response to Jeff8500
Thats not it... when I click it loads my character perfectly... =S
In response to Cybork
The clicker can be a mob that was deleted in the loading process that you tried to access again. And it is the problem, because the runtime error would be different if it wasn't.

[EDIT]: usr abuse can also be the culprit here.
In response to Jeff8500
I have no Idea of what you talking about ?
These are my turf and proc codes:

turf/Load
density = 1
Click()
switch(alert("Which Slot do you wish to Select?","","Slot 1","Slot 2","Slot 3"))

if("Slot 1")
if(fexists("Player Saves/[usr.client.key]/Save File 1.sav"))
usr.save_file_1 = 1
usr.Load()
usr.LoadUp()
else
alert("No Saved File Found!")
sleep(5)
usr.loc = locate(8,27,1)
return
if("Slot 2")
if(fexists("Player Saves/[usr.client.key]/Save File 2.sav"))
usr.save_file_2 = 1
usr.Load()
usr.LoadUp()
else
alert("No Saved File Found!")
sleep(5)
usr.loc = locate(8,27,1)
return
if("Slot 3")
if(fexists("Player Saves/[usr.client.key]/Save File 3.sav"))
usr.save_file_3 = 1
usr.Load()
usr.LoadUp()
else
alert("No Saved File Found!")
sleep(5)
usr.loc = locate(8,27,1)
return

mob/proc
Loading()
if(src.mob.save_file_1)
var/savefile/load
load = new ("Player Saves/[src.mob.key]/Save File 1.sav")
load["mob"] >> src.mob
load["x"] >> src.mob.x
load["y"] >> src.mob.y
load["z"] >> src.mob.z
src.mob.loggedin=1

if(src.mob.save_file_2)
var/savefile/load
load = new ("Player Saves/[src.mob.key]/Save File 2.sav")
load["mob"] >> src.mob
load["x"] >> src.mob.x
load["y"] >> src.mob.y
load["z"] >> src.mob.z
src.mob.loggedin=1
if(src.mob.save_file_3)
var/savefile/load
load = new ("Player Saves/[src.mob.key]/Save File 3.sav")
load["mob"] >> src.mob
load["x"] >> src.mob.x
load["y"] >> src.mob.y
load["z"] >> src.mob.z
src.mob.loggedin=1

mob/proc
Load()
src.client.Loading()


mob/proc/LoadUp()
if(src.loggedin)
for(var/stuff in src.saveverbs)
src.verbs += stuff
src.CheckBan()
src.CheckPermaBan()
new/obj/hudMeters/health(src.client)
new/obj/hudMeters/chakra(src.client)
src.updateHealth()
src.updateChakra()
src.GMCheck()
src.safe=0
src.afk=0
world<<"<font size=1><font color=red><B>Naruto Lost Shinobi:<font color=white>[src]([src.key]) has logged in..."
src.loggedin=0
return
else
sleep(10)
src.LoadUp()


Can you help me solve this ?
In response to Cybork
turf/Load
density = 1
Click()
switch(alert("Which Slot do you wish to Select?","","Slot 1","Slot 2","Slot 3"))

if("Slot 1")
if(fexists("Player Saves/[usr.client.key]/Save File 1.sav"))
usr.save_file_1 = 1
usr.Load()
usr.LoadUp()
else
alert("No Saved File Found!")
sleep(5)
usr.loc = locate(8,27,1)
return
if("Slot 2")
if(fexists("Player Saves/[usr.client.key]/Save File 2.sav"))
usr.save_file_2 = 1
usr.Load()
usr.LoadUp()
else
alert("No Saved File Found!")
sleep(5)
usr.loc = locate(8,27,1)
return
if("Slot 3")
if(fexists("Player Saves/[usr.client.key]/Save File 3.sav"))
usr.save_file_3 = 1
usr.Load()
usr.LoadUp()
else
alert("No Saved File Found!")
sleep(5)
usr.loc = locate(8,27,1)
return


mob/proc
Loading()
if(src.mob.save_file_1)
var/savefile/load
load = new ("Player Saves/[src.mob.key]/Save File 1.sav")
load["mob"] >> src.mob
load["x"] >> src.mob.x
load["y"] >> src.mob.y
load["z"] >> src.mob.z
src.mob.loggedin=1//You never used client to set src.mob.loggedin as 1

if(src.mob.save_file_2)
var/savefile/load
load = new ("Player Saves/[src.mob.key]/Save File 2.sav")
load["mob"] >> src.mob
load["x"] >> src.mob.x
load["y"] >> src.mob.y
load["z"] >> src.mob.z
src.mob.loggedin=1//You never used client to set src.mob.loggedin as 1
if(src.mob.save_file_3)
var/savefile/load
load = new ("Player Saves/[src.mob.key]/Save File 3.sav")
load["mob"] >> src.mob
load["x"] >> src.mob.x
load["y"] >> src.mob.y
load["z"] >> src.mob.z
src.mob.loggedin=1//You never used client to set src.mob.loggedin as 1





mob/proc
Load()
src.client.Loading()//if i am wrong you use mob/proc/Loading not client/proc/Loading



mob/proc/LoadUp()
if(src.loggedin)
for(var/stuff in src.saveverbs)
src.verbs += stuff
src.CheckBan()
src.CheckPermaBan()
new/obj/hudMeters/health(src.client)
new/obj/hudMeters/chakra(src.client)
src.updateHealth()
src.updateChakra()
src.GMCheck()
src.safe=0
src.afk=0
world<<"<font size=1><font color=red><B>Naruto Lost Shinobi:<font color=white>[src]([src.key]) has logged in..."
src.loggedin=0
return
else
sleep(10)
src.LoadUp()



I am not exactly a pro programmer, but i noticed some weird stuffs there, hope i am correct, by the way


            load["x"] >> src.mob.x
load["y"] >> src.mob.y
load["z"] >> src.mob.z


I wouldn't call that a good way to load players's old locations :/


mob
Write(var/savefile/F)
..()
F["x"] << x
F["y"] << y
F["z"] << z

Read(var/savefile/F)
..()
var/x
var/y
var/z
F["x"] >> x
F["y"] >> y
F["z"] >> z
loc = locate(x,y,z)



I think that would be a better mode to save and load, players's locations :/



NOTE: This isn't a solve reply, i am just suggesting that. =)

Hope i helped anyhow


-Kenobi
In response to Danny Kenobi
Yeah but still it doesn't fix my problem =X
In response to Cybork
I never said it was a solve reply.
In response to Cybork
The problem is in the turfs code; learn to read your runtime errors for god's sake.
In response to Danny Kenobi
Never said you did =X
In response to Cybork
mob
Write(savefile/F)
..()
F["last_x"] << x
F["last_y"] << y
F["last_z"] << z


Read(savefile/F)
..()
var/last_x
var/last_y
var/last_z
F["last_x"] >> last_x
F["last_y"] >> last_y
F["last_z"] >> last_z
loc = locate(last_x, last_y, last_z)


I think that would help for saving and loading players's old locations


client
proc
SaveMob()



if(src.mob.cansave)
var/firstletter=copytext(src.ckey, 1, 2)
var/savefile/F = new("Saves/[firstletter]/[src.ckey].sav")

var/char_ckey = cKey(src.mob.name)
F.cd = "/[ckey]/[char_ckey]/"
F["mob"]<<src.mob
LoadMob(char_ckey)
var/firstletter=copytext(src.ckey, 1, 2)
var/savefile/F = new("Saves/[firstletter]/[src.ckey].sav")
F.cd = "/[ckey]/[char_ckey]/"
F["mob"] >> src.mob


mob
proc
ChooseCharacter()

var/list/characters = src.List_Chars()
var/nevermind = "Nevermind"
var/list/menu = new()
menu += characters
menu += nevermind
if(characters.len>3)
alert(src,"You have more than the maximum amount of characters, please delete your unused ones and try again")
src.DelChar()
else
var/result = input(src,"Character Loading") in menu
if (result == nevermind)
return

else


src.client.LoadMob(result)
del(src)
return
DelChar()
if(src)
alert("WARNING: Your about to select a character to delete.")
var/firstletter=copytext(src.ckey, 1, 2)
var/savefile/F = new("Saves/[firstletter]/[src.ckey].sav")

F.cd = "/[ckey]"
var/list/characters = F.dir

var/CancelCharacterDeletion = "Cancel"
var/list/menu = new()

menu += characters
menu += CancelCharacterDeletion

var/result = input("Delete character", "DELETE") in menu

if (result)
F.cd = "/[ckey]"
F.dir.Remove(result)


List_Chars()
var/firstletter=copytext(src.ckey, 1, 2)
var/savefile/F = new("Saves/[firstletter]/[src.ckey].sav")
F.cd = "/[ckey]"
var/list/characters = F.dir
return characters


turf
Delete
Click()
usr.DelChar()
Load
Click()
usr.ChooseCharacter()



Try using that, it's not actually mine, credit Masterdan. =P




-Kenobi