ID:162370
 
My first question is: is there any way to INCREASE the default walking speed.

My second question is: what is the difference between Enter() and Entered()
No

Enter() is called when the atom is about to enter another atom inventory, Entered() afterwards
In response to Iuss
So say I have an area that when entered the client will slow down. Would I use Enter() or Entered()?
GohanIdz wrote:
My first question is: is there any way to INCREASE the default walking speed.

Yes and no. You can make how many moves you want in a single tick, but the client can only send a single command each tick.

My second question is: what is the difference between Enter() and Entered()

Enter() is called when an atom attempts to enter another atom and is used to determine whether the entering atom should be allowed to enter or disallowed. Entered() is called after a move ends on the entered atom and is used to make things happen after an atom has entered another.
Remember to use the available documentation and resources before making topics. You could have easily looked in the DM Reference entries for Entered() and Enter() to learn about them.
In response to Kaioken
I had looked at the reference. I guess I just didn't quite understand it for some reason. Thanks for explaining it, though.
In response to GohanIdz
GohanIdz wrote:
So say I have an area that when entered the client will slow down. Would I use Enter() or Entered()?

Of either of those, you'd use Entered(). However that's not your only option for slowing the player down.

Let's say players have different inherent walking speeds. We'll say mob/var/speed is actually the delay between steps, and for most mobs it's 4. Maybe for others it's 3 or even 2 depending on their condition. Now let's say there are swamp turfs that slow the player down; we'll add 3 ticks to movement.

atom
var/speedadjust = 0 // >0 will slow mobs down

mob
var/speed = 4
var/nextmovetime = 0

Move(newloc, newdir)
if(world.time < nextmovetime) return 0 // not ready
. = ..() // move and keep track of the return value
if(.)
var/sp = speed
var/atom/A = newloc // this is typically a turf
while(A)
sp += A.speedadjust
A = A.loc
nextmovetime = world.time + sp
// diagonal movements cover more pixels so the step size should be faster
var/pixels = (newdir & (newdir-1)) ? 45 : 32
pixel_step_size = round(pixels/sp, 1)
// . is the default return value, so we'll return it now


The above code will slow you down if you step onto a turf or area with speedadjust greater than 0. Likewise a speedadjust less than 0 will speed you up.

Lummox JR