Following Character

Started by Babar, Tue 09/09/2003 14:03:32

Previous topic - Next topic

Babar

I had a problem when trying to implement the following:
I have a room like inside the castle in Last Crusade. It is like an overhead map. I have set some regions, so that if the player walks onto them, a guard is called. The guard reaches the player character, and a dialog is run "Follow me sir" and then I use MoveCharacter blocking to move the player back to a start point. I use FollowCharacter to make the guard follow the player to the point, and when the player gets there, I use another MoveCharacterBlocking to move the guard back to his original position.
I thought it would be simple enough, but I run into alot of problems. Sometimes the guard starts following the character, then moves in another direction (I tried using FollowCharacterEx with eagerness 0 but that did not work either). Sometimes the guard moves to slow, and the player gets to the start point much before the guard, who then turns around and starts going back to his original position.
Any help will be appreciated
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

Ishmael

Try:

When the guard and player are moved:
MoveCharacter(EGO,100,200); // presume moving player to point 100, 200.
MoveCharacter(GUARD,130,200); // the guard moves 30 pixels right of the player
while character[EGO].walking Wait(1);
MoveCharacterBlocking(GUARD,300,120,0); // presume the guard's original position is 300, 120

Any luck?
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Babar

Thanks, it worked great :D. I didn't even think of trying it like that, I was making things more complicated for myself.
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

SMF spam blocked by CleanTalk