ID:178387
 
heres my code:
mob
pet
verb
Call_Pet()
set src in view(usr)
usr << "Come here [src]!"
walk_to(src,usr,2,2)

I want it so when the src finally gets to the usr and you begin to walk away it doen't keep on following you.
I tried putting the following after the walk_to proc but it didn't work

if(usr in oview(1))
move(src,0)
How about,

mob/pet/verb/CallPet()
set src in oview()
var/mob/M = usr
walk_to(src,M,1,5)
if(get_dist(src,M) <= 1)
walk(src,0,0)//halts


In response to Super16
Super16 wrote:
How about,

mob/pet/verb/CallPet()
set src in oview()
var/mob/M = usr
walk_to(src,M,1,5)
if(get_dist(src,M) <= 1)
walk(src,0,0)//halts



it didn't work. It still does the same thing
In response to EvilGotenks
mob/pet/verb/Call()
set src in oview()
walk_to(src,usr,1,0)
if(get_dist(src,usr)<=1)
walk_to(src,src,0,0)

ehheh
This seems like it would work:
mob/verb/petFollow()
var/mob/dog/D
for(var/mob/dog/M in oview())
D = M
break
walk_to(D,src,1)
spawn()
while(1)
sleep(1)
if(get_dist(D,src) == 1) walk(D,0)

Good luck!
In response to Super16
it still doesn't work. Just incase you didn't know know what I was trying to do here, I was trying to get it so that the dog quits following you when you after it reaches you within oview(1). What keeps on happening is that after I call the pet it runs next to me and everything seems fine until I go to move and it keeps on following me like a stalker or something.
I am pretty sure you should use step_to instead of walk_to. If you read the help file under each, I think you will see why.
<code> walk_to: Move Ref on a path to Trg continuously, taking obstacles into account. step_to: Move Ref on a path to the location Trg, taking obstacles into account. </code>

Hope that clears it up for you.

-Rcet