Run interaction when characters collide

Started by limeTree, Fri 14/07/2006 12:59:56

Previous topic - Next topic

limeTree

Its like this.
I make a main character that goes to a basement,finds a strange machine with a hole,throws a bottle and suddenly attacked by vampire.
I managed to make him follow her but how to make him kill her when reaching her.
I tried things like:(IScollidingwithchar-but i dont understand the area code,i write something like quti game and it doesnt work)
Can somebody please explain me how to make that vampire follow the character and kill him if he touches him.(Like 5 days a stranger,or Clock tower.)

EDIT by Ashen: descriptive title.

R4L

Try one of the modules around here. I believe there is a module that suits your needs in the Technical Archive.

EDIT: Here is a link to SSH's Pixel Perfect Collision Detection Module.

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=26307.0

Khris

Put this in the repeatedly_execute():

if (player.IsCollidingWithChar(character[VAMPIRE])) {Ã,  Ã, //Ã,  or cVampire, whatever his name is
  Display ("You're dead.");
Ã,  QuitGame(0);
}

What do you mean when talking about "area code"?

Ashen

Can you post exactly the code you tried, and where you put it?
Khris's code should work, although Character.IsCollidingWithChar only checks the baselines of the characters - AreThingsOverlapping, or the module Rap4Life42o mentioned, might give better results.
You could also directly compare the characters coordinates (again, in repeatedly_execute) - but posssibly that's what you meant by not understanding the 'area code'? There's a couple of examples you could work from in the RPG thread (starting here - just ignore the keycode stuff).

And please use a more descriptive thread title in the future.
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk