I was wondering if someone can make me a tutorial on how to set on how far the npc walks out. as in tiles. Cause it said to random and it goes really far out.. i was wondering if i can set the tiles it can go out. or somethen.
Printable View
I was wondering if someone can make me a tutorial on how to set on how far the npc walks out. as in tiles. Cause it said to random and it goes really far out.. i was wondering if i can set the tiles it can go out. or somethen.
actualy random walk is random. But an area can be setted for npc ^^, so npc wont walk out that area.
I dont want like whole falador to stay in.. I want like boundry's..
Make a radius of the area the npc can walk in lol
Mind telling me how?
Add a radius field to your npc defs and then just do
int moveX = location.x + random(-radius, radius);
int moveY = location.y + random(-radius, radius);
so if radius = 6 we move in a 6x6 area
They already random walk. the inform of which npcs can is on cache. all you have to do is spawn npc.