MODULE: Description v1.06 - Display hotspot description

Started by SSH, Fri 28/04/2006 16:05:06

Previous topic - Next topic

Gribbler

Someone suggested that it would be better if I ask module questions here, in its own thread, not in beginners section. So here goes:

Q1: Where can I enter coordinates for sticky mode description? I want the description text to be displayed at the bottom of the screen.

Q2: I'm using default AGS gui. When I open inventory screen and move cursor over an item the description text is displayed "behind" the inventory gui. What should I do to display it on it. Or maybe what should I do to hide inv gui when looking on a inventory item, then character says some text about it and inv gui shows up again. That would be great solution cause now character's text about an item (when looking at it in inv gui) is displayed on the right side of the screen (even if character is standing on the left side).

Now before RTFM-kinda-answers... I read it ok, and I don't get it that much to find the solution on my own:-)

Gribbler

Ok, so I partially found a solution for the text displaying. I created a label gui and defined it to always be visible at the bottom of the screen. Now what to do to make the description text be visible on it? I know that function

Description.GUIMode(GUIControl *gc);

is for it. I disabled the overlay btw. But I don't know how to configure this to display the text on my label.

_John_

Quote from: Gribbler on Sun 14/09/2008 14:02:17

When I open inventory screen and move cursor over an item the description text is displayed "behind" the inventory gui.


I got the very same issue  .

I've seen that in Aug 2007 user "magintz" was reporting the same thing.  But i havent found how he sorted that out , as he seemed to jump for another solution .

For now i've got the the overlay description all working fine , with font i want and not displayed while in waiting mode .
Just that inventory thingy , which is a bit annoying .

Just got AGS 2 days ago .. so i'll keep searching as it seems to be also ZOrder related .
If i got anything new i'll keep you posted .

SSH

Overlays are always behind GUIs, so use a GUI with a high ZOrder instead.
12

_John_

Quote from: SSH on Sun 30/11/2008 19:25:39
Overlays are always behind GUIs, so use a GUI with a high ZOrder instead.

ok that make sense .
somehow it wasn't really clear for me that you could use 2 different system to display your data ( overlay / GUI) .

So i've created an empty gui named gDescriptionWin.

i'm calling it that way in the game_start()  function :
Description.GUIMode(gDescriptionWin);     // line 218

i've got the following error then .
Description.asc(218): Error (line 218): Type mismatch: cannot convert 'GUI*' to 'GUIControl*'

what i am doing wrong ?

Trent R

Well, it's saying that you're trying to convert a GUI to GUIControl, so you probably called the wrong type in Description.GUIMode(). I'm DLing right now to check...

[Edit]: Read the documentation in the header. It says
Quote//  Description.GUIMode(GUIControl *gc);
//    Set the module to use the specified GUI Control (button or label) to
//    display text
So you need to put either a label or button on your gDescriptionWin GUI and then use its scriptname, ie.
Description.GUIMode(lblDescriptionWin);


~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

_John_

Thanks a lot Trent , worked like a charm.

My bad , noob ambition trying to go faster than what he can actually understand  :P .
Only playing around with ags for 2 days now .. so i'm still not really used to the logic and namings .

and a big thanks to SSH for making this module .

Old Guy

After much investigation I have solved a problem that I was experiencing, but I wanted to give other users a heads up in case they encountered the same problem.

I am using AGS 3.1.0.60, and the SSH Description Module v1.06, using a location-following GUIMode configuration.

Here is what I was experiencing:

I slide the cursor up to the top of the screen, my custom Iconbar pops into view, and I click on a button. When I click on the bottom half of the button, there is never a problem. But when I click on the top half of a button, 80% of the time the button responds to my click, and the other 20% of the time, the button does not work; I must click on the bottom half of the button to get it to respond. When the top half of the button is not responding, the same is true for all the other buttons on the Iconbar, they too only respond to a bottom-half click.

The problem was solved by changing the Clickable property from True to False on the GUI used for the description.

I am guessing that although the Description Module was not displaying anything while over the Iconbar, an unseen GUI was still present, and sometimes interfered with the click.

In any case, thank you SSH for the module!


Rentin

Hi, Im using the Description Module and I need some help.

I am trying to implement a "Give item to" option into my GUI. Basically the Give option can function pretty much the same way as use item, as in that when they click the give button on the gui it will display "give" in the label and when they mouse over/click inventory item it will display "give (item name) to (hotspot name)" in the label and change the cursor to inventory item graphic. Pretty much EXACTLY like "Use", the only difference is that it will say "GIVE (ai) TO (hs)" instead of "USE (ai) ON (hs)".

I have already added the following code into the Desceiption.ash along side the other verb strings
Code: ags


String GiveS;
String Preposition2S;


And the following into the Description.asc along side the other "Description.VERBS="blahblahblah" which defines which text to display for the given string:
Code: ags


Description.GiveS="Give";
Description.Preposition2S="to";


And I put in 'if (mouse.Mode==eModeGiveto) verb=this.GiveS;' along with the other ones which tell which text to display in the label depending on which mouse mode is currently in effect.
Code: ags

  else {
      if (this.VerbMode==eDescVerbModeAuto) {
     
      if (mouse.Mode==eModeGiveto) verb=this.GiveS;
  
      if (mouse.Mode==eModeLookat) verb=this.LookS;   
      if (mouse.Mode==eModeUse) verb=this.UseS;
      if (mouse.Mode==eModeWalkto) verb=this.WalkS;


And after that I'm stuck... I assume the next step would be to set a code to  tell it that if the "Giveto" cursor is currently in effect and if the player clicks on an inventory item then to display "Give (inventory item name) to (hotspot)" and change the cursor to the coresponding inventory item graphic just like the "use" option. I pretty much want "Give" and "Use" to do the same exact thing, just a different verb and proposition to be displayed depending on which button clicked. I just don't know the code to do it or where to put it.

If you guys could work with me to figure this out it would be much appreciated, I have been trying to figure this out all day yesterday and today. If anyone knows how to do this please explain it to me and include the code and where to put it. Thank you very very much in advanced. I really hope I get this straightened out soon.
I've got FIVE death cards... That can't be good...

Rentin

HA! I figured it out. God that was bugging me.

I basically just set the "Give" gui button to the "use" mouse mode and then set a global variable so that when the player pushed the use button disguised as "give" it sets the variable to 1 and if the player pushed the real use button labeled "Use" it sets the variable to 0.

then I altered the code that came right after if (this.VerbMode==eDescVerbModeUser && this.VerbS!=null) verb=this.VerbS; to:
Code: ags

  else if (player.ActiveInventory!=null && Givegui==1){
    verb=this.GiveS;
    this.Text=String.Format("%s %s %s %s", verb, ai, this.Preposition2S, hs); }
    else if (player.ActiveInventory!=null && Givegui==0){ 
    verb=this.UseS;
    this.Text=String.Format("%s %s %s %s", verb, ai, this.PrepositionS, hs);} }


then in the following part I took out the "give" mouse mode I had originally entered and replaced it with:
Code: ags

else {
      if (this.VerbMode==eDescVerbModeAuto) {
      if (mouse.Mode==eModeUse) verb=this.UseS;
      if (mouse.Mode==eModeUse && Givegui==1) verb=this.GiveS; 
      //Replaced "if (mouse.Mode==eModeGiveto) verb=this.GiveS;" with above line 


All this did was change what was displayed in the label, the "give" button and the "use" button both set the mouse mode to Use so they act exactly the same, meaning if you pushed the "give" button even though it says "give (item) to (hotspot)" it would still do the same thing as if you were "using (item) on (hotspot)". In the future though all I would have to do to distinguish whether the player chose the "give" button or the "use" button to select an inventory item and use it on the hotspot is to have the hotspot read whether the global variable is set to 0 or 1.

There is probably an easier way to do this or something but I just wanted to write all that out incase anyone had the same issue I did, was really bugging me for the past 2 1/2 days trying to figure out how to implement the "Give" option.
*whew*
I've got FIVE death cards... That can't be good...

SSH

Glad you got it sorted, sorry I was on vacation so didn't see this before!
12

Tonic Ink

Is it possible to disable the Verb mode completely.

As in... hover hotspot under mouse location (as per normal) But retain the sierra/AGS style use inventory graphics as mouse cursor (remove the whole 'use pen on paper').

Cheers :)

SSH

The module doesn't do anything to the cursor at all, so yes it shoudl be possible with no extra effort.
12

Tonic Ink

Quote from: SSH on Mon 23/11/2009 15:50:09
The module doesn't do anything to the cursor at all, so yes it shoudl be possible with no extra effort.

Mate, if you could possible give me a steer in the right direction on how to do this, I'd be forever in debt :)

Snake

QuoteMate, if you could possible give me a steer in the right direction on how to do this, I'd be forever in debt...

Easy, you don't want to know what his debt entails.
Grim: "You're making me want to quit smoking... stop it!;)"
miguel: "I second Grim, stop this nonsense! I love my cigarettes!"

Tonic Ink

Quote from: Snake on Tue 24/11/2009 03:41:12
QuoteMate, if you could possible give me a steer in the right direction on how to do this, I'd be forever in debt...

Easy, you don't want to know what his debt entails.

If I were a man of my word, this would trouble me.. :)

SSH

Isn't it just a setting on the General Settings pane?
12

Tonic Ink

Quote from: SSH on Tue 24/11/2009 09:13:24
Isn't it just a setting on the General Settings pane?

Oh my god... I am truly a sad case.


I didn't realize you had to set the cursor graphic in the inventory properties.

please punish me accordingly :P

Sorry about that.

xenogia

I have an issue, I have GUI underneath the image to display the hotspot.  But whenever I do it displays the description in another font for a split second, then displays the correct font.

This is my code

  Description.OLFont = 3;
  Description.GUIMode (LabelDesc);
  Description.Location = eDescLocationStatic;
  Description.VerbMode = eDescVerbModeUseOnly;

So in another it's displaying font 0 for a brief second.

SSH

If you are using a GUI, OLFont won't make any difference. Why not just change the font of your GUI label?
12

SMF spam blocked by CleanTalk