Hi,

I'm trying to let an object following a path with an action.
I tryed using the patrol_path() action example.
Problem I'm having is it dosn't recognize _FORCE and _MOVEMODE.
What is the best solution for this when I'm programming in a .c file?
Should I include some header?

Thanks in advance,

Staakman

/////////////////////////////////Start Code/////////////////////////////////////
// move along a path loop
// uses _FORCE, _MOVEMODE
action patrol_path()
{
// attach entity to nearest path
result = path_scan(me,my.x,my.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);

while (my._MOVEMODE)
{
// find direction
result = vec_to_angle(angle,vec_diff(temp,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);
}

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

Last edited by Staakman; 11/12/08 15:03.