function boot_player()
{
my.ambient=100;
// 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_getnode(my,node,my.skill20,NULL);
while (1)
{
var angle[3];
// find direction
result = vec_to_angle(angle,vec_diff(temp,my.skill20,my.x));
// near target? Find next waypoint of the path
if (result < 25) {
node = path_nextnode(my,node,1);
path_getnode(my,node,my.skill20,NULL);
my.z = -180;
if(node==3)
{
my.z = -180;
node=1;
result = path_scan(me,my.x,my.pan,vector(360,180,1000));
path_getnode(my,node,my.skill20,NULL);
my.z = -180;
}
}
// turn and walk towards target
//
my.pan = angle[0];
//my.z = -180; //<==if i put this it will stuck on the point where the player is gliding.
//c_move(me,vector(3*time_step,0,0),NULL,GLIDE); // walk ahead...
c_move(my,vector(3*time_step,0,0),nullvector, IGNORE_YOU | IGNORE_PASSABLE | IGNORE_WORLD | GLIDE ); //moves the player
my.skill[41] += 6*time_step;
if(my.skill[41] > 100) {my.skill[41] = 0;}
ent_animate(my,"walk",my.skill[41],ANM_CYCLE);
wait(1);
}
}