ID:270873
 
I know how to make an obj go moveing(useing walk). That is not the problem.
Heres what i did:
turf/grass
name = "Grass"
icon = 'Landscapes.dmi'
icon_state = "grass"
Entered()
view(src)<<"usr = [usr], src = [src]" //To show the grass and entered for testing only.
if(istype(usr,/obj/SandWave)) //usr is person(or object) entered
flick("sand",src) //src is the grass
else
view(src)<<"Aww" //Just to test.

Whenever i, myself went in, the usr came as me.
But when i sent the obj in, the usr was 0(null).
How would i fix it to know when the Sandwave is comeing?(Replaceing 0 with sandwave)
And only for sandwave nothing else.
The thing that Entered() the turf has to be defined like so

turf/grass
name = "Grass"
icon = 'Landscapes.dmi'
icon_state = "grass"
Entered(atom/movable/A) //A would be the thing that Entered() src (the turf)


Then you can run istype() and ismob()/isobj() etc checks.

turf/grass
name = "Grass"
icon = 'Landscapes.dmi'
icon_state = "grass"
Entered(atom/movable/A) //A would be the thing that Entered() src (the turf)
if(istype(A,/obj/SandWave))
flick("sand",src) //src is the grass


If you later want to actually use the obj, it's probably worth doing var/obj/O = A after if(istype()) because that gives you access to the obj variables.

I would recommend looking up what usr is, you seem to be confused.
In response to DeathAwaitsU
i know what usr is. and thanks, i'll try it.
In response to Chibi-Gohan0
Well if you know what usr is, why would you even consider doing the following?

if(istype(usr,/obj/SandWave)) //usr is person(or object) entered


Your comment, "usr is person(or object) entered", is incorrect. And doing istype(usr,/obj) just doesn't make sense.

In response to DeathAwaitsU
ok then.
In response to DeathAwaitsU
Thanks for the help, it works now.