Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: barefoot on Mon 23/11/2009 20:40:59

Title: 2 characters collide and Main character has to die... How would I do this?????
Post by: barefoot on Mon 23/11/2009 20:40:59
Hi

I have a character following the main character, if the follower catches up to the character then the main character dies... its a collision question i suppose..

can anyone tell me if this can be done.. in laymans terms..

les
Title: Re: 2 characters collide and Main character has to die... How would I do this?????
Post by: discordance on Mon 23/11/2009 20:43:24
Fear not, there is a function for this - character.IsCollidingWithChar I believe. You can look it up in the manual if you require more details.
Title: Re: 2 characters collide and Main character has to die... How would I do this?????
Post by: barefoot on Mon 23/11/2009 21:00:05
I'm still using earlier version 2.62... cant find that function in manual...

found: AreCharactersColliding....     just need to know how to implement it...
main character is named Red Pants...

Ive used this:

    }
    if (AreCharactersColliding(REDPANTS,GUFF)==0)
   ChangeCharacterView(REDPANTS,11);

global script accepts it but character does not change view..



les
Title: Re: 2 characters collide and Main character has to die... How would I do this?????
Post by: discordance on Mon 23/11/2009 21:09:16
2.62? Sorry, I can't help you with that version, I know nothing of it. Maybe someone else has more knowledge. Or you might consider upgrading to the newer version. It's pretty awesome.
Title: Re: 2 characters collide and Main character has to die... How would I do this?????
Post by: Khris on Mon 23/11/2009 21:48:18
Where did you put that code?

Also, yes, I too recommend moving on to at least 2.72, better 3.x, especially if you've just started using AGS.
If not, familiarize yourself with the new code style of 2.7x, then the new editor introduced with 3.x.

The main reason being that in the meantime, a ton of bugs have been removed, and a ton of new features added.
Title: Re: 2 characters collide and Main character has to die... How would I do this?????
Post by: barefoot on Mon 23/11/2009 22:05:41
i did look at the latest ags..  i could not seem to find a way to make a character walk-to from region....

les
Title: Re: 2 characters collide and Main character has to die... How would I do this?????
Post by: Gilbert on Tue 24/11/2009 00:44:13
For AreCharactersColliding(), you have to check whether the value is non-zero for a collision, also, where did you put that two lines in the script?
Title: Re: 2 characters collide and Main character has to die... How would I do this?????
Post by: barefoot on Tue 24/11/2009 07:48:52
i entered it in to the Global script

les
Title: Re: 2 characters collide and Main character has to die... How would I do this?????
Post by: Gilbert on Tue 24/11/2009 08:03:21
Where in your global script did you add it? That's what I have asked.

Did you add it to the repeatedly execute function or elsewhere?
Title: Re: 2 characters collide and Main character has to die... How would I do this?????
Post by: barefoot on Tue 24/11/2009 13:56:35
Thanks for help..    but I have now chosen other options to complete the Maze room... what ide like to be able to do, not essential, is set it on a TIMER if I can..

Les
Title: Re: 2 characters collide and Main character has to die... How would I do this?????
Post by: Khris on Tue 24/11/2009 14:18:03
There's a manual that comes with AGS. Just press F1.
Title: Re: 2 characters collide and Main character has to die... How would I do this?????
Post by: Calin Leafshade on Wed 25/11/2009 00:24:47
I pressed F1 for help.. but nobody came.
Title: Re: 2 characters collide and Main character has to die... How would I do this?????
Post by: barefoot on Wed 25/11/2009 09:59:43
Have now started using 3.1....

Qikfire