ID:1919781
 
(See the best response by Ter13.)
Code:

Problem description:

Is there a way to change the speed in walk_toward proc in a pixel movement system? I already have stepsize=1 what I'm trying to do is change the tick lag dynamically. I tried to call walk towatds multiple times to pass different tick lag values but it won' work. Is there a way to do this by updating the tick lag value? and if no can i find the. source code for walk toward somewhere?
Best response
You don't want to change the tick_lag for the world dynamically.

Are you looking to take smaller steps than 1 pixel at a time?
Yeah that's what I'm after, sorry. didn't meant tick lag i meant the walk lag parameter messing with the lag settings i could make my units move. the way i wanted them to. But the thing is i don't know how to change itproperly to adjust the movement to the unit speed. My speefs range. from 4 to 12 pixels per second.
I don't understand your problem Victorqr. If I gather what you are saying, you just want to increase the lag for the walk_towards() proc, dynamically?


This script works fine:
mob/verb/Walk_Towards_Test()

var/turf/t = locate(50,50,1)
walk_towards(src,t,0,1)
sleep(50)
walk_towards(src,t,5,1)



Perhaps in your code, your references aren't correct? To be honest, I'm not sure what the problem is.
In response to Ss4toby
Ss4toby wrote:
I don't understand your problem Victorqr. If I gather what you are saying, you just want to increase the lag for the walk_towards() proc, dynamically?


This script works fine:
> mob/verb/Walk_Towards_Test()
>
> var/turf/t = locate(50,50,1)
> walk_towards(src,t,0,1)
> sleep(50)
> walk_towards(src,t,5,1)
>

Perhaps in your code, your references aren't correct? To be honest, I'm not sure what the problem is.

he wants to know how to speed it up as your walking towards the tile.
In response to Hebrons
Well, if he wants to speed it up, he would need to increase the pixel size once the lag hits 0. The example I provided displays how to update the walk_towards() procedure once you've started it. Which is a simple matter of calling it again.