obj/blah
Bump(O)
if(ismob(O))
//tried to do some stuff here, but to no luck
ID:150296
Nov 10 2001, 7:12 am
|
|
How would I make it so that a client's Move() is temporarily disabled? I want it so that when a certian object bumps into you, you cant move for a while.
|
In response to Air Mapster
|
|
Air Mapster wrote:
Sariat wrote: > > obj/blah How about make a proc like mob/LockMovement(). Have a mob var called movetime or something and initialize it to 0. Inside mob/LockMovement(), set src.movetime equal to world.time + however many ticks you want to lock the movement. This means that movetime is the earliest time at which the mob is allowed to move again. Finally, in mob/Move(), check to see if world.time > src.movetime. If it is, then call ..() otherwise do nothing. Then just call O.LockMovement() from the Bump proc above. If you want to get really fancy and have different delays for bumping into different things, you could add an argument to LockMovement for the delay rather than hardcoding it into LockMovement. Yeah, but how do I set the O's Move() so that he cannot move at all in the firstplace? The rest would be easy,breezy. |
In response to Sariat
|
|
Sariat wrote:
Air Mapster wrote: Just like I said above: mob/Move() If movetime is in the future, ..() isn't called, so nothing happens. |
How about make a proc like mob/LockMovement(). Have a mob var called movetime or something and initialize it to 0. Inside mob/LockMovement(), set src.movetime equal to world.time + however many ticks you want to lock the movement. This means that movetime is the earliest time at which the mob is allowed to move again. Finally, in mob/Move(), check to see if world.time > src.movetime. If it is, then call ..() otherwise do nothing. Then just call O.LockMovement() from the Bump proc above. If you want to get really fancy and have different delays for bumping into different things, you could add an argument to LockMovement for the delay rather than hardcoding it into LockMovement.