I know the step_rand(src) thing, but its not working, heres what i have
mob
proc
Wander()
step_rand(src)
sleep(10)
return
mob
npc
rat
Wander()
icon='Enemy.dmi'
name="{NPC} Rat"
npc=1
hp=100
def=23
ID:161858
Mar 23 2008, 3:56 pm
|
|
Anyone have a simple wander proc they can share, and show how to apply to a mob?
I know the step_rand(src) thing, but its not working, heres what i have mob |
Mar 23 2008, 4:23 pm
|
|
In response to Lt. Pain
|
|
Wow, that's wrong on many, many levels. Please figure out what you're doing yourself before you try to help others.
|
Okay, first, you're going to have to make Wander() into a loop, so that it step_rand()s more than once. That's easy:
mob/proc/Wander() Obviously, there are some things you can change here, I prefer using while(!client) instead of while(src). Both should generally be true, but if a mob has a client, then somebody is controlling them, in which case you don't want to force them to wander around. A rare case, but one that you don't want. Now, you're going to have to call the Wander() proc. What you did yourself was simply redefine Wander() to do nothing for mob/npc/rat. What you need to do is called Wander() from the New() proc: mob/npc/rat |