Bug with AStarDemo Code
by Brandon Bercovich · in Torque Game Builder · 03/10/2009 (6:02 pm) · 1 replies
Not sure where I should put this but I was messing around with doing a Nofity using the aStarActor Demo code with "TestWorldChange" and it wasn't working how I thought it should.
The code that comes with the demo calls test paths with one argument.
%newPathExists = %thisActor.testPaths(%thisActor.destinationCoords);
The function is defined here:
function aStarActor::testPaths(%this, %grid, %destination)
I could be wrong but I think the %grid var isn't needed since no where in the function it is used.
Unless it was put in for some future use.
I changed the function to:
function aStarActor::testPaths(%this, %destination)
and everything worked how I thought it should.
Just wanted to post this incase anyone else ran into this issue.
The code that comes with the demo calls test paths with one argument.
%newPathExists = %thisActor.testPaths(%thisActor.destinationCoords);
The function is defined here:
function aStarActor::testPaths(%this, %grid, %destination)
I could be wrong but I think the %grid var isn't needed since no where in the function it is used.
Unless it was put in for some future use.
I changed the function to:
function aStarActor::testPaths(%this, %destination)
and everything worked how I thought it should.
Just wanted to post this incase anyone else ran into this issue.
Torque Owner Johnny Sprada
Thank you for this info. I'm having trouble setting up a test path and was running in to this same problem, this fixed it.
Now I have one more dilemma, maybe you can help me with. I have waves of enemies moving over my tile layer. I can use the testing path, to prevent the placement of an object that would block my actor's path, but only as long as an actor is on the path. So the open path can be blocked between waves of enemies. This, of course, is undesirable.
Do you know if there is a way to put an actor on the path that always exists, but doesn't move along the path?
This would allow me to prevent an illegal placement between waves.