Making a per-room default action

Started by llamaman, Thu 06/08/2009 22:25:32

Previous topic - Next topic

llamaman

So, I know this should be realativly easy, but I can't find the function for defining what the default message displayed when you perform an action on something that doesn't have any text specified is.  I would like to do this on a per-room basis, as well, though I imagine I could just have each room's code change the default, if I can figure out how to set the default.

In case I'm being unclear by perform an action, I mean if you look at something, or use it or whatever.

monkey0506

There's the "unhandled_event" function, so you could put something like this in GlobalScript.asc:

Code: ags
function unhandled_event(int what, int type) {
  if (what == 1) { // hotspot interaction
    if (type == 1) { // look at hotspot
      if (player.Room == 1) { // the player is in the first room
        player.Say("It's too dark to  see anything in here.");
      }
      else { // all other rooms
        player.Say("Doesn't look too special to me.");
      }
    }
  }
}

SMF spam blocked by CleanTalk