Ok Samb! I've completed your requests. Here's the update for you.
For everyone else... I'll create a new complete download package soon.
http://www.gamebeep.com/freebies/ez_path_update.zipHere's a summary of the changes:1. I've added a .dll function called pf_set_backtracking(). Backtracking defaults to ON, but using this function, you can set it to OFF. For example:
pf_set_backtracking(off); // do not allow backtracking
2. I've created a new function called fp_get_random_node() which returns a random pathfinding node. An example to move an actor to a random node might look something like this:
Code:
// Fetch the entity * of a random node
dst_ent = pf_get_random_node();
// Calculate path to node
pf_to_ent(my, dst_ent);
// Face actor to the correct directon
my.pan = my._PF_PAN_TO_TARGET;
// Move actor
move_mode = IGNORE_YOU + IGNORE_PASSABLE + IGNORE_PUSH + ACTIVATE_TRIGGER + GLIDE;
ent_move(vector(time * 10,0,0), nullvector);
Don't forget that you can use my._PF_REACHED_TARGET to test to see if the target node has been reached. Also remember to test the return value of pf_to_ent. If it's 0, then there's no clear path to the target. (I skipped this step in my example.)
Cool beans! I hope this helps out!
- Bret