Setting up an interface

Started by arrtisste36, Mon 12/01/2009 18:36:03

Previous topic - Next topic

arrtisste36

I'm bad at figuring out scripting commands myself, so bear with me.  :-\

I don't like the basic interface that AGS comes with.  I prefer an interface in which the left mouse button serves as "Look at" or "Walk to" if there's nothing to look at.  Right click to interact with something.  I also want to have a GUI at the top that gives a description of what you're doing.  Like, if I mouse over a book, it would say "Look at book."  How would I go about incorporating both of these ideas into a game?

Khris

Personally, I'd just display "book", since a right-click will interact with it.
Just create a label on a GUI, make the GUI use background and border color 0, and set the label's text to "@OVER_HOTSPOT@" (not sure about the exact spelling of the token, look it up if it doesn't work).

Then find the on_mouse_click function in the global script, and change the left and right click behavior as follows:

Code: ags
  if (button == eMouseLeft) {
    int mm;
    if (GetLocationType(mouse.x, mouse.y) == eLocationNothing) mm = eModeWalkto;
    else mm = eModeLook;
    ProcessClick(mouse.x, mouse.y, mm);
  }
  else if (button == eMouseRight) {
    ProcessClick(mouse.x, mouse.y, eModeInteract);
  }

ALPHATT

I'd suggest leftmb(walk&interact), rightmb(look)

this method is more common when using lmb/rmb instead of different icons.
/sig


Fritzi

(1) It's eModeLookat, not eModeLook.
(2) With the code above, you loose the ability to talk to players, I'd suggest the scheme Leftclick = walk/lookat, Rightclick = talk/interact.

Code: ags

  else if (button == eMouseLeft) {
    int mm;
    if (GetLocationType(mouse.x, mouse.y) == eLocationNothing) mm = eModeWalkto;
    else mm = eModeLookat;
    ProcessClick(mouse.x, mouse.y, mm);
  }
  else if (button == eMouseRight) {
    int nm;
    if (GetLocationType(mouse.x, mouse.y) == eLocationCharacter) nm= eModeTalkto;
    else nm=eModeInteract;
    ProcessClick(mouse.x, mouse.y, nm);
  }

Khris

#5
They aren't listed in the manual and I was too lazy to open AGS to verify two letters ;)
More importantly though,
what's stopping you from putting talk to-code into "interact with character"?

arrtisste36

Yeah, I was planning for "Talk To" to be included in interact.  Sorry if I didn't make that clear.  Thanks for the help everyone!

SMF spam blocked by CleanTalk