In the unhandled_event function, how would I get a different display message depending on which character I use an inventory item on?
Use the Character.GetAtScreenXY(..) function, e.g. (untested):
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
}
}
Thanks.