MODULE: Description v1.06 - Display hotspot description

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

Previous topic - Next topic

SSH

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

strazer

#1
Nice work!

Candle

Your a Machine SSH .. how do you do it..
* Candle Thanks you again.

Scorpiorus

Good work with the modules, SSH!

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

:)

SSH

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
12

Alynn

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

Done, Alynn. Let me know if that was what you had in mind.
12

Alynn


magintz

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

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

magintz

Regarding the Description.NoDescriptionWhenMode, it doesn't seem to be working, here's my code:

Code: ags

    Game.SpeechFont=3;
    Description.OffsetX = 3;
    Description.OffsetY = 3;
    Description.Location=eDescLocationFollow;
    Description.VerbMode=eDescVerbModeUseOnly;
    Description.NoDescriptionWhenMode = eModeWait;
    Description.IncludeInventory = true;
    Description.OLFont=3;
    Description.OLColor=4;
    Description.OverlayMode();


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?
When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

SSH

create a label, and pass the name you give it in the gui editor to the gui mode script function...
12

magintz

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.
When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

Gilbert

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

I'm not sure if it is anything I have done as the only code I am using is :

Code: ags

    Game.SpeechFont=3;
    Description.Location=eDescLocationFollow;
    Description.VerbMode=eDescVerbModeUseOnly;
    Description.NoDescriptionWhenMode = eModeWait;
    Description.IncludeInventory = true;
		Description.CropGUIToo = true;
    Description.GUIMode(desc);


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

Code: ags

  if (this.DisplayType==eDescDisplayGUIControl) {
    this.Update_GUI();
  } else if (this.DisplayType==eDescDisplayOverlay) {
		this.Update_Overlay();
	}
}


function repeatedly_execute_always() {
  // Should this go in rep_ex_always?
  // easy enough for user to change, if required
  Description.rep_ex();
}


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.
When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

SSH

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: ags

 Display("MaxX %d MaxY %d VW %d VH %d", Description.MaxX, Description.MaxY, System.ViewportWidth, System.ViewportHeight);


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: ags

protected function Descriptions::Update_String() {
  if (mouse.Mode==this.NoDescriptionWhenMode) { this.Text=""; return; }


and replace it with:

Code: ags

protected function Descriptions::Update_String() {
  // Special case of busy cursor
  if ((mouse.Mode==this.NoDescriptionWhenMode) || (this.NoDescriptionWhenMode==eModeWait && IsInterfaceEnabled()==0)) { 
		this.Text=""; return;
	}



I've actually put this now into Description 1.04, available in the first post
12

magintz

You truly are a king of kings!

Quote from: SSH on Tue 28/08/2007 10:22:25
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: ags

 Display("MaxX %d MaxY %d VW %d VH %d", Description.MaxX, Description.MaxY, System.ViewportWidth, System.ViewportHeight);


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"




Quote from: SSH on Tue 28/08/2007 10:22:25
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: ags

protected function Descriptions::Update_String() {
  if (mouse.Mode==this.NoDescriptionWhenMode) { this.Text=""; return; }


and replace it with:

Code: ags

protected function Descriptions::Update_String() {
  // Special case of busy cursor
  if ((mouse.Mode==this.NoDescriptionWhenMode) || (this.NoDescriptionWhenMode==eModeWait && IsInterfaceEnabled()==0)) { 
		this.Text=""; return;
	}


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

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: ags

  Description.MaxX=system.viewport_width;
  Description.MaxY=system.viewport_height;


to:

Code: ags

  Description.MaxX=system.viewport_width-1;
  Description.MaxY=system.viewport_height-1;


12

magintz

When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

SSH

This fix is now in v1.05 available to download in the first post
12

SMF spam blocked by CleanTalk