When I run the game with Dream Daemon it shows up
runtime error: bad loc
proc name: New (/world/New)
usr: null
src:
call stack:
: New()
runtime error: Cannot read null.mob
proc name: SaveChar (/mob/proc/SaveChar)
usr: FiveUSSJ (/mob/Player)
src: FiveUSSJ (/mob/Player)
call stack:
FiveUSSJ (/mob/Player): SaveChar()
FiveUSSJ (/mob/Player): Logout()
My SaveChar() Proc:
SaveChar()
var/savefile/F = new("players/[src.ckey].sav")
F["name"] << name
F["X"] << src.x
F["Y"] << src.y
F["Z"] << src.z
F["Mob"] << usr.client.mob
While killing mob / getting killed by mob the following error appears:
runtime error: Cannot read null.exp
proc name: Death (/mob/proc/Death)
usr: Tontie (/mob/Enemy/Tontie)
src: FiveUSSJ (/mob/Player)
call stack:
FiveUSSJ (/mob/Player): Death(null)
Tontie (/mob/Enemy/Tontie): Bump(FiveUSSJ (/mob/Player))
Tontie (/mob/Enemy/Tontie): Move(the g027 (325,130,1) (/turf/ground/g027), 2)
Tontie (/mob/Enemy/Tontie): Wander()
Tontie (/mob/Enemy/Tontie): New(the g027 (228,107,1) (/turf/ground/g027))
My Death() proc:
mob
proc
Death(mob/killer)
if(src.HP<=0)
if(src.client)
if(src==killer)
world<<"[src] killed themself."
src.exp-=50
src.loc=locate(126,88,6)
src.HP=src.MHP
else
world<<"[src] has been killed by [killer]."
src.loc=locate(126,88,6)
src.HP=src.MHP
killer.exp+=src.level
killer.Level()
else
src.loc=locate(12,76,5)
killer.exp+=100
else
return
When you try to Load previous character game shows " entered the game" but nothing happens, your still on loading screen. Dream Daemon shows:
FiveUSSJ (/mob/Player): LoadCharacter()
LoadChar (33,44,7) (/turf/LoadChar): Click(LoadChar (33,44,7) (/turf/LoadChar), "default.map1", "icon-x=6;icon-y=15;left=1")
My LoadChar() proc:
mob
proc
LoadCharacter()
worldlog+="[src]/[src.key]([src.client.address]) enters game.<br>"
var/savefile/F = new("players/[src.ckey].sav")
var/X
var/Y
var/Z
var/mob/newmob = new()
F["name"] >> name
F["X"] >> X
F["Y"] >> Y
F["Z"] >> Z
F["Mob"] >> newmob
newmob.loc = locate(X,Y,Z)
newmob.client = src.client
Thanks for reading.
runtime error: bad loc
usr: null
DON'T USE USR!
In SaveChar:
runtime error: Cannot read null.mob
The line thats messing it up:
F["Mob"] << usr.client.mob
Again, don't use usr... Also put an if(client) before that line.
In Death()
runtime error: Cannot read null.exp
Death(null)
The mob/killer is null, so that means there is no killer, or whatever, so its messing up when you have:
So put an if(killer) or define the killer when you first call Death(Killer goes right here!).
Also, just re-do your whole load proc, why do you make a new mob when the player already is a mob? That makes no sense at all.