ID:266285
 
I need an example movement code to make NPC mobs move randomly


thx in adv
That's not too hard, just use something like Deadron's Lifecycle code.

When a new mob is created, run a new proc off New() called LifeCycle().

In LifeCycle, run a for loop or at least this is what I would do that continually runs everything in the mob's lifecycle program. For loops seem so much simpler than calling procs over and over.

LifeCycle()
for()
for(mob/M in range(1))
//attack stuff if you want it
break
step_rand(src)
sleep(length_of_sleep_var)
In response to GateGuardian
i typed that in it dont work



I want an EXAMPLE CODE not a piece of a library
In response to SSJ4_Sanatic Bardock
SSJ4_Sanatic Bardock wrote:
i typed that in it dont work



I want an EXAMPLE CODE not a piece of a library


Ok then:

mob/Login()
for(var/mob/NPC/N in world)
walk_rand(N)
In response to SSJ4_Sanatic Bardock
He gave you exactly what you needed, he even hinted at a library which does what you want. Some people are just ungreatful

Alathon
In response to SSJ4_Sanatic Bardock
What do you think a library is?
In response to Alathon
I have shut up.
In response to Lord of Water
Lord of Water wrote:
Ungreatful? It's ungrateful:

LoW, shut the Hell up.
In response to Nadrew
Nadrew wrote:
SSJ4_Sanatic Bardock wrote:
i typed that in it dont work



I want an EXAMPLE CODE not a piece of a library


Ok then:

> mob/Login()
> for(var/mob/NPC/N in world)
> walk_rand(N)
>


mob/NPC
New()
walk_rand(src)


is an improvement.

Not sure why I'm posting this since Bardock is rude enough that he shouldn't be given help here. But since he is probably already using your code and is happy, why not?
In response to Vortezz
woh man dont burst out for no reason
In response to Baby Vampire
Baby Vampire wrote:
woh man dont burst out for no reason

There is reason. LoW has always been correcting people's spelling, even though he constantly has errors.

Plus, he nags Alathon for it, even though it's not Alathon's first language.
In response to Vortezz
AHHHHHHHHHHHHHHHHHHH ok