MODULE: Description v1.06 - Display hotspot description

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

Previous topic - Next topic

thebaddie

Quote from: SSH on Wed 22/08/2007 22:09:40
create a label, and pass the name you give it in the gui editor to the gui mode script function...

i can't understand how to do this step...

can someone please post an example to explain me where exactly i have to set the label name?

is this the correct piece of script?:
Code: ags

function Descriptions::GUIMode(GUIControl *gc) {
  this.OLTidy();
  if (gc==null) { 
		Display("ERROR! null GUIControl passed to Description.GUIMode, contact game author");
		return -1;
  }		
  this.DisplayType=eDescDisplayGUIControl;
  this.gc=gc;
}


bogdy103

Hello! I'm new into the world of AGS but still using the help I could make a game;
I didn't quite understand what I have to do or to change in the script so the description of the hotspot appear (preferably next to the cursor) in any cursor mode. Could you explain what I have to do?

SSH

Quote from: thebaddie on Thu 10/01/2008 17:22:41
Quote from: SSH on Wed 22/08/2007 22:09:40
create a label, and pass the name you give it in the gui editor to the gui mode script function...

i can't understand how to do this step...

can someone please post an example to explain me where exactly i have to set the label name?


In your game_start function, call

Code: ags

Description.GUIMode(gMYGUINAMEGOESHERE);


Quote from: bogdy103 on Sun 09/03/2008 14:57:25
Hello! I'm new into the world of AGS but still using the help I could make a game;
I didn't quite understand what I have to do or to change in the script so the description of the hotspot appear (preferably next to the cursor) in any cursor mode. Could you explain what I have to do?

Put this in your game_start function:
Code: ags

Description.OverlayMode();
Description.Location=eDescLocationFollow;




12

bogdy103

Thanks! I couldn't understand where to put these functions!

kkmic

Has anyone tried this module with AGS3+? I'm using 3.0.2 and i'm getting a white background OVER the description text.

Can anyone recommend another module if this one has issues with 3.0.2? I would prefer modules instead of plug-ins.

SSH

Can you give more detail? What settings are you using, most pertinently, Overlay or GUI mode?
12

kkmic

These are my settings (in the game_start section):
Code: ags
Description.Location=eDescLocationFollow;
Description.OffsetX=0;
Description.OffsetY=0;


Everything else is default (and that means overlay). Even with the overlay mode explicitly defined in the game_start section, the end result is the same.

What I get is this:


To the right of the character is a hotspot (the character is not currently on the hotspot). It has a different description, but I get an identical sized box.

There seem to be some text in that box, as the yellow "dots" from topside differ from the character to the hotspot.

Anything  more that I can do to help tracking down the problem?

SSH

I've just tried your setup out with AGS 3.0.2 SP1 and it works fine for me. Can you:

* Make sure you're using 3.0.2 SP1 as CJ fixed a coupel of last-minute bugs
* Tell me the bit-depth of your game and background
* Upload the game folder (not compiled, the source) so I can try it out?
12

kkmic

AGS version: 3.0.2 June 2008, Build 3.0.2.44 (I downloaded it less than 24 hours ago)
Game depth: 32 bit
Background depth: 32 bit

You can find the test files here (rar archive).

It's just a test, not a game. I'm just gathering assets ATM.

Hope this helps. The text under the cursor is something that i really want in my game (if i'll manage to finish it :D).

If you find the solution tot the  problem (it may be related to the color depth), I would like to make one request:
It would be possible to vertically align the text center with the cursor center?

SSH

I messed around with bit depths, etc. but it didn't make any difference. The yellow dots are the text: the font you are using seems corrupted as I couldn't get it to display properly at all in a GUI or overlay, no matter what. I loaded a new font and it worked fine. However, the white box behind seemed to stay no matter what I did. This is very puzzling. I also treid creatign a enw game from the Default template and then importing Description and using your settings and there's no white BG there.

AHAHAH!

Found it. If you have your speech style set to SierraWithBackground, Text Overlays seem to acquire this white background. Looks like an AGS bug to me...


EDIT:
For centred text, you can edit line 83 of Description.asc:
Code: ags

this.x = mouse.x + this.OffsetX;

becomes
Code: ags

this.x = mouse.x + this.OffsetX - (this.width/2);


Although, I can add an alignment setting when I get around to description 1.06...
12

kkmic

Thanks mate. Both for the info and for the center quickfix.

DazJ

Anyone know where this can be downloaded? The link is dead :(

SSH

OK, sorry... link now fixed.

You should always be able to find my modules if you go to my home page and follow the links there
12

SSH

I've uploaded v1.06 which fixes your problem, kkmic, even in that speech mode. It also adds an alignment option.
12

kkmic

I need a kiss smiley  ;D

Thanks mate. I'll give it a try later today. Though I believe that a lucasarts style speech will fit better with my game than sierra with backgrund.

DazJ

Is there anyway to disable to Descriptions of Object/Hotspots etc when the mouse cursor is in wait mode or when characters are talking? It looks sloppy when a cutscene is on but the player can still move the cursor and display the hotspots' and objects' descriptions.

Thanks in advance.

EDIT: EDIT: Fixed. I changed the

Description.NoDescriptionWhenMode;

setting.

Gribbler

How can I change the font of decription text? I want it to be a bold one, like the one within the ags fonts (font 2).

SSH

Quote from: Gribbler on Fri 12/09/2008 23:01:17
How can I change the font of decription text? I want it to be a bold one, like the one within the ags fonts (font 2).

From http://ssh.me.uk/moddoc/Description :

Quote
Description.OLFont/Width/Color

Specify the properties of the Overlay used in Overlay mode. For GUIs, they are picked up from the GUI settings

12

Gribbler

Well, yes I found that page and that particular piece of info but still I don't know where to put it and what numbers to use:) Im sorry, Im rather new to scripting. Now Im thinking maybe I should ask the question in the beginners section:)

SSH

Put Description.OLFont=2; in your global script game_start function. Or change 2 to the font number that you want.
12

SMF spam blocked by CleanTalk