ID:264924
 
Code:
turf
Grass
icon='Grass.dmi'
mouse_opacity=2
Click()
var/Ref="/obj/Tracks/[usr.Placed]"
var/obj/A=text2path(Ref)
var/obj/O = new A(src)


Problem description:
runtime error: Cannot create objects of type null.
proc name: Click (/turf/Grass/Click)
source file: Tracks.dm,8
usr: National Guardsmen (/mob)
src: Grass (2,7,1) (/turf/Grass)
call stack:
Grass (2,7,1) (/turf/Grass): Click(Grass (2,7,1) (/turf/Grass), "default.map1", "icon-x=26;icon-y=19;left=1;scr...")

I am confused on how I am trying creating a null object, from my understanding text2path converts a text string into a path I can use. But for some reason I keep getting the above runtime error, anyone care to explain to me what im doing wrong?

Confirm that the type path is defined (you can test that Ref is not null, for example). Also, casting the path returned by text2path() as a /obj is technically incorrect, but I don't think it would cause this.

If you need more assistance, can you give us an example of the value for usr.Placed and the related type path definition?
In response to DarkCampainger
mob
var/Placed
verb
Place(var/T as text)
src.Placed=T
obj
Tracks
icon='Tracks.dmi'
NORTH
name="NORTH"
icon_state="North"

And I am passing the verb Place argument as NORTH.
In response to National Guardsmen
Try using any name but NORTH. My guess is that this is a weird compiler bug, arising because you're using a constant's name for your type.

Also, try adding this test code:
world<<usr.Placed
world<<"/obj/Tracks/[usr.Placed]"
world<</obj/Tracks/NORTH
world<<text2path("/obj/Tracks/[usr.Placed]")
world<<text2path("/obj/Tracks/NORTH")
In response to DarkCampainger
Ok have tried all sorts of debugging as suggested. I still can't seem to get this to work. It stumps me that something this simple as got me in a bind.
In response to National Guardsmen
What was the output of the test code? Were they all the same? (Well, besides the first one)