moving enemies along path

Posted By: immolat3

moving enemies along path - 11/26/07 02:02

It's me again =P

So basically I have this boss with Three Phases in my game, and during phase 3 he starts to run around, ideally on a set path made in WED, in the direction of the player. I have the boss, a path, and the player in the level. And I am trying to use path_scan to get him onto the path, the only problem is I dont know if its working because Im not sure how to get him to actually move along that path towards the player. The help files i was reading on this assume taht I have some functions already made, which i unfortunatly dont.
Posted By: badapple

Re: moving enemies along path - 11/26/07 03:27

check out aum68 unanswered questions section looks like just what you need
Posted By: immolat3

Re: moving enemies along path - 11/28/07 22:28

i read that and tried it, but it doesn't really work at all. lol.

is there an easy way to just get an entity moving along a path?
Posted By: ello

Re: moving enemies along path - 11/28/07 22:49

this is how i do it atm:
Code:

action pathRunner()
{
my.push = 10;
var health;
VECTOR temp;
VECTOR startPos,endPos,nodeCheck;
var node = 1,anim = 0;
path_set(me, my.string1);
while(1)
{
health = 100;
while(health>0)
{
path_getnode(my,node, startPos, my.skill1);
vec_set(my.x,startPos);
node = path_nextnode(my,node,1);
path_getnode(my,node, endPos, my.skill1);
vec_set(temp,endPos);
vec_sub(temp,my.x);
vec_to_angle(my.pan,temp);
my.tilt = 0;
my.roll = 0;
while(vec_dist(my.x,endPos)>5)
{
c_move(me,vector(15*time_step,0,0),nullvector,IGNORE_SPRITES|IGNORE_PASSABLE|IGNORE_YOU);
anim += result;
ent_animate(me,"walk",anim,ANM_CYCLE);
c_setminmax(me);
wait(1);
}
wait(1);
}
wait(1);
}
ent_remove(me);
}



only problem here your path has to be a closed one, since it doesnt walk back... it works quite good here...
Posted By: immolat3

Re: moving enemies along path - 11/29/07 01:16

im trying that with my character and it keeps setting him at the first part of the path and then he bugs out and goes back and forth in a really small spot quickkkkkkkly
Posted By: ello

Re: moving enemies along path - 11/29/07 07:24

hm, maybe your path has two nodes very nearby and than the path splits into more than one way? since it works here
© 2024 lite-C Forums