What about instead of view,range, etc... inDirection()?
So you could say inDirection(5,Northeast,src) and it'd check all the squares northeast of the mob?
ID:260034
Aug 18 2005, 10:18 am
|
|
In response to CaptFalcon33035
|
|
eh ya, but I was more thinking one that wouldn't loop through all the turfs in the area (as that's kind of inefficient) and just check the ones straight to the northeast...
Since if you have 200 mobs in the world in a pathfinding check it'd be a pain in the butt if there was nothing TO the northeast and you had to check all the surrounding ones as well just to find that out. |
In response to CaptFalcon33035
|
|
CaptFalcon33035 wrote:
You can do this pretty easily without a built-in proc. > mob/verb/Say(t as text) Minor problem there: This will count anything even slightly diagonal as entirely diagonal. For direction, you should probably use a loop with get_step(): proc/direction(atom/ref, dir, range) Lummox JR |
In response to Jon Snow
|
|
Maybe something like:
mob/proc/Get_Mobs_North(max_dist as num) That could've just as easily been a proc that read in a direction as a second argument, and searched the specified direction. Aside from that, my example is less efficient than it could be, and I may have made some error/s. But the point I'm trying to make is that you don't have to loop through an entire area; you can loop just one direction. Hiead |
In response to Hiead
|
|
hmm interesting, never thought of doing it that way before. Thanks for the ideas :)
|
Something like that.