////////////////////////////////////////// Current Code:
#define _FORCE skill18 // value = 1
#define _MOVEMODE skill19 // value = 1
#define _TARGET_X skill20 // value = 1

action patrol_path()
{
// attach entity to nearest path
result = path_scan(me,me.x,me.pan,vector(360,180,1000));
if (result == 0) { return; } // no path found

// find first waypoint
var node = 1; // start at first node
//path_nodepos(my,node,my._TARGET_X);
path_scannode(my, node);


while (my._MOVEMODE)
{
// find direction
//result = vec_to_angle(ANGLE * ang,vec_diff(temp,my._TARGET_X,my.x));
result = vec_to_angle(ang,vec_diff(vector,my._TARGET_X,my.x));
// near target? Find next waypoint of the path

if (result < 25)
{
node = path_nextnode(my,node,1);
//path_nodepos(my,node,my._TARGET_X);
path_scannode(my, node);
}

// turn and walk towards target
//actor_turnto(angle.PAN);
//actor_moveahead(MY._FORCE);
wait(1);
}
}
////////////////////////////////////////// End of Code

The code does run but as soon as the game starts he says: Error (E1513) crash in patrol_path().

The code is pretty basic and I can't find anything wrong with.
Anyone able to help me?
Thanks in advance!



Last edited by Staakman; 11/18/08 14:36.