PathFinding

Path finding API, used by other plugins only

Total Downloads: 13,572 - First Release: Mar 31, 2015 - Last Update: Apr 19, 2018

5/5, 14 likes
  1. Hi there guys!, i'm having the same problems some users have with the NPC plugin, which i think comes from this plugin, after setting my new NPCs and its waypoints, the NPCs goes to the waypoints in a perfect line, having no care for colliders or even the height, it just goes in a line flying and going through things.. as said a few posts back, the PF works perfectly if the NPC is following me ... any idea of what am i doing wrong? Did anyone solved this?
     
  2. waypoints dont give a fuck of collisions
    pathfinding is only to run towards a player
     
  3. !@#$%..... so its up to NPCs development to take that in mind. THANKS!!!!
     
  4. Code:
    [Oxide] 5:05 PM [Error] Failed to call hook 'FindBestPath' on plugin 'PathFinding' (ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: Index out of range)
    [Oxide] 5:05 PM [Debug]   at System.Collections.Generic.SortedList`2[System.Single,System.Collections.Generic.List`1[Oxide.Plugins.PathFinding+PathfindNode]].KeyAt (Int32 index) [0x00000] in <filename unknown>:0
      at System.Collections.Generic.SortedList`2+ListKeys[System.Single,System.Collections.Generic.List`1[Oxide.Plugins.PathFinding+PathfindNode]].get_Item (Int32 index) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding+Pathfinder.FindPath (Vector3 sourcePos, Vector3 targetPos) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding.FindPath (Vector3 sourcePosition, Vector3 targetPosition) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding.FindBestPath (Vector3 sourcePosition, Vector3 targetPosition) [0x00000] in <filename unknown>:0
      at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
      at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
    [Oxide] 5:05 PM [Error] Failed to call hook 'FindBestPath' on plugin 'PathFinding' (ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: Index out of range)
    [Oxide] 5:05 PM [Debug]   at System.Collections.Generic.SortedList`2[System.Single,System.Collections.Generic.List`1[Oxide.Plugins.PathFinding+PathfindNode]].KeyAt (Int32 index) [0x00000] in <filename unknown>:0
      at System.Collections.Generic.SortedList`2+ListKeys[System.Single,System.Collections.Generic.List`1[Oxide.Plugins.PathFinding+PathfindNode]].get_Item (Int32 index) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding+Pathfinder.FindPath (Vector3 sourcePos, Vector3 targetPos) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding.FindPath (Vector3 sourcePosition, Vector3 targetPosition) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding.FindBestPath (Vector3 sourcePosition, Vector3 targetPosition) [0x00000] in <filename unknown>:0
      at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
      at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
    [Oxide] 5:05 PM [Error] Failed to call hook 'FindBestPath' on plugin 'PathFinding' (ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: Index out of range)
    [Oxide] 5:05 PM [Debug]   at System.Collections.Generic.SortedList`2[System.Single,System.Collections.Generic.List`1[Oxide.Plugins.PathFinding+PathfindNode]].KeyAt (Int32 index) [0x00000] in <filename unknown>:0
      at System.Collections.Generic.SortedList`2+ListKeys[System.Single,System.Collections.Generic.List`1[Oxide.Plugins.PathFinding+PathfindNode]].get_Item (Int32 index) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding+Pathfinder.FindPath (Vector3 sourcePos, Vector3 targetPos) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding.FindPath (Vector3 sourcePosition, Vector3 targetPosition) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding.FindBestPath (Vector3 sourcePosition, Vector3 targetPosition) [0x00000] in <filename unknown>:0
      at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
      at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
    [Oxide] 5:05 PM [Error] Failed to call hook 'FindBestPath' on plugin 'PathFinding' (ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: Index out of range)
    [Oxide] 5:05 PM [Debug]   at System.Collections.Generic.SortedList`2[System.Single,System.Collections.Generic.List`1[Oxide.Plugins.PathFinding+PathfindNode]].KeyAt (Int32 index) [0x00000] in <filename unknown>:0
      at System.Collections.Generic.SortedList`2+ListKeys[System.Single,System.Collections.Generic.List`1[Oxide.Plugins.PathFinding+PathfindNode]].get_Item (Int32 index) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding+Pathfinder.FindPath (Vector3 sourcePos, Vector3 targetPos) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding.FindPath (Vector3 sourcePosition, Vector3 targetPosition) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding.FindBestPath (Vector3 sourcePosition, Vector3 targetPosition) [0x00000] in <filename unknown>:0
      at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
      at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
    end
     
  5. it's more about resource usage. having 20 NPC constantly checking for paths will freeze your server, where as having only 1 or 2 NPC checking for paths while attacking players will not.
     
  6. I have same error as GNSC4.
     
  7. Hi guys ! I've got a problem, do you know how to do for NPC can use a weapon ?
     
  8. they can't, you can only give them a skin for it
    [DOUBLEPOST=1441438786][/DOUBLEPOST]
    reproduced it, strange that it does that, but the plugin works as intended anyway ^^
     
  9. That was from July 24th haven't had that error in a long time lol (what causes it)
     
  10. index out of range indicates a possible to little "holder" for a certain amount of data.
     
  11. what causes it is when an NPC is trying to get threw a door and can't.
     
  12. Code:
    [Oxide] 11:30 PM [Error] Failed to call hook 'FindBestPath' on plugin 'PathFinding v0.0.8' (ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: Index out of range)
    [Oxide] 11:30 PM [Debug]   at System.Collections.Generic.SortedList`2[System.Single,System.Collections.Generic.List`1[Oxide.Plugins.PathFinding+PathfindNode]].KeyAt (Int32 index) [0x00000] in <filename unknown>:0
      at System.Collections.Generic.SortedList`2+ListKeys[System.Single,System.Collections.Generic.List`1[Oxide.Plugins.PathFinding+PathfindNode]].get_Item (Int32 index) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding+Pathfinder.FindPath (Vector3 sourcePos, Vector3 targetPos) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding.FindPath (Vector3 sourcePosition, Vector3 targetPosition) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding.FindBestPath (Vector3 sourcePosition, Vector3 targetPosition) [0x00000] in <filename unknown>:0
      at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
    
     
  13. what causes it is when an NPC is trying to get threw a door and can't.
     
  14. It's inside the building. I think that problem occured when NPC is trying to go upstairs too.
     
  15. I'm getting this error after the update

    Code:
    [Oxide] 5:58 PM [Error] Failed to call hook 'FindBestPath' on plugin 'PathFinding v0.0.8' (ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: Index out of range)
    [Oxide] 5:58 PM [Debug]   at System.Collections.Generic.SortedList`2[System.Single,System.Collections.Generic.List`1[Oxide.Plugins.PathFinding+PathfindNode]].KeyAt (Int32 index) [0x00000] in <filename unknown>:0 
      at System.Collections.Generic.SortedList`2+ListKeys[System.Single,System.Collections.Generic.List`1[Oxide.Plugins.PathFinding+PathfindNode]].get_Item (Int32 index) [0x00000] in <filename unknown>:0 
      at Oxide.Plugins.PathFinding+Pathfinder.FindPath (Vector3 sourcePos, Vector3 targetPos) [0x00000] in <filename unknown>:0 
      at Oxide.Plugins.PathFinding.FindPath (Vector3 sourcePosition, Vector3 targetPosition) [0x00000] in <filename unknown>:0 
      at Oxide.Plugins.PathFinding.FindBestPath (Vector3 sourcePosition, Vector3 targetPosition) [0x00000] in <filename unknown>:0 
      at Oxide.Plugins.PathFinding.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0 
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00000] in <filename unknown>:0 
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0 
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0 
    end
    
     
  16. Hello there !

    I was wondering if it is possible to add a group of like 4/5 hostile NPCs walking on the roads with some stuff and weapons to add something fun and difficult in the game. (when I say a group it means that they move/attack together)
    This patrol, once entirely killed, would respawn like 1hour after the last NPC death...

    The problems are to me:
    - the condition to repopulate this patrol
    - the pathfinding
    - the stack of the patrol (if they split it will ruin my idea as players will do it every single time to get some kind stuff)

    Maybe you guys can tell me how to do that (or tell me it's impossible and break my heart) ?
     
  17. I find that making MORE waypoints that reflect barriers and height changes helps to alleviate most issues with going underground or through objects during their patrols- the pathfinding seems to work, as does the waypoints mod, you just have to take into account what's in between waypoints. So if you're at the bottom of a hill and make your next waypoint at the top, your NPC is going to take the shortest route there, regardless of barriers or ground level. You have to add your waypoints in the middle to reflect the NPC walking UP or DOWN the hill or AROUND objects. You can make as many of them as you need in one save it seems; I've recently created/saved (and had working) a waypoint with over 200 points.
    [DOUBLEPOST=1453673115][/DOUBLEPOST]
    The only way I've figured to do it, is to have them respawn every say, 5 hours for that "power group" and then reset the server every five hours via the event timer mod, thereby ensuring that they stick to their original paths that often- players WILL come kill them, but it should reset before anyone should get the chance to loot the whole group again... every one hour seems pretty often to reset the server and thereby correct the timing, so.... was my only idea. I've tried to something similar and have decided to wait until I get a few other kinks worked on until I meet that one again xD If anyone has a better one, I'd LOVE to hear it! I'd love to have groups of roaming mobs :D
     
  18. Code:
    [Oxide] 7:46 PM [Error] Failed to call hook 'FindBestPath' on plugin 'PathFinding v0.0.8' (ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: Index out of range)
    [Oxide] 7:46 PM [Debug]   at System.Collections.Generic.SortedList`2[System.Single,System.Collections.Generic.List`1[Oxide.Plugins.PathFinding+PathfindNode]].KeyAt (Int32 index) [0x00000] in <filename unknown>:0
      at System.Collections.Generic.SortedList`2+ListKeys[System.Single,System.Collections.Generic.List`1[Oxide.Plugins.PathFinding+PathfindNode]].get_Item (Int32 index) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding+Pathfinder.FindPath (Vector3 sourcePos, Vector3 targetPos) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding.FindPath (Vector3 sourcePosition, Vector3 targetPosition) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding.FindBestPath (Vector3 sourcePosition, Vector3 targetPosition) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0
    [Oxide] 7:46 PM [Error] Failed to call hook 'FindBestPath' on plugin 'PathFinding v0.0.8' (ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: Index out of range)
    [Oxide] 7:46 PM [Debug]   at System.Collections.Generic.SortedList`2[System.Single,System.Collections.Generic.List`1[Oxide.Plugins.PathFinding+PathfindNode]].KeyAt (Int32 index) [0x00000] in <filename unknown>:0
      at System.Collections.Generic.SortedList`2+ListKeys[System.Single,System.Collections.Generic.List`1[Oxide.Plugins.PathFinding+PathfindNode]].get_Item (Int32 index) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding+Pathfinder.FindPath (Vector3 sourcePos, Vector3 targetPos) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding.FindPath (Vector3 sourcePosition, Vector3 targetPosition) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding.FindBestPath (Vector3 sourcePosition, Vector3 targetPosition) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.PathFinding.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0 
    What does this mean / fix?
     
  19. Hey guys, is it at all possible to stop or atleast reduce the time a hostile NPC pauses while chasing a player?
     
  20. You can try to minimize NPC 's personal attackdistance or reduce his speed, which will allow a "delay" of sorts to allow players to combat the NPC more effectively; I find it helps.