Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, SBGuy), 987 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
chasing the playermodel without to change pan of chaser #260373
04/10/09 11:48
04/10/09 11:48
Joined: Oct 2008
Posts: 112
N
Ness Offline OP
Member
Ness  Offline OP
Member
N

Joined: Oct 2008
Posts: 112
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

Re: chasing the playermodel without to change pan of chaser [Re: Ness] #260382
04/10/09 12:47
04/10/09 12:47
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
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.


Last edited by the_clown; 04/10/09 12:50.
Re: chasing the playermodel without to change pan of chaser [Re: the_clown] #260449
04/10/09 22:10
04/10/09 22:10
Joined: Oct 2008
Posts: 112
N
Ness Offline OP
Member
Ness  Offline OP
Member
N

Joined: Oct 2008
Posts: 112
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!

Re: chasing the playermodel without to change pan of chaser [Re: Ness] #260496
04/11/09 13:42
04/11/09 13:42
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
Well, to prevent him from rotating, just let him never reach the boss...

Re: chasing the playermodel without to change pan of chaser [Re: the_clown] #260598
04/12/09 10:11
04/12/09 10:11
Joined: Oct 2008
Posts: 112
N
Ness Offline OP
Member
Ness  Offline OP
Member
N

Joined: Oct 2008
Posts: 112
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


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1