Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: wotmeworry on Mon 13/10/2008 07:20:03

Title: Need help with......I don't know what it's called
Post by: wotmeworry on Mon 13/10/2008 07:20:03
I'm sure you've noticed that these adventure games usually have something on the GUI that says "Look at Poster" or "Use Key with Door" or something similar that changes appropriately as you move the mouse around the screen. I don't know if I should be asking this here or in the technical questions page:

How do you do that??

The Help section mentions using @OVERHOTSOPT@ but that just shows the thing your mousing over.

please help! :P
Title: Re: Need help with......I don't know what it's called
Post by: Matti on Mon 13/10/2008 10:31:51
I don't know but there's a LucasArts GUI help thread in the beginners technical and there's a modul for that too as far as I know.
Title: Re: Need help with......I don't know what it's called
Post by: on Mon 13/10/2008 10:49:03
A simple way is to create a GUI that contains a label, and then write a function and call this from repeatedly_execute. In that function, you check the mouse.mode to set a "verb", and what the mouse is over.

Something like this

function myCreateScummText()
{
  if (mouse.Mode == eModeWalkto)    { lblScummText.Text = "walk to "; }
  if (mouse.Mode == eModeLookat)    { lblScummText.Text = "look at "; }
  if (mouse.Mode == eModePickup)    { lblScummText.Text = "take "; }
  if (mouse.Mode == eModeInteract)  { lblScummText.Text = "use "; }
  if (mouse.Mode == eModeTalkto)    { lblScummText.Text = "talk to "; }
 
  if (mouse.Mode == eModeUseinv)    { lblScummText.Text = "use ";
                                      lblScummText.Text = lblScummText.Text.Append(player.ActiveInventory.Name);
                                      if (Game.GetLocationName(mouse.x, mouse.y) != player.ActiveInventory.Name) {
                                        lblScummText.Text = lblScummText.Text.Append(" on ");
                                        lblScummText.Text = lblScummText.Text.Append(Game.GetLocationName(mouse.x, mouse.y));
                                      }                                   
                                    }
    if (mouse.Mode != eModeUseinv)  { lblScummText.Text = lblScummText.Text.Append(Game.GetLocationName(mouse.x, mouse.y)); }
}


In this example, the label in out GUI is called lblScummText. All you need to do then is call this from repeatedly_execute, and off you go.


function repeatedly_execute {
  myCreateScummText();
}
Title: Re: Need help with......I don't know what it's called
Post by: wotmeworry on Mon 13/10/2008 22:33:14
thanks heaps!!

Sorry I didn't notice that thread about lucasarts GUIs. I'll be sure to check up there next time ;D ;D