 Chris
|
Hi Aron,
1st – great job on the pathfinding engine…it has come in really handy.
—
I implemented the A* with a list graph and it works great for my npc’s and keeping them off the road.
I am trying to create a second list graph to use for my main characters waypoint system (these waypoints are in the center of the road).
Is there a way to define which graph the seeker is to use to come up with a path?
Ive searched through the docs, examples, and forums to find something but was unable to. You’re help would be greatly appreciated.
–
Just to reiterate:
List graph 1 is for npcs and keeps them off the road.
List graph 2 is for the “compass” and points to waypoints on the road.
Need to tell the seeker(s) to use either 1 or 2 depending on situation.
|
 Aron Granberg
|
Hi
This is currently only possible using the Pro version of the system. Then you can pass a graphMask variable to the StartPath call (or create your own path object and set the path’s nnConstraints graphMask variable youself if you want).
http://arongranberg.com/astar/docs/class_pathfinding_1_1_n_n_constraint.php#a63a785ae519f012d295916dd9969170c
//Enable only the second graph to be searched since the graphMask is a bitmask
//and 1<<1 will set it to have only it's second bit set.
mySeeker.StartPath (startPoint, endPoint, myCallbackFunction, 1 << 1);
http://arongranberg.com/astar/docs/class_seeker.php#ab50a876ab529ceb3eb9b97deb5a48d1e
You can also do some ugly workarounds, such as place the grid graph some distance above the map and then translate all coordinates accordingly (move the start and end points up, and when you get the path back, you move all path points down).
|
 Chris
|
Ahh… I see.
I read through the stuff on nnConstraints earlier and it seemed the most logical place to try, but it looked like it was meant for walkable/unwalkable states.
It makes sense though. Thanks for the reply!!
|