ID:833865
 
Code:
                for(var/mob/V in world)
if(V.ckey == M)
V << output("<font color = blue>[A.name] is your word.", "gameLOG.output2")
drawing = V.ckey
world << output("<font color = blue>[V.name] is going to draw!", "gameLOG.output2")
for(var/turf/Blank/C in world)
V.coloring = V.defaultcc
V.DrawOn(C)
V.coloring = V.defaultcolor
started = 1
processing=0


Problem description:
On initiating the proc that contains the above, it gives me the following error:
{
runtime error: Cannot read null.coloring
proc name: DrawOn (/mob/proc/DrawOn)
}

and

{
runtime error: Cannot read null.coloring
proc name: DrawOn (/mob/proc/DrawOn)
usr: null
src: Alitron123 (/mob)
call stack:
Alitron123 (/mob): DrawOn(Blank (1,1,1) (/turf/Blank))
: NewRound()
: NewRound()
: New()
}
This proc uses the DrawOn() command on all turfs.
The DrawOn() command uses the blend function to change the color of the turf to the mob's coloring var.
Apparently it takes the mob as null. Any explanation?
If you enable debug mode, runtime errors will give you a line number. Until then, I can still guess.

I'd like to see more of what DrawOn() does.
        DrawOn(turf/T)
if(T)
if(T.currentc == usr.coloring) return
if(!istype(T, /turf/Blank)) return
var/icon/G = icon(T.icon)
T.icon = G.Blend(usr.coloring, ICON_OVERLAY)
T.icon = G
T.currentc = usr.coloring


{
runtime error: Cannot read null.coloring
proc name: DrawOn (/mob/proc/DrawOn)
source file: Mob.dm,40
usr: null
src: Alitron123 (/mob)
call stack:
Alitron123 (/mob): DrawOn(Blank (1,1,1) (/turf/Blank))
: NewRound()
: NewRound()
: New()
}

Mob.dm, line 40:
                if(T.currentc == usr.coloring) return

Part of DrawOn(turf/T)It is a mob proc btw.


        DrawOn(turf/T, mob/M)
if(T)
if(T.currentc == M.coloring) return
if(!istype(T, /turf/Blank)) return
var/icon/G = icon(T.icon)
T.icon = G.Blend(M.coloring, ICON_OVERLAY)
T.icon = G
T.currentc = M.coloring

Okay, so I fixed the errors by doing this.
But I still don't get why it was null.coloring in the error.
You shouldn't use usr in a process, and this is exactly why. Look at your error again:

runtime error: Cannot read null.coloring
proc name: DrawOn (/mob/proc/DrawOn)
source file: Mob.dm,40
usr: null
src: Alitron123 (/mob)
call stack:
Alitron123 (/mob): DrawOn(Blank (1,1,1) (/turf/Blank))
: NewRound()
: NewRound()
: New()


There is no usr, it's null. So trying to access usr.coloring throws an error which says "Cannot read [current_value_of_usr].coloring".
I do realize that, but my question was: why was the usr not considered? I use usr in most other procs, I do not get such errors.
usr is considered. In this case, for whatever reason, usr is not src. This is why you should use src in procs.
In response to Alitron123
usr is only set when a player initiates the action (ie it's called by a verb or certain player-centric processes like Click()). The call stack has it starting in something's New(), maybe the world's, which would not have a usr.