AStar Help
by NCGames · in Technical Issues · 08/07/2008 (5:27 pm) · 6 replies
I've been trying to understand aStar pathfinding API, but I'm failing. I've been gleaning what I can from the tutorial but I can't seem to be able to figure out how to do it.
My current error is:
"game/gameScripts/aStarActor.cs (123); Unable to find object: ' ' attempting to call function 'createpath'"
My current error is:
"game/gameScripts/aStarActor.cs (123); Unable to find object: ' ' attempting to call function 'createpath'"
#2
08/08/2008 (7:45 am)
I've figured out that its probably a setting up the map problem, the tutorial utterly failed to explain anything about making a map. It has uncommented code, and that's about it.
#3
That being said, we would need some additional information on what you've done so far, and what specifically is happening just prior to calling that method. As James mentions, the specific error is that you are trying to call the method createPath() on an empty string, instead of an object. We can't however figure out why that is happening until we can see the relevant portions of your code :)
08/08/2008 (11:30 am)
The aStar tutorial is labeled as an advanced tutorial, and states specifically that it requires experience with TorqueScript and general programming. If you haven't had much experience with TorqueScript so far, then I suggest you may want to try some of the other tutorials first before coming back to the aStar functionality.That being said, we would need some additional information on what you've done so far, and what specifically is happening just prior to calling that method. As James mentions, the specific error is that you are trying to call the method createPath() on an empty string, instead of an object. We can't however figure out why that is happening until we can see the relevant portions of your code :)
#4
echo 1 )
in aStarActor find path (1703)<-- obj id (1.635000 -21.323999 )<--Destination
error
game/gameScripts/aStarActor.cs (125): Unable to find object: '' attempting to call function 'createPath'
echo 2)
before return aStarActor
function it errors out on
%newPath = %this.pathGrid.createPath(%this.getPosition(), %destination,
true, // allow diagonal?
true // optimize?
);
03/23/2009 (7:11 pm)
I get the same error but here is my text , I have some hings being echoed to test it outecho 1 )
in aStarActor find path (1703)<-- obj id (1.635000 -21.323999 )<--Destination
error
game/gameScripts/aStarActor.cs (125): Unable to find object: '' attempting to call function 'createPath'
echo 2)
before return aStarActor
function it errors out on
%newPath = %this.pathGrid.createPath(%this.getPosition(), %destination,
true, // allow diagonal?
true // optimize?
);
#5
Here is what I had to add
But now have a new problem.
PathAStar2d::calculate( sX / sY, dX / dY ) - start or end points are not on the grid
Enemy::isFrustrated(austin), timer is (1)
so on to that.
03/25/2009 (5:30 pm)
I found the problem was I was missing a layer so OP you should check that. Here is what I had to add
new t2dTileLayer(PathLayer) {
LayerFile = "~/data/tilemaps/untitled.lyr";
canSaveDynamicFields = "1";
Position = "0.000 -0.000";
size = "80.000 60.000";
CollisionMaxIterations = "1";
CollisionDetectionMode = "CUSTOM";
mountID = "9";
};But now have a new problem.
PathAStar2d::calculate( sX / sY, dX / dY ) - start or end points are not on the grid
Enemy::isFrustrated(austin), timer is (1)
so on to that.
#6
I experienced the same issue:
PathAStar2d::calculate( sX / sY, dX / dY ) - start or end points are not on the grid
Enemy::isFrustrated(austin), timer is (1)
My error was a result of placing my endpoint "off the grid." Meaning the coordinates were not within the boundries of the pathLayer.
Be sure that both start and end points are within the bounds of your pathLayer. If you want the start/end points off your screen (outside the camera bounds), you can create a tileMap which goes beyond your camera limits, and place the start and end points on the grid, but out of the camera view.
04/28/2009 (7:20 pm)
Hi Austin,I experienced the same issue:
PathAStar2d::calculate( sX / sY, dX / dY ) - start or end points are not on the grid
Enemy::isFrustrated(austin), timer is (1)
My error was a result of placing my endpoint "off the grid." Meaning the coordinates were not within the boundries of the pathLayer.
Be sure that both start and end points are within the bounds of your pathLayer. If you want the start/end points off your screen (outside the camera bounds), you can create a tileMap which goes beyond your camera limits, and place the start and end points on the grid, but out of the camera view.
Associate James Ford
Sickhead Games