ID:822499
 
(See the best response by Kaiochao.)
Code:
runtime error: Cannot modify null.delay.
proc name: Move (/mob/Move)
usr: Asterr (/mob)
src: Asterr (/mob)
call stack:
Asterr (/mob): Move(Tile (10,7,1) (/turf/Tile), 8)
Asterr (/mob): Move(Tile (10,7,1) (/turf/Tile), 8)


Problem description: When I run my game and kill a monster, I get this message and i'm not quite sure what exactly the problem is. I'm new to coding and help would be much appreciated, thanks.

Can you please show the tile code.
In response to Dr.Penguin
If you mean my turf codes then...
turf
Grass
icon='Turfs.dmi'
icon_state="grass"
Sand
icon='Turfs.dmi'
icon_state="sand"
Tile
icon='Turfs.dmi'
icon_state="tile"
Stairs
icon='Turfs.dmi'
icon_state="stairs"
Flesh_Floor
icon='Turfs.dmi'
icon_state="fleshf"
Flesh_Wall
icon='Turfs.dmi'
icon_state="fleshw"
density=1
opacity=1
Wall
icon='Turfs.dmi'
icon_state="wall2"
density=1
opacity=1
Dungeon_Floor
icon='Turfs.dmi'
icon_state="floor"


It pretty much pops up for all turfs
Well there is a guide to runtimes too

http://www.byond.com/members/ DreamMakers?command=view_comments&post=37193

EDIT: if you don't understand or get anything post.
Show where you modify move, not your tile coding.
In response to Vocal_nebula
mob
Move()
. = ..()
for(var/mob/Monster/M in view())
if(usr.enemy==0)
walk_to(M,loc,1,5)
if(M in oview(1))
if(M.delay==0)
var/Damage = (M.lvl+10)*2/250*M.atk/usr.def*50+2
usr.hp -= Damage
view()<< "<font color= red>[M] attacks [usr]! <b>=></b> [usr] takes <b>[Damage]</b> Damage!"
usr.deathcheck()
M.delay=1
sleep(30)
M.delay=0
return

From what I read in the Runtime Error Guide, it's a common deathcheck error, I believe it's because i'm trying to edit the attack delay AFTER i've deleted the monster.
basically the error message is null.delay. but in the code it is m.delay. the error is suggesting that m is null. so i would say that you are correct is your assumption that the mob was removed before the check to m.
In response to Kalster
Before I mess around to see what works, any suggestions?
Why are you using a var to describe them
Best response
Let's read the run-time error.

runtime error: Cannot modify null.delay.
You're trying to access a variable, 'delay', on something that doesn't exist, 'null'.

proc name: Move (/mob/Move)
usr: Asterr (/mob)
src: Asterr (/mob)
The proc in which this problem occurs is mob.Move(), where Asterr is the usr and src (you moved yourself).

call stack:
Asterr (/mob): Move(Tile (10,7,1) (/turf/Tile), 8)
Asterr (/mob): Move(Tile (10,7,1) (/turf/Tile), 8)
The line of procs called in order until this error occurred. Move() is called twice because when you moved once near an enemy, walk_to() is called.


Some of this is irrelevant to the problem, but a lot of it does help. There would also be more information if you activated DEBUG mode in Dream Maker's Build preferences.

The problem:
mob
Move()
. = ..()
for(var/mob/Monster/M in view())
if(usr.enemy==0)
walk_to(M,loc,1,5)
if(M in oview(1))
if(M.delay==0)
var/Damage = (M.lvl+10)*2/250*M.atk/usr.def*50+2
usr.hp -= Damage
view()<< "<font color= red>[M] attacks [usr]! <b>=></b> [usr] takes <b>[Damage]</b> Damage!"
usr.deathcheck()
M.delay=1
sleep(30)
M.delay=0 // <-- Here
return

DEBUG mode would tell you the exact line of the error, but I have enough information to tell you that. During the time of sleep(30), M ceases to exist.

Solution:
M.delay = 1
sleep(30)
if(M) // Check if M still exists at this time.
M.delay = 0
In response to Kaiochao
Wow Thanks. I understood that the problem was because delay was being edited when M didn't exist, but I had a bit of trouble coming up with a solution.
Now regarding DEBUG mode which is located in "Build > Preferences", yes? It notifies me my errors and crash lines, but does it have any unwanted effects such as automatically deleting lines?
In response to Asterr
Asterr wrote:
Now regarding DEBUG mode which is located in "Build > Preferences", yes? It notifies me my errors and crash lines, but does it have any unwanted effects such as automatically deleting lines?

No, all DEBUG mode does is track some extra information. There aren't any unwanted effects. Theoretically it might slow the game down, but I don't think it makes a significant difference in practice.

Also, it looks like you're running your enemys' AI in your players' Move() process. I would suggest running AI separately in its own controlled loop, spawn()ed off in /mob/Monster/New().