Make characters stop following the main character

Started by Mats Berglinn, Thu 17/02/2005 21:08:15

Previous topic - Next topic

Mats Berglinn

I have looked in the manual for AGS but I can't find a way to stop the characters from following the main-character. The manual says "Pass CHARTOFOLLOW as -1 to stop the character following." but I can't find that anywhere, nor can I find a code to make the characters stop follow.

Can anyone, please, help me?

strazer

If you did
  FollowCharacter(MAN, EGO);
just do
  FollowCharacter(MAN, -1);

Mats Berglinn



WHAM

Sorry to wake up this old hag here, but it was the only thread I could come up with my searches that seemed appropriate.

I used the script given above to stop the following, but it has one minor setback. For some reason the NPC who was supposed to stop following the main character, appears to every room the main character is in, only late, and as his view is set to lying down in a pool of blood, hes there, at the door, lying in a pool of blood... Ideas?

Code: ags

if (player.x < cAi3.x) {
cEgo.Animate(8, 5, eOnce, eNoBlock);
cAi3.Animate(8, 5, eOnce, eBlock);
SetGlobalInt(22, 1);
cAi3.FollowCharacter(player, -1);
}
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

strazer

The script language has changed since my last answer.
The function is no longer stand-alone, no longer requiring you to specify both characters as parameter.
Instead, the function is now part of one character and needs you to specify the character to follow (or not).

So instead of
  FollowCharacter(AI3, EGO);
do
  cAi3.FollowCharacter(null); // tell cAi3 to follow noone

The function has other, optional parameters which is why you didn't get a compile error with the -1.

Please check the manual first on how to use the new functions to avoid these kinds of problems in the future.

WHAM

Thanks! This'll be a big help in the future too.
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

Ashen

Quote from: strazer on Tue 22/05/2007 19:15:09
Please check the manual first on how to use the new functions to avoid these kinds of problems in the future.

Indeed. For future reference, this IS mentioned in the Manual Entry.
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk