Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Fri 16/07/2004 10:52:06

Title: making a character vanish from a room
Post by: on Fri 16/07/2004 10:52:06
Hi,

I just want to know to make a character vanish from the current room. Example, two characters are colliding (fighting), if one of the characters health reaches 0, he will die and disappear from the room. How do you guys do this?

Thanks!    ;D
Title: Re: making a character vanish from a room
Post by: Mr Jake on Fri 16/07/2004 10:56:40
character[XXX].room = Y

XXX = the characters script name.
Y = room number (just make it -1)
Title: Re: making a character vanish from a room
Post by: on Fri 16/07/2004 11:03:45
Thanks HotSpotÃ,  :)

I just did this as you said.

if (AreCharactersColliding(EGO,JACK)==1)
{
Ã,  Display("You're bumping against me!");
Ã,  StopMoving(JACK);
Ã,  character[JACK].room = -1;
}

I set my 2nd character JACK to FollowCharacterEx(JACK, EGO, 1, 10) when EGO enters the room for the first time. But after JACK bumps EGO, he just goes back to his starting position and starts walking towards EGO. JACK is supposed to be in room -1 after he bumps EGO...



Title: Re: making a character vanish from a room
Post by: on Fri 16/07/2004 11:13:02
I guess if I know the right command to stop JACK from following EGO after they collided, this will solve my problem... What's the command for stopping a character from following another character?
Title: Re: making a character vanish from a room
Post by: Ashen on Fri 16/07/2004 11:53:37
Use FollowCharacter, and set the character to follow to -1, so:

FollowCharacter (JACK, -1);
Title: Re: making a character vanish from a room
Post by: on Sat 17/07/2004 09:31:50
CoolÃ,  8) just tried it and it worked, thanks!Ã,  ;D