Unhandled_event (SOLVED)

Started by sloppy, Fri 31/03/2006 21:14:01

Previous topic - Next topic

sloppy

In the unhandled_event function, how would I get a different display message depending on which character I use an inventory item on?

Ashen

Use the Character.GetAtScreenXY(..) function, e.g. (untested):
Code: ags

function unhandled_event (int what, int type) {
  if (what == 3 && type == 3) { // Use inv on character
    Character *theChar = Character.GetAtScreenXY(mouse.x, mouse.y);
    //Creates a pointer to the character clicked on
    if (theChar == cEgo) cEgo.Say("Why would I want to use that on myself?");
    else if (theChar == cBob) cEgo.Say("I don't think he'd like that...");
    // etc
  }
}
I know what you're thinking ... Don't think that.

sloppy


SMF spam blocked by CleanTalk