ID:264070
 
:
var/list/HTML_TAGS = list ("<",">")
mob/proc/Check_For_Tags(T as text,var/list/L)
for(var/V in L)
if(findtext(T,V))
return TRUE


world
mob = /mob/game/
turf = /turf/
name = "Inuyasha Jewel of Four Souls"

client
proc
Load()
var/savefile/load
load = new ("Save Files/[src.mob.ckey]")
load["mob"] >> src.mob
load["x"] >> src.mob.x
load["y"] >> src.mob.y
load["z"] >> src.mob.z
Save()
var/savefile/save
save = new ("Save Files/[src.mob.ckey]")
save["mob"] << src.mob
save["x"] << src.mob.x
save["y"] << src.mob.y
save["z"] << src.mob.z
New()
..()
world << "[mob] has entered."
Del()
world << "[mob] has left."
src.mob.client.Save()
del src.mob


mob/game
Login()
var/list/L = newlist()
if(fexists("Save Files/[src.client.ckey]"))
L.Add(SUPER_NEW,SUPER_LOAD,SUPER_QUIT)
var/menu = input("Character File Found.","[world.name]") in L
switch(menu)
if(SUPER_NEW)
Create()
if(SUPER_LOAD)
src.client.Load()
if(SUPER_QUIT)
del(src)
else
L.Add(SUPER_NEW,SUPER_QUIT)
var/newmenu = input("Character File Not Found.","[world.name], \"New Player\"") in L
switch(newmenu)
if(SUPER_NEW)
Create()
if(SUPER_QUIT)
del(src)
..()
proc
Create()
var/mob/mobcreation
var/newname = input("Pick Character Name","Name",src.key)
if(lentext(newname) > 20)
src << "Your name can not exceed 20 characters."
Create()
if(isnull(newname) | newname == "" | !newname)
src << "Your name may not be of null."
Create()
if(Check_For_Tags(newname,HTML_TAGS) == TRUE)
src << "Your name may not have tags of html in them."
Create()
else
newname = html_encode(newname)
var/races = input("What race are you?","Race") in list ("Inuyasha","Kagome")
switch(races)
if("Inuyasha")
mobcreation = new/mob/Inuyasha()
mobcreation.race = "Inuyasha"
if("Kagome")
mobcreation = new/mob/Kagome()
mobcreation.race = "Kagome"
mobcreation.loc = locate(1,1,1)
mobcreation.name = newname
src.client.mob = mobcreation
del(src)

mob
var
race = "" as text
Stat()
statpanel("[name]")
stat("Race: [race]")
stat("Mob Type: [type]")
statpanel("Inventory")
stat(contents)
Inuyasha
icon = 'Inuyasha.dmi'
verb
Snow_Man_Verb()
world << "[src] Kagome ill save u!."
Kagome
icon = 'Kagome.dmi'
verb
Donut_Verb()
world << "[src] Inuyasha Help!."


:runtime error: Cannot read null.address
proc name: Login (/mob/Login)
usr: Sesshomaru XX (/mob/game)
src: Sesshomaru XX (/mob/game)
call stack:
Sesshomaru XX (/mob/game): Login() ok this only happens when i try to load a character... plz help


"address" isn't anywhere in that code. Do you have multiple Login() procs?

To help, could you put #define DEBUG in your code so the runtime errors would be more specific?
In response to Kaiochao
sure 1 second
In response to Kaiochao
nothing happpend the same thing it loged me out and gave me same message when i clicked load. i might just retype the whole login thing....change it around (sigh) unless you can point the error out
Sesshomaru XX wrote:
client
Del()
world << "[mob] has left."
src.mob.client.Save()
del src.mob


I can see two things wrong with that (well, one is kinda...)

1) src.mob.client is the samething as src here, as you are saying client.mob.client, which refers back to itself. You could've made it src.Save() and it would work the same.

2) In point#1, delete the whole line (yes, the whole "src.mob.client.Save()" line, or "src.Save()" if yopu wish).

The reason is simple. client/Del() is called when the client already left, so when the savefile tries to be exported, you'll get another 'null.' runtime error, because the client is already gone thus nothing to export to.

3) As Kaiochoa said earlier, put "#define DEBUG" somewhere. What this will do is, when you get a runtime error, it'll give you the file and approximate line the error occured at.
In response to GhostAnime
its still there this is whats pops up when i delete that line the same thing


runtime error: Cannot read null.address
proc name: Login (/mob/Login)
source file: Admin.dm,5
usr: Sesshomaru XX (/mob/game)
src: Sesshomaru XX (/mob/game)
call stack:
Sesshomaru XX (/mob/game): Login()
In response to Sesshomaru XX
Open Admin.dm and press CTRL G. Type in 5 to go to line 5, and post the procedure that the line 5 is in.
In response to Sesshomaru XX
o nvm it says admin dm or what ever what does that mean lol?
In response to Volte
if(client.address==null)

there it is
In response to Sesshomaru XX
We need to see the whole procedure that line is in so we know what's going on.
In response to Volte
um ok

mob/Login()
sleep(0)
spawn(0)
GMLevel=0
if(client.address==null)
if(!Host)
Host=key
AdminLoad()
PrefixCheck()
In response to Sesshomaru XX
The worst thing you could possibly do is delete the line that causes the problem. That would lead to even more problems.

Besides, if you're trying to do a check for the host to get verbs, as of BYOND 4.0, there's a world host variable containing the key of the host.
In response to Kaiochao
ok so what do i do to get rid of it
In response to Sesshomaru XX
(sigh) this is mind boggling takes compueter threatens to buy a new 1 hehe even tho it has nothing to do with problem
In response to Sesshomaru XX
As quoted in [link], it is always wise to safety check:
if(!Host && src.client && !src.client.address)
Host = src.key


It checks first if Host is defined. If it isn't, it'll check if it has a client. If it does, it'll check if the address is null (you should also findtext() for "192.168." or if it == "127.0.0.1" as they are internal IP addresses).

And, if you do have BYOND 4.0, you can do what Kaiochao mentioned in [link] and use the variable "world.host" and scrape the host-setting lines you may already have.