01.04.2013, 00:23
(
Last edited by Pottus; 01/04/2013 at 04:10 AM.
)
Ok, some updates on the problem it would seem OnPathCalculated() doesn't even get called in some instances when attempting to calculate a path check out this output.
Update #1
[20:39:49] Iteration: 0 NodeID: 4688619 czyli X = -381.000000 Y = 2219.000000 Z = 41.090000
[20:39:49] Iteration: 1 NodeID: 4694620 czyli X = -380.000000 Y = 2218.000000 Z = 41.090000
[20:39:49] Iteration: 2 NodeID: 4700620 czyli X = -380.000000 Y = 2217.000000 Z = 41.090000
[20:39:49] Iteration: 3 NodeID: 4706620 czyli X = -380.000000 Y = 2216.000000 Z = 41.090000
[20:39:49] Iteration: 4 NodeID: 4712620 czyli X = -380.000000 Y = 2215.000000 Z = 41.090000
[20:39:49] Iteration: 5 NodeID: 4718620 czyli X = -380.000000 Y = 2214.000000 Z = 41.090000
[20:39:49] Iteration: 6 NodeID: 4724620 czyli X = -380.000000 Y = 2213.000000 Z = 41.090000
[20:39:49] X:-380.000000 Y:2216.000000 Z:41.090000 <---- Used Path Node
Update #2
[20:39:50] Iteration: 0 NodeID: 4700619 czyli X = -381.000000 Y = 2217.000000 Z = 41.090000
[20:39:50] Iteration: 1 NodeID: 4706618 czyli X = -382.000000 Y = 2216.000000 Z = 41.279998
[20:39:50] Iteration: 2 NodeID: 4712617 czyli X = -383.000000 Y = 2215.000000 Z = 41.369998
[20:39:50] Iteration: 3 NodeID: 4718616 czyli X = -384.000000 Y = 2214.000000 Z = 41.409999
[20:39:50] Iteration: 4 NodeID: 4724616 czyli X = -384.000000 Y = 2213.000000 Z = 41.419998
[20:39:50] X:-384.000000 Y:2214.000000 Z:41.409999 <---- Used Path Node
----------------------------------------------------- <---- No paths here PathFinder_FindWay() failed
[20:39:50] X:-384.000000 Y:2214.000000 Z:41.409999 <---- Keeps returning the same values since there is no new
[20:39:51] X:-384.000000 Y:2214.000000 Z:41.409999 path updates ("Failed") would be printed if
[20:39:51] X:-384.000000 Y:2214.000000 Z:41.409999 OnPathCalculated() was actually called
[20:39:52] X:-384.000000 Y:2214.000000 Z:41.409999
[20:39:52] X:-384.000000 Y:2214.000000 Z:41.409999
[20:39:52] X:-384.000000 Y:2214.000000 Z:41.409999
[20:39:53] X:-384.000000 Y:2214.000000 Z:41.409999
[20:39:53] X:-384.000000 Y:2214.000000 Z:41.409999
Paths stop being calculated, I'm guessing something is failing inside PathFinder_FindWay(); resulting in OnPathCalculated() not being called.
Edit - Continued doing tests and still the same problem keeps surfacing it's not calculating when using PathFinder_FindWay(); and isn't even calling OnPathCalculated() with a failed success obviously a bug.
Also noticed once nodes stop being calculated properly the plugin then fails completely and won't calculate any paths regardless of the values passed to PathFinder_FindWay();
Some more information:
This part of the code is on a 400 ms timer which keeps the Zombie following the player.
Here is OnPathCalculated()
Update #1
[20:39:49] Iteration: 0 NodeID: 4688619 czyli X = -381.000000 Y = 2219.000000 Z = 41.090000
[20:39:49] Iteration: 1 NodeID: 4694620 czyli X = -380.000000 Y = 2218.000000 Z = 41.090000
[20:39:49] Iteration: 2 NodeID: 4700620 czyli X = -380.000000 Y = 2217.000000 Z = 41.090000
[20:39:49] Iteration: 3 NodeID: 4706620 czyli X = -380.000000 Y = 2216.000000 Z = 41.090000
[20:39:49] Iteration: 4 NodeID: 4712620 czyli X = -380.000000 Y = 2215.000000 Z = 41.090000
[20:39:49] Iteration: 5 NodeID: 4718620 czyli X = -380.000000 Y = 2214.000000 Z = 41.090000
[20:39:49] Iteration: 6 NodeID: 4724620 czyli X = -380.000000 Y = 2213.000000 Z = 41.090000
[20:39:49] X:-380.000000 Y:2216.000000 Z:41.090000 <---- Used Path Node
Update #2
[20:39:50] Iteration: 0 NodeID: 4700619 czyli X = -381.000000 Y = 2217.000000 Z = 41.090000
[20:39:50] Iteration: 1 NodeID: 4706618 czyli X = -382.000000 Y = 2216.000000 Z = 41.279998
[20:39:50] Iteration: 2 NodeID: 4712617 czyli X = -383.000000 Y = 2215.000000 Z = 41.369998
[20:39:50] Iteration: 3 NodeID: 4718616 czyli X = -384.000000 Y = 2214.000000 Z = 41.409999
[20:39:50] Iteration: 4 NodeID: 4724616 czyli X = -384.000000 Y = 2213.000000 Z = 41.419998
[20:39:50] X:-384.000000 Y:2214.000000 Z:41.409999 <---- Used Path Node
----------------------------------------------------- <---- No paths here PathFinder_FindWay() failed
[20:39:50] X:-384.000000 Y:2214.000000 Z:41.409999 <---- Keeps returning the same values since there is no new
[20:39:51] X:-384.000000 Y:2214.000000 Z:41.409999 path updates ("Failed") would be printed if
[20:39:51] X:-384.000000 Y:2214.000000 Z:41.409999 OnPathCalculated() was actually called
[20:39:52] X:-384.000000 Y:2214.000000 Z:41.409999
[20:39:52] X:-384.000000 Y:2214.000000 Z:41.409999
[20:39:52] X:-384.000000 Y:2214.000000 Z:41.409999
[20:39:53] X:-384.000000 Y:2214.000000 Z:41.409999
[20:39:53] X:-384.000000 Y:2214.000000 Z:41.409999
Paths stop being calculated, I'm guessing something is failing inside PathFinder_FindWay(); resulting in OnPathCalculated() not being called.
Edit - Continued doing tests and still the same problem keeps surfacing it's not calculating when using PathFinder_FindWay(); and isn't even calling OnPathCalculated() with a failed success obviously a bug.
Also noticed once nodes stop being calculated properly the plugin then fails completely and won't calculate any paths regardless of the values passed to PathFinder_FindWay();
Some more information:
This part of the code is on a 400 ms timer which keeps the Zombie following the player.
Code:
PathFinder_FindWay(zombie, zx, zy, x, y); printf("X:%f Y:%f Z:%f", ZombieNextPos[zombie][0],ZombieNextPos[zombie][1],ZombieNextPos[zombie][2]);
Code:
public OnPathCalculated(routeid,success,nodes[],nodes_size) { if(success) { new Float:x,Float:y,Float:z; for(new i; i < nodes_size; i++) { PathFinder_GetNodePos(nodes[i],x,y,z); printf("Iteration: %d NodeID: %d Position X: %f Y: %f Z: %f",i,nodes[i],x,y,z); } if(nodes_size > 2) PathFinder_GetNodePos(nodes[2], ZombieNextPos[routeid][0], ZombieNextPos[routeid][1], ZombieNextPos[routeid][2]); else if(nodes_size > 1) PathFinder_GetNodePos(nodes[1], ZombieNextPos[routeid][0], ZombieNextPos[routeid][1], ZombieNextPos[routeid][2]); else PathFinder_GetNodePos(nodes[0], ZombieNextPos[routeid][0], ZombieNextPos[routeid][1], ZombieNextPos[routeid][2]); } else { print("Failed"); GetPlayerPos(ZombieInfo[routeid][zplayerid], ZombieNextPos[routeid][0], ZombieNextPos[routeid][1], ZombieNextPos[routeid][2]); } }