client/Move()
sleep(src.weight)
..()
ID:167262
Apr 8 2006, 6:30 am
|
|
does client mean anyway? Cause i made this move proc and i had it mob/move but people said it was better with client/move. To me they both work the same though... and why does this not work?
|
In response to SJRDOZER
|
|
SJRDOZER, you probably shouldn't be helping the newbies. You won't know whether you're really helping, or hurting them overall. In this case, your help isn't worth much.
There is a definite difference between mob/Move() and client/Move(). Only mobs attached to players have a client. The client object, in fact, represents the connection that the player has to the game. client/Move is called whenever the player registers a key command (north, say). So, let's say that you wanted to build a motion tracker that tracks all the players in the game. If you put it into the mob/Move() proc, you would need to do an if(client) check right away. You could do away with that by simply including it in the client/Move() proc instead. Important differences: in mob/Move, src is the mob and client is the client. in client/Move, src is the client and mob is the mob. the default behaviour for the mob/Move() proc is to check for density, update the icons and locations, etc. the default behaviour for the client/Move() proc is to call mob/Move(). |
The main reason that doesn't work is that sleep() only delays the movement. It doesn't keep new commands to move from being processed (and also delayed) in the meantime. So if you hit the arrow keys 5 times very quickly your mob will pause for a fraction of a second, then move 5 spaces very quickly.
Lummox JR |
In response to Lummox JR
|
|
Lummox JR wrote:
The main reason that doesn't work is that sleep() only delays the movement. It doesn't keep new commands to move from being processed (and also delayed) in the meantime. So if you hit the arrow keys 5 times very quickly your mob will pause for a fraction of a second, then move 5 spaces very quickly. Lummox, thank you! I've been thinking ALL DAY on how to prase that and you did it in no time flat! Thanks for making me fell stupid! :D |
In response to Lummox JR
|
|
Lummox JR wrote:
The main reason that doesn't work is that sleep() only delays the movement. It doesn't keep new commands to move from being processed (and also delayed) in the meantime. So if you hit the arrow keys 5 times very quickly your mob will pause for a fraction of a second, then move 5 spaces very quickly.is this because when it is first called it has to wait, but when you move() rapidly its sleep()ing while its doing the previous move()? ~~Albire |
you dont have to use client you could use mob if you wanted the npcs to be delayed too.
|
In response to Albire
|
|
Albire wrote:
Lummox JR wrote: Exactly. While Move() sleeps, it doesn't stop you from moving again. Lummox JR |
I thought you couldn't sleep in the Move proc, I dunno I haven't coded in a while. Try putting the sleep after ..(). I dunno if it'll work because moving again calls the proc again. You may need to do something like this: