Train to follow a rail (path)

Posted By: Steempipe

Train to follow a rail (path) - 10/16/13 17:19

Hi,
I am looking for any resources, or hints, to program a train to follow a path of rails.
Thanks,
Eric
Posted By: rayp

Re: Train to follow a rail (path) - 10/18/13 05:15

U need it in c-script ? If not this one from aum could help
Code:
action guard()
{

while(1) {

vec_set(my.skill2,my.x);

path_spline(me,my.x,my.skill1);
my.skill1 += 3*time_step;


vec_diff(my.skill5,my.x,my.skill2);
vec_to_angle(my.skill8,my.skill5);

my.pan += clamp(ang(my.skill8-my.pan)*0.25,-5,5)*time_step;
my.anim_index += 5 * time_step;
ent_animate(my,"run",my.anim_index,ANM_CYCLE);
wait(1);
}
}

Did not test just copy and pasted.
Posted By: Steempipe

Re: Train to follow a rail (path) - 10/18/13 10:39

Thanks! I'll work with your paste and pointer to AUM. Eric
© 2024 lite-C Forums