I used to know how to do this but I lost my files during a hd crash. Making an NPC wander around without going diagonal.
Thanks in advance
ID:155718
Apr 7 2011, 12:17 am
|
|
In response to Bravo1
|
|
Thanks for replying. Do I use this with the walk_rand proc? If I use it by itself, the npcs move one step in the direction they pick. Unless I have to loop it somehow.
|
In response to Chaoder
|
|
Yep, just replace step with walk
|
In response to Bravo1
|
|
Bravo1 wrote:
Yep, just replace step with walk Then they'll just walk in one direction :) To use that method, you would have to set up a simple loop (and then you get the added bonus of being able to randomize how long they wait between steps) |
In response to DarkCampainger
|
|
I figured walking in one direction for as long as possible was the intention. Oh well =P
|
You could also anchor your mobs to prevent them from walking too far from their spawn location.
mob/npc |
In response to SuperAntx
|
|
Thanks everyone. It totally works! I'll keep this code backed up in case my PC decides to crash again.
|
In response to Bravo1
|
|
Yeah but that only works for Npcs who are created not already added in the game since you used the New() proc.. Isnt there a way to make a mob run a proc with out using New()?
|
In response to Liight
|
|
Every atom calls New() when it is created. Every atom in the map is created when the world starts. Therefor, New() is called by everything in existence once.
|
In response to Robertbanks2
|
|
Thank you that helped a lot ^^
|
Try that out.