Hi, I am working on building my own navigator.this is my first C# program. I am sorry if there is stupid code.
I found AStarNavigator and GaiaNavigator in documentation. GaiaNavigator is running on the server(I read the threads and know that), so the option is AStarNavigator. am I right?
here is piece of code of demo. it doesn't work, I want to know how to fix it or any suggestion for the own navigator. Thanks.
I got this exception. I fixed it by creating a new class StarNav : AStarNavigator, and implement an empty OnPulse.
then another exception was thrown. I have no idea about this.
I found AStarNavigator and GaiaNavigator in documentation. GaiaNavigator is running on the server(I read the threads and know that), so the option is AStarNavigator. am I right?
here is piece of code of demo. it doesn't work, I want to know how to fix it or any suggestion for the own navigator. Thanks.
Code:
var g = new Pathfinding.Graph ();
var myLocation = Core.Player.Location;
var node1= new Pathfinding.Node (myLocation.X, myLocation.Y, myLocation.Z);
node1.Id = 1;
g.AddNode(node1);
var node2= new Pathfinding.Node (myLocation.X-5, myLocation.Y-5, myLocation.Z);
node2.Id = 2;
g.AddNode(node2);
g.AddArc (new Pathfinding.Arc (node1, node2));
Navigator.PlayerMover = new SlideMover ();
Navigator.NavigationProvider = new AStarNavigator(g);
Navigator.MoveTo(g.NodeById(2).Position);
Code:
System.NotImplementedException:
ff14bot.Navigation.AStarNavigator.OnPulse()
ff14bot.Behavior.Pulsator.Pulse(PulseFlags CurrentPulseFlags)
Code:
[23:55:07.597 D]
System.NullReferenceException:
Pathfinding.AStar.SearchPath(Node StartNode, Node endNode)
ff14bot.Navigation.AStarNavigator..(CloseNode )
System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
ff14bot.Navigation.AStarNavigator.MoveTo(MoveToParameters parameters)
ff14bot.Navigation.Navigator.MoveTo(Vector3 location, String destination)