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

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!
This module can do lots of things!

Want a FoA-style statusline? Description can do it!
Want a hotspot description that follows the cursor? Description can do it!
Want the description on an Overlay or a GUI? Description can do it!
Want the text to stay still while you're over the same hotspot? Description can do it!
Want to be richer than Bill Gates? Description can do it!


Download Description module here (Requires AGS v3.00 or later!)

For more info, here's the instructions from the script header: http://ssh.me.uk/moddoc/Description

v1.06 fixes the problem with Sierra with BG mode speech and overlay Descriptions. It also adds an optional alignment configuration parameter for overlays.
« Last Edit: 01 Jan 2015, 02:32 by Dualnames »

Re: MODULE: Description v1.00
« Reply #1 on: 28 Apr 2006, 19:56 »
Nice work!
« Last Edit: 19 Aug 2006, 17:10 by strazer »

Candle

  • Truly Hated
Re: MODULE: Description v1.00 - Display hotspot description
« Reply #2 on: 28 Apr 2006, 23:58 »
Your a Machine SSH .. how do you do it..
* Candle Thanks you again.

Scorpiorus

  • 100101101010b
Re: MODULE: Description v1.00 - Display hotspot description
« Reply #3 on: 29 Apr 2006, 22:06 »
Good work with the modules, SSH!

This one should especially help beginners to set up their game interfaces with just basic scripting.

:)

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.01 - Display hotspot description
« Reply #4 on: 02 May 2006, 10:25 »
I've fixed the problems with running on 2.71, and the demo is now 2.71-compatible, too

EDIT: I also fixed the Fade function for gui mode not working
« Last Edit: 11 May 2006, 16:50 by SSH »

Alynn

  • I'm ugly because I'm pixelated, what's your excuse
    • I can help with scripting
    •  
Re: MODULE: Description v1.02 - Display hotspot description
« Reply #5 on: 10 Sep 2006, 20:47 »
SSH, you asked me to remind you.

Could you please make it where it turns off the description if in pointer mode (or any other mode of the players choosing). Only if there is a verb will it display the string.

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.03 - Display hotspot description
« Reply #6 on: 11 Sep 2006, 12:21 »
Done, Alynn. Let me know if that was what you had in mind.

Alynn

  • I'm ugly because I'm pixelated, what's your excuse
    • I can help with scripting
    •  
Re: MODULE: Description v1.03 - Display hotspot description
« Reply #7 on: 14 Sep 2006, 09:11 »
Jes Shir! It works great.

magintz

  • Mittens Knight
  • Just because I rock doesn't mean I'm made of stone
    • I can help with story design
    •  
    • I can help with web design
    •  
    • magintz worked on a game that was nominated for an AGS Award!
Re: MODULE: Description v1.03 - Display hotspot description
« Reply #8 on: 10 Aug 2007, 21:21 »
I can't seem to get the description to hide itself while the game is in wait mode (when the player is talking etc..).

Also I have an inventory GUI screen with a clear background at the bottom of the screen, the description of each inventory item appears behind the inventory item, is their anyway of bring this forward in front of this gui?

I haven't used AGS in a while so could be making n00b mistakes, but I would appreciate it if someone could help me out, let me know if you need me to post up code or screenshots etc...
When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

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.03 - Display hotspot description
« Reply #9 on: 12 Aug 2007, 20:42 »
Did you set Description.NoDescriptionWhenMode to eModeWait?

As for the inv descriptions, you'll have to use GUI rather than overlay mode of the Description module, and set the Z order of the GUI you use for descriptions to be higher than that of the inv GUI.

magintz

  • Mittens Knight
  • Just because I rock doesn't mean I'm made of stone
    • I can help with story design
    •  
    • I can help with web design
    •  
    • magintz worked on a game that was nominated for an AGS Award!
Re: MODULE: Description v1.03 - Display hotspot description
« Reply #10 on: 22 Aug 2007, 16:39 »
Regarding the Description.NoDescriptionWhenMode, it doesn't seem to be working, here's my code:

Code: Adventure Game Studio
  1.     Game.SpeechFont=3;
  2.     Description.OffsetX = 3;
  3.     Description.OffsetY = 3;
  4.     Description.Location=eDescLocationFollow;
  5.     Description.VerbMode=eDescVerbModeUseOnly;
  6.     Description.NoDescriptionWhenMode = eModeWait;
  7.     Description.IncludeInventory = true;
  8.     Description.OLFont=3;
  9.     Description.OLColor=4;
  10.     Description.OverlayMode();
  11.  

I don't really understand the whole GUIControl part and getting it to work with a label, any chance you can help me out with that one?
« Last Edit: 22 Aug 2007, 16:51 by magintz »
When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

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.03 - Display hotspot description
« Reply #11 on: 22 Aug 2007, 22:09 »
create a label, and pass the name you give it in the gui editor to the gui mode script function...

magintz

  • Mittens Knight
  • Just because I rock doesn't mean I'm made of stone
    • I can help with story design
    •  
    • I can help with web design
    •  
    • magintz worked on a game that was nominated for an AGS Award!
Re: MODULE: Description v1.03 - Display hotspot description
« Reply #12 on: 27 Aug 2007, 11:52 »
Sorry to be a pain, but I got it all sorted quite easily but now I seem to be getting an error when I move the mouse within the intro screen, this could be my problem, but it is pointing the error to the description.



I'm using 640 x 400 game resolution, could I have done something stupid?

The problem seems to occur when the mouse moves outside the game window, is their some way of preventing this?

Also, I still cannot get the description to vanish using the Description.NoDescriptionWhenMode = eModeWait; command.
« Last Edit: 27 Aug 2007, 11:56 by magintz »
When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

Gilbert

  • Local Moderator
  • * KILL* * KILL * * KILL *
    • Lifetime Achievement Award Winner
    •  
Re: MODULE: Description v1.03 - Display hotspot description
« Reply #13 on: 27 Aug 2007, 11:58 »
I didn't check on the module, but remember even if your game's screen resolution is 640x400, the game resolution is still 320x200. So, maybe it's a problem on your side trying to use hi-res coordinates for stuff? (AGS currently cannot place stuff at hi-res precision, even when the displayed res. is hi-res.)

magintz

  • Mittens Knight
  • Just because I rock doesn't mean I'm made of stone
    • I can help with story design
    •  
    • I can help with web design
    •  
    • magintz worked on a game that was nominated for an AGS Award!
Re: MODULE: Description v1.03 - Display hotspot description
« Reply #14 on: 27 Aug 2007, 12:11 »
I'm not sure if it is anything I have done as the only code I am using is :

Code: Adventure Game Studio
  1.     Game.SpeechFont=3;
  2.     Description.Location=eDescLocationFollow;
  3.     Description.VerbMode=eDescVerbModeUseOnly;
  4.     Description.NoDescriptionWhenMode = eModeWait;
  5.     Description.IncludeInventory = true;
  6.                 Description.CropGUIToo = true;
  7.     Description.GUIMode(desc);
  8.  

Whilst, the error code comes from lines 143 to 153:

Code: Adventure Game Studio
  1.   if (this.DisplayType==eDescDisplayGUIControl) {
  2.     this.Update_GUI();
  3.   } else if (this.DisplayType==eDescDisplayOverlay) {
  4.                 this.Update_Overlay();
  5.         }
  6. }
  7.  
  8.  
  9. function repeatedly_execute_always() {
  10.   // Should this go in rep_ex_always?
  11.   // easy enough for user to change, if required
  12.   Description.rep_ex();
  13. }
  14.  

Edit: I changed "Description.Location=eDescLocationFollow" to "Description.Location=eDescLocationSticky" and I now do not get any problems or errora; but I still would want to use "Description.Location=eDescLocationFollow".

P.S. SSH, when you get a moment can you also help on my "Description.NoDescriptionWhenMode = eModeWait;" problem.
« Last Edit: 27 Aug 2007, 12:15 by magintz »
When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

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.03 - Display hotspot description
« Reply #15 on: 28 Aug 2007, 10:22 »
Can you stick this in the code of the first room where you get this problem, please? (e.g. in the after fadein script)

Code: Adventure Game Studio
  1.  Display("MaxX %d MaxY %d VW %d VH %d", Description.MaxX, Description.MaxY, System.ViewportWidth, System.ViewportHeight);
  2.  

and tell me the numbers it displays. You should be able to work around your problem by manually setting MaxX and MaxY to something like 300, 180.

As for the busy cursor, I see that mouse.Mode never actually gets set to eModeWait, so we have to check this specially. I'll do a new version of the module, but in the meantime, edit the module script and look for  this code:

Code: Adventure Game Studio
  1. protected function Descriptions::Update_String() {
  2.   if (mouse.Mode==this.NoDescriptionWhenMode) { this.Text=""; return; }
  3.  

and replace it with:

Code: Adventure Game Studio
  1. protected function Descriptions::Update_String() {
  2.   // Special case of busy cursor
  3.   if ((mouse.Mode==this.NoDescriptionWhenMode) || (this.NoDescriptionWhenMode==eModeWait && IsInterfaceEnabled()==0)) {
  4.                 this.Text=""; return;
  5.         }
  6.  


I've actually put this now into Description 1.04, available in the first post
« Last Edit: 28 Aug 2007, 11:18 by SSH »

magintz

  • Mittens Knight
  • Just because I rock doesn't mean I'm made of stone
    • I can help with story design
    •  
    • I can help with web design
    •  
    • magintz worked on a game that was nominated for an AGS Award!
Re: MODULE: Description v1.04 - Display hotspot description
« Reply #16 on: 28 Aug 2007, 12:59 »
You truly are a king of kings!

Can you stick this in the code of the first room where you get this problem, please? (e.g. in the after fadein script)

Code: Adventure Game Studio
  1.  Display("MaxX %d MaxY %d VW %d VH %d", Description.MaxX, Description.MaxY, System.ViewportWidth, System.ViewportHeight);
  2.  

and tell me the numbers it displays. You should be able to work around your problem by manually setting MaxX and MaxY to something like 300, 180.

-- "MaxX 320 MaxY 200 VW 320 VH 200"



As for the busy cursor, I see that mouse.Mode never actually gets set to eModeWait, so we have to check this specially. I'll do a new version of the module, but in the meantime, edit the module script and look for  this code:

Code: Adventure Game Studio
  1. protected function Descriptions::Update_String() {
  2.   if (mouse.Mode==this.NoDescriptionWhenMode) { this.Text=""; return; }
  3.  

and replace it with:

Code: Adventure Game Studio
  1. protected function Descriptions::Update_String() {
  2.   // Special case of busy cursor
  3.   if ((mouse.Mode==this.NoDescriptionWhenMode) || (this.NoDescriptionWhenMode==eModeWait && IsInterfaceEnabled()==0)) {
  4.                 this.Text=""; return;
  5.         }
  6.  

Worked a treat; thanks for that.
When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

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.04 - Display hotspot description
« Reply #17 on: 28 Aug 2007, 13:16 »
Can you try editing these lines of the module to see if this fixes the problem?

Right at the bottom of the Description script, in game_start(), change:

Code: Adventure Game Studio
  1.   Description.MaxX=system.viewport_width;
  2.   Description.MaxY=system.viewport_height;
  3.  

to:

Code: Adventure Game Studio
  1.   Description.MaxX=system.viewport_width-1;
  2.   Description.MaxY=system.viewport_height-1;
  3.  


magintz

  • Mittens Knight
  • Just because I rock doesn't mean I'm made of stone
    • I can help with story design
    •  
    • I can help with web design
    •  
    • magintz worked on a game that was nominated for an AGS Award!
Re: MODULE: Description v1.04 - Display hotspot description
« Reply #18 on: 28 Aug 2007, 14:59 »
Woot!

:D

It works now, thanks!
When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

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.05 - Display hotspot description
« Reply #19 on: 28 Aug 2007, 16:22 »
This fix is now in v1.05 available to download in the first post