ID:267797
Oct 18 2003, 9:31 am (Edited on Oct 18 2003, 10:00 am)
|
|
Does anyone know? And could you show me how?
|
Oct 18 2003, 9:58 am
|
|
Yes.
|
You can't really speed up the default movement (as far as I know... aside from overriding Move to make the mobs jump two spaces at a time instead of one), so the trick here is to slow down everything else...
You've got to think of your fastest mob as moving at the normal speed, and anything slower than it is needs to be delayed... |
In response to SuperSaiyanGokuX
|
|
Oh, i know how to do that, but when i do it makes all mobs do it....
|
Change the objects pixel_step_size to anything divisible by 32. Give /atom/movable a new variable called "moving" and set it to 0. In Move() check to see if the mob is moving (if its moving variable is true or false). If it is moving then return, if it is not moving then set moving to true (1), perform the default movement then put in the magical line that performs the wanted delay:
spawn(32/pixel_step_size)moving=0 |
In response to Master_Damien
|
|
I'm guessing that your movement delay system involves a sleep() in your Move() proc...
If so, the only thing you have to do to make different mobs move at different speeds, is just using a variable in the sleep(), instead of a constant value... Like so: mob var movedelay = 10 movestop = 0 Move() if(movestop) return 0 else movestop = 1 ..() sleep(movedelay) movestop = 0 (note that my choice of example movement delay might not be the best, let alone even workable, but it'll do for the sake of an example...lol) Then, all base mobs will have a one second delay between steps... To make other mobs take longer or shorter, just change their movedelay var... mob cheetah movedelay = 0 snail movedelay = 100 Now, the cheetah mob will have no delay (and will be able to move the fastest) and the snail will have a (relatively) huge delay and will only be able to move every ten seconds, much slower... |