ID:158198
 
How do i make a Character move Slower/Faster?

-Is there like a proc or something?
Take a look at the move_delay variable in MacroMove.
You already move as fast as possible. If you want to control movement speed, your only option is to manually delay movement.

mob
var
speed = 10 // our speed! in abstract numbers! (10 is average!?)
next_step = 0 // based on world.time. stamp for when we can move again.

Move(turf/new_loc, dir)
// you might want to do something like check dir to make sure we're "stepping" or redefine the client movement functions for this part.
// since it uses Move() to move them around the map naturally (not just stepping).
if (world.time < next_step) return // we can't move yet

// start moving
. = ..()
if (!.) return // we failed to move. do nothing.

// when can we move next?
var/delay = 50-speed // 5 seconds is the maximum delay (0 speed)
next_step = world.time+delay
In response to Keeth
Thanks guys
In response to Keeth
Going to point out that while you wrote "5 seconds is the maximum delay", that's not true. You could have a negative speed.

Also, next_step needs to be tmp/next_step, so it doesn't save.
In response to SuperAntx
I had troubles with this for a while but I found a quick and simple way to do it.

mob/var/delay=5
mob/var/tmp/move=1

mob/Move()
if(src.Frozen)
return //Frozen variable stops the person from moving completely
if(src.move)
src.move=0
..()
sleep(src.delay) //This is the delay var above It can be changed to go faster or slower
src.move=1
..()
In response to BleachNinja
So they move two tiles per Move() call? I wonder what happens when you sleep a negative number.
In response to Spunky_Girl
Spunky_Girl wrote:
I wonder what happens when you sleep a negative number.

Calling sleep() with a negative argument (such as sleep(-1)) causes it to do a backlog check. Only if other pending events have become backlogged will it sleep

The reference is astonishingly helpful when you wonder about the interface of a procedure.

In response to BleachNinja
This concept is flawed on multiple levels.
atom.Move() is one of the procedures that should provide a return value to begin with.
Not to mention that the implementation should have been designed on a different level.
In response to Spunky_Girl
Spunky_Girl wrote:
So they move two tiles per Move() call?

No, they move to the same tile twice.
In response to Garthor
Oh that's right. x.x I always mix those two things up. Moving twice, or relocating twice.