Author Topic: MODULE: Description v1.06 - Display hotspot description  (Read 31253 times)

Gribbler

  • I'm selling these fine leather jackets.
    • Gribbler worked on a game that was nominated for an AGS Award!
      Gribbler worked on a game that won an AGS Award!
Re: MODULE: Description v1.06 - Display hotspot description
« Reply #40 on: 14 Sep 2008, 14:02 »
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

  • I'm selling these fine leather jackets.
    • Gribbler worked on a game that was nominated for an AGS Award!
      Gribbler worked on a game that won an AGS Award!
Re: MODULE: Description v1.06 - Display hotspot description
« Reply #41 on: 15 Sep 2008, 01:14 »
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.

Re: MODULE: Description v1.06 - Display hotspot description
« Reply #42 on: 30 Nov 2008, 19:13 »

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

  • Flying round the world at the speed of haggis
    • I can help with scripting
    •  
    • SSH worked on a game that was nominated for an AGS Award!
      SSH worked on a game that won an AGS Award!
Re: MODULE: Description v1.06 - Display hotspot description
« Reply #43 on: 30 Nov 2008, 19:25 »
Overlays are always behind GUIs, so use a GUI with a high ZOrder instead.

Re: MODULE: Description v1.06 - Display hotspot description
« Reply #44 on: 30 Nov 2008, 21:45 »
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

  • "I am the weapon" -Richard Cypher
    • I can help with AGS tutoring
    •  
    • I can help with scripting
    •  
Re: MODULE: Description v1.06 - Display hotspot description
« Reply #45 on: 01 Dec 2008, 03:28 »
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
« Last Edit: 01 Dec 2008, 03:32 by Trent R »
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

Re: MODULE: Description v1.06 - Display hotspot description
« Reply #46 on: 01 Dec 2008, 17:24 »
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 .

Re: MODULE: Description v1.06 - Display hotspot description
« Reply #47 on: 12 Dec 2008, 00:06 »
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!


Re: MODULE: Description v1.06 - Display hotspot description
« Reply #48 on: 06 Jan 2009, 01:45 »
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: Adventure Game Studio
  1.  
  2. String GiveS;
  3. String Preposition2S;
  4.  
  5.  
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: Adventure Game Studio
  1.  
  2. Description.GiveS="Give";
  3. Description.Preposition2S="to";
  4.  
  5.  
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: Adventure Game Studio
  1.   else {
  2.       if (this.VerbMode==eDescVerbModeAuto) {
  3.      
  4.       if (mouse.Mode==eModeGiveto) verb=this.GiveS;
  5.  
  6.       if (mouse.Mode==eModeLookat) verb=this.LookS;  
  7.       if (mouse.Mode==eModeUse) verb=this.UseS;
  8.       if (mouse.Mode==eModeWalkto) verb=this.WalkS;
  9.  

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...

Re: MODULE: Description v1.06 - Display hotspot description
« Reply #49 on: 07 Jan 2009, 00:58 »
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: Adventure Game Studio
  1.   else if (player.ActiveInventory!=null && Givegui==1){
  2.     verb=this.GiveS;
  3.     this.Text=String.Format("%s %s %s %s", verb, ai, this.Preposition2S, hs); }
  4.     else if (player.ActiveInventory!=null && Givegui==0){
  5.     verb=this.UseS;
  6.     this.Text=String.Format("%s %s %s %s", verb, ai, this.PrepositionS, hs);} }
  7.  

then in the following part I took out the "give" mouse mode I had originally entered and replaced it with:
Code: Adventure Game Studio
  1. else {
  2.       if (this.VerbMode==eDescVerbModeAuto) {
  3.       if (mouse.Mode==eModeUse) verb=this.UseS;
  4.       if (mouse.Mode==eModeUse && Givegui==1) verb=this.GiveS;
  5.       //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

  • Flying round the world at the speed of haggis
    • I can help with scripting
    •  
    • SSH worked on a game that was nominated for an AGS Award!
      SSH worked on a game that won an AGS Award!
Re: MODULE: Description v1.06 - Display hotspot description
« Reply #50 on: 14 Jan 2009, 11:56 »
Glad you got it sorted, sorry I was on vacation so didn't see this before!

Re: MODULE: Description v1.06 - Display hotspot description
« Reply #51 on: 23 Nov 2009, 01:47 »
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

  • Flying round the world at the speed of haggis
    • I can help with scripting
    •  
    • SSH worked on a game that was nominated for an AGS Award!
      SSH worked on a game that won an AGS Award!
Re: MODULE: Description v1.06 - Display hotspot description
« Reply #52 on: 23 Nov 2009, 15:50 »
The module doesn't do anything to the cursor at all, so yes it shoudl be possible with no extra effort.

Re: MODULE: Description v1.06 - Display hotspot description
« Reply #53 on: 23 Nov 2009, 22:17 »
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

  • @_@
    • I can help with making music
    •  
    • I can help with story design
    •  
    • Snake worked on a game that was nominated for an AGS Award!
      Snake worked on a game that won an AGS Award!
Re: MODULE: Description v1.06 - Display hotspot description
« Reply #54 on: 24 Nov 2009, 03:41 »
Quote
Mate, 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!"

Re: MODULE: Description v1.06 - Display hotspot description
« Reply #55 on: 24 Nov 2009, 05:17 »
Quote
Mate, 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

  • Flying round the world at the speed of haggis
    • I can help with scripting
    •  
    • SSH worked on a game that was nominated for an AGS Award!
      SSH worked on a game that won an AGS Award!
Re: MODULE: Description v1.06 - Display hotspot description
« Reply #56 on: 24 Nov 2009, 09:13 »
Isn't it just a setting on the General Settings pane?

Re: MODULE: Description v1.06 - Display hotspot description
« Reply #57 on: 24 Nov 2009, 09:37 »
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.

Re: MODULE: Description v1.06 - Display hotspot description
« Reply #58 on: 16 Feb 2010, 15:29 »
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

  • Flying round the world at the speed of haggis
    • I can help with scripting
    •  
    • SSH worked on a game that was nominated for an AGS Award!
      SSH worked on a game that won an AGS Award!
Re: MODULE: Description v1.06 - Display hotspot description
« Reply #59 on: 19 Feb 2010, 04:53 »
If you are using a GUI, OLFont won't make any difference. Why not just change the font of your GUI label?