|
Re: Pathfinding on native Gamestudio graphs
[Re: Tai]
#290959
09/22/09 16:08
09/22/09 16:08
|
Joined: Sep 2008
Posts: 68
Tai
Junior Member
|
Junior Member
Joined: Sep 2008
Posts: 68
|
Ugh, this is bizarre. When I enter in a dest_node like so
var dest_node = ll_pfind_getClosestNode(my, entTarget.x, 1000, NULL);
it gives me that error. It doesn't seem to like my pointer or something... Because if I use player.x it works fine.
(the pointer is defined exactly the same way it is in your scripts, I've checked.)
EDIT: I got it, finally. When defined as void instead of action, pathfinders can find the object pointed to.
Last edited by Tai; 09/22/09 16:57.
|
|
|
Re: Pathfinding on native Gamestudio graphs
[Re: Tai]
#290980
09/22/09 18:27
09/22/09 18:27
|
Joined: Dec 2008
Posts: 271
Saturnus
OP
Member
|
OP
Member
Joined: Dec 2008
Posts: 271
|
Technically it shouldn't matter if you're using void or action. However, the last time I checked your script, the movement code could invoke random behaviour, as the you pointer (which was not set) and a var instead of a VECTOR were used. Make sure you ar using something like this:
VECTOR vec_to_target;
vec_diff(&vec_to_target, &node->pos, &my->x);
vec_to_angle(&my->pan, &vec_to_target);
c_move(my, vector(10 * time_step, 0, 0), nullvector, GLIDE);
|
|
|
Re: Pathfinding on native Gamestudio graphs
[Re: Saturnus]
#303235
12/27/09 02:25
12/27/09 02:25
|
Joined: Sep 2008
Posts: 68
Tai
Junior Member
|
Junior Member
Joined: Sep 2008
Posts: 68
|
I'm at my wit's end here... It was working; then it stopped.
action test_pather()
{
path_set(my, "path_000");
var start_node = ll_pfind_getClosestNode(my, my.x, 1000, NULL);
var dest_node = ll_pfind_getClosestNode(my, player.x, 1000, NULL);
LL_LIST *path = ll_pfind_getPathToTarget(my, start_node, dest_node, ll_pfind_astarCost);
while(!path)
{
beep();
wait(1);
}
}
This beeps, which shouldn't be happening. If I use the full script, I get errors when trying to modify the list; and I get a bit_array error when I compile the full script.
|
|
|
|