ID:269581
 
I am trying to write a piece of code that allows you to plant seeds. You can only do this on furtile land. Everytime I put the seeds on furtile land it says you cant plant these here. This is my code:

obj
seeds
icon = 'crops.dmi'
icon_state = "seeds"
verb
Plant(O as turf in oview(0))
set src in oview(1)
if(O == "/turf/furtile")
usr << "You have planted the seeds"
Grow()
else
usr << "You can not plant these here"

I think its something to do with the file name (/turf/furtile)
Could someone please help me!
ADT_CLONE wrote:
I am trying to write a piece of code that allows you to plant seeds. You can only do this on furtile land. Everytime I put the seeds on furtile land it says you cant plant these here. This is my code:

obj
seeds
icon = 'crops.dmi'
icon_state = "seeds"
verb
Plant(O as turf in oview(0))
set src in oview(1)
if(O == "/turf/furtile")
usr << "You have planted the seeds"
Grow()
else
usr << "You can not plant these here"
obj
seeds
icon = 'crops.dmi'
icon_state = "seeds"
verb
Plant()
set src in view(0)
if(istype(src, /turf/furtile))
usr << "You have planted the seeds"
Grow()
else
usr << "You can not plant these here"


Try that.
Note: This should make the Plant verb available only when standing on the "furtile" turf.

Hiead
In response to Hiead
thanks