ID:149482
 
mob
p
icon = 'p.dmi'
density = 1
New()
.=..()
spawn(1)
Walk()
proc/Walk()
while(src)
step_rand(src)
sleep(10)
spawn(10)
Walk()

The Code compiles fine but when i get in the game the p's start to move around 1 block at a time... But then they start to skip Blocks like 4 or 5 at a time i just want them to walk up and down side walks like normal people and when they start to skip blocks it slows byond down it seems to make lagg... Plz Help

Hi, just a few comments on your code:

New()
.=..()
spawn(1)
Walk()

Since New doesn't use the return value (the dot), you might as well put just ..() at the top. Also, you could put in a random number as the argument to spawn, just to reduce lag and make the people not walk at the same time. Example: spawn(rand(1,5))

proc/Walk()
while(src)

When src is deleted, the proc is terminated, so you don't need the while line.

step_rand(src)
sleep(10)
spawn(10)

Instead of sleeping for a second here, Spawn one second later instead. That way you can be sure that the proc has finished before the next one starts.

The Code compiles fine but when i get in the game the p's start to move around 1 block at a time... But then they start to skip Blocks like 4 or 5 at a time i just want them to walk up and down side walks like normal people and when they start to skip blocks it slows byond down it seems to make lagg... Plz Help

Not sure what you mean here. Are four mobs skipping blocks at the same time, or is one mob skipping 4 turfs?


/Andreas