Hi Aron,
I recently began porting my game over to Win8. It was made in 2012, so the version I’ve been running is 2.92. When I Installed 3.5.1 I noticed there are a lot of variables and functions missing. I was hoping I could just post here and you could give me some quick answers:
-
I use 3 grids in the game. Previously, you could set the grid the Seeker was using by saying “seeker.grid”, now it appears Seeker has no access to any grids. What should I do?
-
I no longer have access to AstarClasses.Node
-
I no longer have functions in AstarPath like GetSurroundingNodes(node, int) or RecalcNeighbors. I used these functions to turn nodes on and off, like when a door opens and closes.
Thanks!
Hi
Lots of things have changed since 2.9
There is a small upgrade guide here: http://arongranberg.com/astar/docs/upgrading.php
but it doesn’t cover everything.
-
Very few people used that, so it is not exposed in the editor anymore. However to every call to seeker.StartPath there is an optional graphMask variable which is a bitmask of all graphs the seeker is allowed to start and end on.
-
It is now named GraphNode
-
See http://arongranberg.com/astar/docs/graph-updates.php
You can still use AstarPath.GetNearest and on that node use GraphNode.GetConnections.
Alright, thanks! Will look into it and let you know how it goes.
Couple more Q’s not addressed in the upgrade page (I realise how old this topic is, but I’m finally getting around to upgrading):
What happened to these functions?
Int3 p = AstarPath.ToLocal(nodePos, gridID);
thisNode = AstarPath.GetNode§;
neighbors = thisPath.GetSurroundingNodes(thisNode, 0);
Hi
1 AstarPath.GetNearest (…).position;
2 AstarPath.GetNearest (…)
3 How the connections are stored depends on the node type, but there a high level api which you can use so
var neighbours = new List<GraphNode>();
myNode.GetConnections(neighbours.Add);
Will fill the list called “neighbours” with all the neighbours of that node.