ID:266514
![]() Mar 27 2002, 5:55 pm
|
|
ok is there a tut/dem/lib that tells a mob how to walk aaway from a usr?
|
Format:
walk_away(Ref,Trg,Max=5,Lag=0) Args: Ref: A mob or obj. Trg: An object on the map. Max: The maximum distance between Ref and Targ before movement halts. Lag: Delay in world 1/10 seconds between movement. These are straight from the F1 help (Same as Reference on the website). This will make the mob (Ref) move away from the Trg until it is Max distance away: walk_away(src,M,5,1) That will make the src walk away from M until it is 5 steps away and it will take one step every 1/10 of a second. Format: step_away(Ref,Trg,Max=5) Returns: 1 on success; 0 otherwise. Args: Ref: A mob or obj. Trg: An object on the map. Max: The maximum distance between Ref and Targ before movement halts. This works in much the same way except it only takes one step instead of many. |
Strange Kidd wrote:
is there a way i can make it not go to a target just run away? Wasn't that just explained to you? |
Strange Kidd wrote:
so........ |
More like this.
mob/Hi/proc/walking() for(var/mob/M in view()) walk_away(src,M,5,1) mob/Hi/Move() walking() ..() |
walk_away(src,M,5,1)That will make the src walk away from M until it is 5 steps away and it will take one step every 1/10 of a second. That is from my original post. It makes the first mob sent to it move away from the second mob sent to it. If you want the mobs to run away from the player then you need it like this: for(var/mob/M in oview(1)) walk_away(M,src,10,1) This will cause each mob (M) that is within one space of the src to walk away from the src. This is what you had: mob/Hi for(var/mob/M in oview(1)) walk_away(usr,M,10,1) That would cause the usr to walk away from M. |
step_away()
walk_away()