ID:160645
![]() Aug 6 2008, 4:41 pm
|
|
So, i have some effects in my game that "push you back". I currently use step() to step you in M's direction, but it seems to reset your inactivity(which i don't want). Is there any way i can prevent that from hapening?
|
![]() Aug 6 2008, 4:44 pm
|
|
I guess changing there loc but it wouldn't look liek they are being pushed and im not sure but i think that might change the inactivity.
|
Well, i think that step() calls the Move() Proc, which isn't a good thing for 1 reason.
mob step seems to call the move proc, which in end makes my guy return from being AFK and that makes him vulnerable to attacks. I guess i'll have to add a check to see if they're AFK or not. |
But it should call atom/movable.Move(), which is an object function, not that of the client. client.inactivity will remain unaffected, so if you designed your AFK system right, you'd be in good shape.
step() calling Move() is a very good thing. Set up your system to use client.Move() instead, or just stick with client.inactivity. |
You can prevent your AFK system from resetting players by overriding client/Move() in favor of mob/Move(). The former is only called when the player initiates movement; the latter can be called anytime the player is forced to move.
I'm also assuming you're setting loc directly in a lot of cases. This should be avoided: you should always call mob.Move(turf) instead of setting the loc variable directly as the former will check if the player can actually move to that position. If the player can't, Move() will return 0 and you can perform other actions. mob/verb/teleport(var/x as num, var/y as num, var/z as num) Also if you are pushing a player back more than one tile, it may be beneficial to directly use mob.Move() to set the player back by multiple tiles at once. (after performing your own calculations of course to see if it's possible to do this; if you don't do this obstacles could prevent your 'push' command from working) |
bad call mate, what if a player called AFK in a fight? Theyd be using your idea to protect themselves
|
Not really... if you look good enough you'll notice you can only go AFK if you got 5 * 600 ticks, therefore, you need to wait at least 5 minutes to go AFK. By then, if you wouldn't produce any activity and get attacked the whole time, you should be pretty much dead.
|
Never ever forget if().
mob |