Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Blitzerland on Wed 20/07/2005 02:02:43

Title: Event on, when chars close
Post by: Blitzerland on Wed 20/07/2005 02:02:43
Question One:

How can I make something happen when two characters get within a certain range of eachother?

Forget the second question. Idiot that I am, I fixed the problem seconds after posting this.
Title: Re: A quick scripting question
Post by: Theme on Wed 20/07/2005 04:33:03
if ( ((character.x - otherchara.x) <= range && (character.x - otherchara.x) >= -range) || ((character.y - otherchara.y) <= range && (character.y - otherchara.y) >= -range) )
{
do stuff here...
}


i dunno if this works... put in repeatdly executed in the room script

o/