ID:139644
 
Code:
if(locate(/turf/tilledsoil)in usr.loc)


Problem description: Right there, I'm trying to check if the usr is on the turf 'tilledsoil'. However, it keeps telling me I'm not on the soil. Does anyone know why?

Because your loc is a turf, and turfs cannot contain turfs.

Look up istype()
In response to Garthor
So...
var/turf/Z=locate(/turf/) in world
if(istype(Z,/turf/tilledsoil))
if(Z.loc==usr.loc)
In response to Colin1011
No. Why are you trying to complicate things? You have a variable pointing to the object you are interested in, use it.
In response to Garthor
I'm sorry for not knowing as much coding as you. Do I define the turf first, then check if the user is standing on it?
In response to Colin1011
You use istype() to check the type of your loc.
In response to Garthor
What? As in:
istype(/turf/tilledsoil,loc)

?
In response to Colin1011
Yes, but the arguments go in the other order.