chasing the playermodel without to change pan of chaser

Posted By: Ness

chasing the playermodel without to change pan of chaser - 04/10/09 11:48

hello,there was a tutorial in aum about a code that an actor follows the player! the problem is, i cant figure out how to make it that the follower follows the placer but does not change his PAN!
here is the code:

Click to reveal..

action slave
{
var slave_target;
var slave_speed;
my.passable = on;
while (robot_boss == null) {wait (1);}
while (1)
{
my.tilt = 0;
slave_target.x = robot_boss.x; // stay 50 quants
slave_target.y = robot_boss.y; // behind robot_boss
slave_target.z = robot_boss.z;
slave_speed.x = 5 * time;

vec_set (temp.x, slave_target.x);
vec_sub (temp.x, my.x);
vec_to_angle (my.pan, temp);

ent_move (slave_speed, nullvector);

my.tilt = 0;
wait (1);
}
}



the slave model follows to the player and stops,if he reached the salve target! The slave target is the position of the robot boss!
So i want that the slave does not look the player! it have to rotate while following the robot boss!
how can i make this?
greetings ness
Posted By: the_clown

Re: chasing the playermodel without to change pan of chaser - 04/10/09 12:47

You can try this:
(Changed code:)


action slave
{
var slave_target;
VECTOR slave_speed;

my.passable = on;
while (robot_boss == null) {wait (1);}
while (1)
{
my.tilt = 0;
slave_target.x = robot_boss.x; // stay 50 quants
slave_target.y = robot_boss.y; // behind robot_boss
slave_target.z = robot_boss.z;


vec_set (temp.x, slave_target.x);
vec_sub (temp.x, my.x);
vec_to_angle (my.skill30, temp);

slave_speed.x = 12*time_step;
vec_rotate(slave_speed.x,my.skill30);

ent_move (nullvector,slave_speed);

my.tilt = 0;
wait (1);
}
}


I have no time to try this out now, just give it a try.

Posted By: Ness

Re: chasing the playermodel without to change pan of chaser - 04/10/09 22:10

well it floows the boss,but if he reached the boss then he is vibratting like the hell lol!
And he doesnt rotating really! He moves in a zig zack form lol!
Posted By: the_clown

Re: chasing the playermodel without to change pan of chaser - 04/11/09 13:42

Well, to prevent him from rotating, just let him never reach the boss...
Posted By: Ness

Re: chasing the playermodel without to change pan of chaser - 04/12/09 10:11

Originally Posted By: the_clown
Well, to prevent him from rotating, just let him never reach the boss...

...?


whatever,doesnt there exist another possibilities not to use the pan funktion so that the slave follows the player/boss?

greetings ness
© 2024 lite-C Forums