Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Tue 27/07/2004 14:36:30

Title: Few questions
Post by: on Tue 27/07/2004 14:36:30
Hi all!

1. How can I made so, that when a mouse pointer goes over a hotspot, there would be a "message" that tell's what is it? Like look at car. Like in the demo game. Hope you understand this question.

2. Where can I download sierra-style GUIS? I tried to use the same GUI that is in demogame. But I was not able to get it work perfectly. It works guite fine, but few things don't work in it.

Thanks a lot!
Title: Re: Few questions
Post by: Konador on Tue 27/07/2004 16:47:52
Quote from: Rd27 on Tue 27/07/2004 14:36:30
1. How can I made so, that when a mouse pointer goes over a hotspot, there would be a "message" that tell's what is it? Like look at car. Like in the demo game. Hope you understand this question.

In the status bar GUI, add a label. Make the label say @OVERHOTSPOT@. That should be fine.

Quote from: Rd27 on Tue 27/07/2004 14:36:30
2. Where can I download sierra-style GUIS? I tried to use the same GUI that is in demogame. But I was not able to get it work perfectly. It works guite fine, but few things don't work in it.

Isnt the demo game GUI the default AGS GUI? When I made my first game I didn't do anything about setting up the GUI and it was the same as the demo game one I think.
Title: Re: Few questions
Post by: Rd27 on Tue 27/07/2004 19:46:14
When I started to make my practice game, I rememer that the GUI was not the same that was in demogame, but i'm not sure :)

I try to do what you said, maybe that will work. Thanks!

By the way, my login now works, so I can be a member finally:)
Title: Re: Few questions
Post by: Rd27 on Tue 27/07/2004 22:45:54
The Gui is now showing the hotspot name when mouse pointer goes over it (I added the @HOTSPOTOVER@ to the gui).

But I want, that if I choose to look at hotspot, it would say example : Look at car. Or if I choose to interact, it would say interact with car.

The gui does not do it now, so how can I make it so?

By the way, was there any way to change the default speech speed?

Thanks again :D
Title: Re: Few questions
Post by: on Wed 28/07/2004 04:36:25
1. It's @OVERHOTSPOT@, not HOTSPOTOVER...
2. Programming a label like that is kind of difficult. I am trying to make a SCUMM GUI, and I'm having to program a label exactly like that. I don't have access to my AGS right now, but if you try using something like this:

function repeatedly_execute{
//blah blah blah
string label, buffer;
GetLocationName(mouse.x, mouse.y, buffer);
SetLabelText(GUINAME, LABEL#, label);
StrCat(label, buffer);
//replace GUINAME with GUI that label is on, replace LABEL# with the
//number of the object number of the label on the GUI...
if (GetCursorMode()==MODE_WALK){
  StrCopy(label, "");
  StrCat("Walk to ");
  }
else if (GetCursorMode()==MODE_LOOK){
  StrCopy(label, "");
  StrCat("Look at ");
  }
else if (GetCursorMode()==MODE_WHATEVER){
  StrCopy(label, "");
  StrCat("Other modes ");
  }
//etc... etc... Add all modes.
}

This script needs a lot of work, but that's the general idea. Also, I think that there's something like:

game.text_speed

Or something like that. Check the manual for Game Global Variables... Hope I helped.
Title: Re: Few questions
Post by: Rd27 on Wed 28/07/2004 09:35:03
Thanks!!! :)
Title: Re: Few questions
Post by: Proskrito on Wed 28/07/2004 11:03:02
i think it does not really need so much work. you could make a custom function, before all default functions, like:

function SetActionText(int gui, int object){
  string text;
  int mode=GetCursorMode();//store current cursor mode in 'mode' variable
  if (mode==MODE_WALK) StrCopy(text, "Walk to ");//Copy "Walk to " to action text
  else if (mode==MODE_LOOK)  StrCopy(text, "Look at ");//Copy "Look at " to action text
  else if (mode==MODE_PICKUP)  StrCopy(text, "Pick up ");//Copy "Pick....
  else if (mode==MODE_USE)  StrCopy(text, "Use "); //or "Interact with "
  else if (mode==MODE_TALK)  StrCopy(text, "Talk to ");
  else if (mode==MODE_USEINV){// If using an inventory item on something
    string invname;
    StrCopy(text, "Use ");//Copy "Use " to action text
    GetInvName(character[GetPlayerCharacter()].activeinv, invname); //Store inventory item name in 'invname' variable
    StrCat(text, invname);// add name to action text
    StrCat(text, " with ");// add " with " to text
  }
  StrCat(text, "@OVERHOTSPOT@");//add the name of what the mouse is over.
  SetLabelText(gui,object,text); //Set the text to the specified label
}


Then, in the repeatedly execute, you just put:

SetActionText(YOURGUI, YOUROBJECT);

replacing YOURGUI and YOUROBJECT with the GUI name / object number of the label you want to put the text in.
This way doesnt look so dificult, and you keep your repeatedly_execute cleaner
Title: Re: Few questions
Post by: on Wed 28/07/2004 12:19:31
Yes, I suppose that would be much easier. I usually don't think things through. I just get the script to work and call it good. And unless I'm mistaken, that text would add the cursor mode to the label repeatedly because it isn't blocked from doing so, thus flooding the label, causing the game to fail because the label is too long. Use Proskrito's script. It's much simpler. That way you don't have to bother with scripting something to block the game from flooding your label.