Following question

Non-platform specific questions.

Following question

Postby Troodon » Sun Feb 12, 2006 1:00 pm

Does anybody know how can I make an actor to follow another actor using the same route than the main actor.

better explainer wrote:Actor B follows actor A by the same route than actor A has just use.
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby duracel92 » Sun Feb 12, 2006 9:39 pm

you could use paths? couldn't you? i think...
duracel92
 
Posts: 132
Joined: Sat Jan 21, 2006 10:45 pm
Location: UK
Score: 0 Give a positive score

Postby Game A Gogo » Sun Feb 12, 2006 10:17 pm

i dont tink its posiple unless you use some sort of ultra complicated script, lol.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Novice » Sun Feb 12, 2006 10:45 pm

You can do this by making the main actor create point actors on a timer, and then use a move to funct. to the last point actor and when it reaches that positions it destroys that point and so on.Also you could make it create another point actor each time a significant change in angle is made so actor B wouldnt cut across corners. Does this make any sense?

B-> P1..........P2...........P3.......P4........A->
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby Fuzzy » Mon Feb 13, 2006 12:45 am

what I would do is every draw, the actor in the lead emits his X and Y locations to a global array. Then each draw, the following actor looks that location up, and heads to it.

Thats assuming that every actor might be followed.

In the case of one actor always leading and one always following, just have the lead actor send his X and Y direct to the follower.

Put something like this in the leaders script.

FollowerXdest = x;
FollowerYdest = y;

then inside the followers script, you get follower to moveto(FollowerXdest,FollowerYdest)
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Postby Troodon » Mon Feb 13, 2006 6:58 pm

novice wrote:You can do this by making the main actor create point actors on a timer, and then use a move to funct. to the last point actor and when it reaches that positions it destroys that point and so on.Also you could make it create another point actor each time a significant change in angle is made so actor B wouldnt cut across corners. Does this make any sense?

B-> P1..........P2...........P3.......P4........A->

three finger pete wrote:what I would do is every draw, the actor in the lead emits his X and Y locations to a global array. Then each draw, the following actor looks that location up, and heads to it.

Thats assuming that every actor might be followed.

In the case of one actor always leading and one always following, just have the lead actor send his X and Y direct to the follower.

Put something like this in the leaders script.

FollowerXdest = x;
FollowerYdest = y;

then inside the followers script, you get follower to moveto(FollowerXdest,FollowerYdest)


THANK YOU VERY MUCH!!! :D :D
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron