Collisions between Characters

Started by Blackthorne, Tue 07/10/2003 22:03:42

Previous topic - Next topic

Blackthorne

Okay, I'm having a small problem - I need to make it so when one character touches another, the player dies.... I've used AreCharactersColliding, but it only works on a certain region.... do I have to set the whole screen as a region to which this pertains, or is there an easier way to do it?

Steve
-----------------------------------
"Enjoy Every Sandwich" - Warren Zevon

http://www.infamous-quests.com

taryuu

you mean the player chracater (ego) touches another chracter?  you could run the interations editor, and on (interact with) you could run a script that would kill one of them.  is that it or what?  
I like having low self-esteem.  It makes me feel special.
   
taryuu?

Ishmael

Are you using what? The global rep_ex? Room rep_ex? Or "player stands on region"?
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Minimi

well, im at school at the moment so I can't type out of my head the code precise but maybee this is an idea.

Global Script repeatley execute :
set a line in there to set global value 1 to the x-coordinate of character1.

set a line in there to set global value 2 to the x-coordinate of character2.

set a line in there to set global value 3 to the y-coordinate of character1.

set a line in there to set global value 4 to the y-coordinate of character2.

after that... use set the following :
if "global value 1 " - "global value 2" = >10;
       // type here what happens when collision is there

after that... use set the following :
if "global value 3" - "global value 4" = >20;
       // type here what happens when collision is there

So this runs everytime a check if character 1, is from a certain distance from the other character... if it's within the numbers 10 and 20 then your code should be runned.

Maybee someone else can turn my idea into script... or I will look at it when I get home. GL!

TeeKay

you could make a new function for it, which you then can use in the room rep_ex where you want to check if two characters are colliding...

But the AreCharactersColliding(); should work, if it is executed. Where do you have the command?

SMF spam blocked by CleanTalk