ID:165535
 
mob/Zombie//Defines a /mob/NPC
icon = 'Zombie.dmi'
hp = 10//different health than the main mob
Click()//When clicked
usr.attack(src)//attack!
proc/move()//Now, this proc handles NPC movement
rundelay=12
for(var/mob/M in oview())//loops over all mobs in view
if(get_step_away(src,M,3))//checks distance
if(!M.client)//Not a player
continue//continues through the loop
else//Player
walk_to(src,M,1,2)//Move to the person
else//4-or-more spaces away
continue
spawn(40) move()//loops the proc after 2 seconds

proc/attackplayer()//Handles attacking
for(var/mob/M in oview(1))//Within one space this time
if(get_step_away(src,M,1))
if(!M.client)
continue
else
src.attack(M)//Calls the attack proc
else
return..()
spawn(20) attackplayer()

New()//When created
attackplayer()//Calls the procs for it
move()
mob
var
speeding = 0
rundelay = 3 //Set this to different settings to control how slow the mob walks.
crundelay = 0

client/Move()
if(mob.speeding <= 0)
mob.speeding = 1
..()
sleep(mob.rundelay)
mob.speeding = 0
else
return

zombies are supposed to be slow, this makes them too fast, i need help.
Did you even read the comment code you posted!?
In response to Dead_Demon
yeah i read it, but the thing is, no matter what i try the zombie always moves fast
VolksBlade wrote:
> mob/Zombie//Defines a /mob/NPC
> icon = 'Zombie.dmi'
> hp = 10//different health than the main mob
> Click()//When clicked
> usr.attack(src)//attack!
> proc/move()//Now, this proc handles NPC movement
> rundelay=12
> for(var/mob/M in oview())//loops over all mobs in view
> if(get_step_away(src,M,3))//checks distance
> if(!M.client)//Not a player
> continue//continues through the loop
> else//Player
> walk_to(src,M,1,2)//Move to the person
> else//4-or-more spaces away
> continue
> spawn(40) move()//loops the proc after 2 seconds
>
> proc/attackplayer()//Handles attacking
> for(var/mob/M in oview(1))//Within one space this time
> if(get_step_away(src,M,1))
> if(!M.client)
> continue
> else
> src.attack(M)//Calls the attack proc
> else
> return..()
> spawn(20) attackplayer()
>
> New()//When created
> attackplayer()//Calls the procs for it
> move()
> mob
> var
> speeding = 0
> rundelay = 3 //Set this to different settings to control how slow the mob walks.
> crundelay = 0
>
> client/Move()
> if(mob.speeding <= 0)
> mob.speeding = 1
> sleep(mob.rundelay)
> ..()
> mob.speeding = 0
> else
> return
>



Fixes are in quote. You were calling the sleep() too early.
Don't rely on someone else's work to work for you. Read the DM Guide.
A zombie NPC which moves around a bit should be easy to make if you actually read it.

Read it now, or spend five years in ignorance.
In response to Android Data
Android Data wrote:
Don't rely on someone else's work to work for you. Read the DM Guide.
A zombie NPC which moves around a bit should be easy to make if you actually read it.

Read it now, or spend five years in ignorance.

Don't read it, it wont help you at all its just a bunch of words, the only way you learn is by experience. also id say tweek the rundelay a bit.
In response to Miran94
[link]

And don't forget, not everyone knows what you know... for example, he may ask you how to modify rundelay... it is a self created variable in which you have to modify Move(), c'est non?

- GhostAnime
In response to Miran94
i read it like 12 times and it didnt help so i belive you miran cause i was getting better by doing the stuff.
In response to VolksBlade
Don't believe Miran, he's an idiot. The DM guide will help you, it helped me alot. I learned list's, bitflags, operators and alot more stuff from it.
In response to Xx Dark Wizard xX
ah but i learned nothing from it
In response to VolksBlade
That means you barely, if at all read it... according to your statement.

Now did you really mean:
1) You didn't learn anything from it
a) You did READ through the whole thing, one word at a time
b) You SKIMMED through the whole thing
c) You glanced through the whole thing
d) You looked at it and decided it wasn't worth your time
or
2) You did not learn anything useful from it to your current situation

Wording matters ;)

But for your answer, if you did not actually looked at your code snippet, note this line
sleep(mob.rundelay)
Translation: Increased amount = Slower speed

Of course, if you did read through the guide or at least the reference, you would know that client/Move() when a player presses a key, not when a mob walks (that'd be mob/Move()).. this is the reason I don't believe point 1a from you because in the DM guide, it stated: "By default, the (client) directional procs call the client's Move proc, which in turn calls the mob's own Move proc. It is simply there to redefine if you want."

- GhostAnime
In response to GhostAnime
I did read it, but i didnt learn from it.
In response to Miran94
Miran94 wrote:
Don't read it, it wont help you at all its just a bunch of words, the only way you learn is by experience. also id say tweek the rundelay a bit.

No.