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?
If you did
FollowCharacter(MAN, EGO);
just do
FollowCharacter(MAN, -1);
Thanks!
You're welcome. :)
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?
if (player.x < cAi3.x) {
cEgo.Animate(8, 5, eOnce, eNoBlock);
cAi3.Animate(8, 5, eOnce, eBlock);
SetGlobalInt(22, 1);
cAi3.FollowCharacter(player, -1);
}
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.
Thanks! This'll be a big help in the future too.
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 (http://www.adventuregamestudio.co.uk/manual/Character.FollowCharacter.htm).