Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: 1337_123f13x35 on Sat 18/02/2006 11:35:33

Title: Character Following
Post by: 1337_123f13x35 on Sat 18/02/2006 11:35:33
How do you get a NPC or other player character to CONSTANTLY follow your character throughout the whole game... I looked through the manual and did a search through the manual... but I can't find anything! ;D

Apprechiate the help ;D
8)
Title: Re: Character Following
Post by: Ashen on Sat 18/02/2006 12:18:43
You can't have searched the manual very hard if you didn't find Character.FollowCharacter(...) (http://www.adventuregamestudio.co.uk/manual/Character.FollowCharacter.htm)

If you want it to be all through the game, call it in game_start, or when you enter the first room, and never stop it.
Title: Re: Character Following
Post by: 1337_123f13x35 on Sat 18/02/2006 12:45:07
Will I program this in the global script then?
Title: Re: Character Following
Post by: Ashen on Sat 18/02/2006 13:04:59
That's where game_start is, which is probably the simplest way to do it. If you went with one of the 'Player enters screen' interactions (first time, before fadein, after fadein) for the first room, then obviously it'd be in the room script.
Title: Re: Character Following
Post by: 1337_123f13x35 on Sat 18/02/2006 14:15:38
From my understanding then i have to put in this line: cMan.FollowCharacter (cEgo, 5, 80);function game_start() {

However I'm getting an error saying "Unexpected cMan" Any ideas?

???

Once again... apprechiate the help :p

8)
Title: Re: Character Following
Post by: Ashen on Sat 18/02/2006 14:21:17
Does it actually say cMan.FollowCharacter (cEgo, 5, 80);function game_start() {? The command needs to be between the braces ('{' and '}') of the function, like this

function game_start() {
  cMan.FollowCharacter (cEgo, 5, 80);
}


Otherwise it's outside of the function, where it can't be run (and you'd get the error you described).
Title: Re: Character Following
Post by: 1337_123f13x35 on Sat 18/02/2006 14:50:01
Thank you very much for the help it works perfectly now  :o

It's not hard once you understand how:)

Thanks very much for the help... I find the manual quite hard to follow tbh I'm afraid  >:(

But with your help things are turning out prety good I really apprechiate the help  ;D
Title: Re: Character Following
Post by: on Sat 18/02/2006 21:22:41
If you use the 'player enters room' interaction, you can set 'character follows character'.
Could you not just do that on the first room, or would the other character not follow into different rooms etc?
Title: Re: Character Following
Post by: A�rendyll (formerly Yurina) on Mon 20/02/2006 09:39:55
I'm trying the same thing with my RPG, but the characters I don't want them to follow the main character forever.

Can I put in this code anywhere (in combination with stop following character)?