Multiple dialog GUI's [SOLVED]

Started by DonB, Mon 09/01/2006 13:36:05

Previous topic - Next topic

DonB

Can there be multiple dialog GUI's..

for example, in my case..

I have got a File Closet in the office of the main player..
can this file closet get his own dialog GUI (for other layout and stuff)..

and have normal player-npc dialogs have another GUI..

If yes.. how?

I already got the dialog done.. and it gets into some sort of default GUI automatically.. don't know which one tho.. I guess GUI0 (statusline), however I am not sure..

appreciated..

Ashen

#1
No, not gStatusline, another, in-bullt GUI (i.e. one you can't edit). To make dialogs appear on a GUI, first make the GUI (creating it as a Text Window might be best - it'll adapt it's size to the number of options), then set it with the 'DialogOptions on GUI' box on the general seting window (this bit's in the manual). To change GUIs during the game (i.e. before and after you talk to the File Closet) use SetGameOption(OPT_DIALOGOPTIONSGUI, GUINUMBER);.
I know what you're thinking ... Don't think that.

DonB

#2
You should get a medal for this oneÃ,  ;D

As always, thanks Ashen

The script works fine.. only.. the first time the player clicks interacts on the hotspot File Closet, it still goes into the default dialog GUI.. if i leave the dialog then.. and click interact again on the File Closet.. it does appear (very good) into the new GUI..

why the first time not?

anddddddddddddd.. now i skip to some GUI layout questions..

-any idea of appearing a GUI in exactly the center of the page?
-why don't the bordercolor works, i got a black border color and a grey background, but only the background appears..?
-when i pop in a background image.. and i set the text label BESIDE it, at the right side of the squarish GUI i made..
still the dialog options appear at the left, while setted on the right, now it overlaps the background image..

If i can get all of this from a tutorial or manual or something, please let me know, cause I don't wanna spoil your time with questions already answered in the manuel or something,
but I just can't find things in the built-in-search manual..

Ashen

#3
Quotewhy the first time not?
No idea at all - I've never actually used this before. However, I've tried it since and it works fine for me - it could possibly be where you're calling the change GUI script. Need more details - script, how are the GUIs set up (e.g. are the Text Windows), what's the initial GUI (from the 'General Settings' window of the editor) - to say for sure.

Quoteany idea of appearing a GUI in exactly the center of the page?
OK, so the in-built search can be a little awkward at times, and it probably doesn't help that Chris uses some American and some British/European spellings, but still GUI.Centre shouldn't be too hard to find. game_start is probably the best place for it.

Quote-why don't the bordercolor works, i got a black border color and a grey background, but only the background appears..?
Have you got a background image? That override border/background colours. And, how are you setting the 'black' border? 0 is black in the 'Palette' window, but transparent in-game - try using 16 instead.

Quote-when i pop in a background image.. and i set the text label BESIDE it, at the right side of the squarish GUI i made..
still the dialog options appear at the left, while setted on the right, now it overlaps the background image..

I don't quite understand this, sorry. Best guess answer:
The contents of a GUI (labels, textboxes, etc) have no effect on dialogue options, so putting a label on the right won't make them appear on the right. However:
Quote from: The Manualgame.dialog_options_x 
Offset into dialog options GUI to compensate for borders 

game.dialog_options_y 
Offset into dialog options GUI to compensate for borders 
So, you could possibly use game.dialog_options_x to shift them over - try different values until it looks right to you. Not quite sure what you mean by "now it overlaps the background image" - surely it should be ontop of the background. Or do you mean it covers a specific part of the background image.

Let me know If I misunderstood the question.
Also, just to set my mind at ease - you are actually talking about Dialogs, right (as in topics, options, etc)? Not just Sierra-stlye speech-text? Something in that last question has made me thing of something like this - in which case none of this is what you actually want.
I know what you're thinking ... Don't think that.

DonB

#4
No it's not the SIERRA-style I'm aiming at..,

===========
but you are right, I did ment the overlapping of one specific part of the background within the GUI..

i dont really understand your quote from the manual but I will search in the manual for this..
============
About the borders:
I already took off the background and already made the bordercolor 16, still border doesn't workÃ,  Ã, :'(, tho, doesn't matter too much since I want a background so I will make borders in my background..
=============
Thanks for the center GUI information, helped a lot, but I don't understand where in the GUI script I should paste it, it doesn't work if I just paste it somewhere, I noticed..
=============

Ashen

QuoteNo it's not the SIERRA-style I'm aiming at..,
OK, so I haven't totally wasted my time, good ...

game.dialog_offset_x:
There's really no more to the entry than that, but it's HERE (Reference -> Scripting Global variables), if you want. I just meant you could use it to shove the options over to the right (e.g. game.dialog_offset_x = 30; for a 30 pixel offset) so they don't cover the bit of the background you want. I'm not sure it'll work, however, you'll need to play around with it yourself. On the same page, game.text_align might be useful too - Right-aligning the text could solve the problem.

Borders:
Odd, I have no problem with it. Does it show with any other colour? I made a typo before, saying '18' instead of '16', but if it's just that slot it has a problem with, maybe 17 or 18 (dark greys) would look OK? One question: Is it a standard GUI, or a Text Window? Text Windows don't show the coloured border in game, even without a grphical one - it's only used for text colour. (But I think Text Windows are auto-centred, so it's probably not that.)

GUI.Centre:
Not in the GUI script:
Quotegame_start is probably the best place for it.

Assuming it's a fixed-size GUI, just put your gGuiname.Centre(); command in game_start and it should be OK. If it changes size, repeatedly_execute or rep_ex_always, or just before you start the dialogue are better bets.



I know what you're thinking ... Don't think that.

DonB

#6
Your work absolutely isn't for nothing, You are by far the most helpful guy onto these whole forums.. I'm sure, respect!

It's no text window..

About the positioning of the topics into the GUI.. I just don't get where to put that simple code..

Okay, center works fine now.. very much thanks..
I'm gonna try and make the positionating now..
The bordercolors just don't work, no matter what color, but since I'm gonna make a background it doesn't matter (bordercolors do work at my other GUI's for the record)
..now some question about something else I found on the manual..
transperancy.. is the transperancy code like this?:



manual says:
int GUI.Transparency

in my game:
int gFilecloset.75 for example..

so where do i put this code.. not in gamestart i noticed, and not in the GUI editor too if I'm right..

ohh i s..k in this s..t lol

but piece by piece it's becoming to work :)..

Ashen

Re-Read the example in the manual:
Code: ags
int trans = gInventory.Transparency;
while (trans < 100) {
  trans++;
  gInventory.Transparency = trans;
  Wait(1);
}


Most of that doesn't directly apply to you, but this line:
Code: ags
gInventory.Transparency = trans;

Should tell you what you need to know. If you want to set gFilelcoset to 75% transparency, you'd use:
Code: ags
gFilecloset.Transparency = 75;

Note that it sets the transparency, not the opacity - 75% is mostly transparent, rather than just a bit, and might make a GUI hard to make out.

As to where, it depends. Take a look at the BFAQ Entry Placing your code. It depends when you want it to happen. If you want the GUI to always be at 75%, then game_start is where you want it to be. Otherwise - when do you want it to change? Put the code there.


The border colour thing gets weirder and weirder, especially since you say it works on other GUIs ... Fortunately it's not really an issue, otherwise I'd suggest just deleting the GUI and starting it over.
I know what you're thinking ... Don't think that.

DonB

Lol@ the weirder and weirder thing, maybe we should call Mulder en Scully..

anyway.. back to business..

i got this (like u said; put it into start game):

// main global script file

#sectionstart game_start  // DO NOT EDIT OR REMOVE THIS LINE
function game_start() {
  // called when the game starts, before the first room is loaded
gFilecloset.Centre();
gFilecloset.Transparency = 25;

Result: Nothing happends lol  ;D

Ashen

This is the problem with answering questions solely on how it looks like it should work, without actually testing it ...

I think I've spotted a couple of problems:
GUI.Centre() seems to centre the GUI based on 320x200 coords. So, if you're using 320x240 or 640x480, it'll be about 40 pixels closer to the top of the screen than you want. You might be better just working out the proper coords and using GUI.SetPosition (assuming it's a fixed size GUI, they'll never change anyway - and if it's not fixed size it's easy enough to work out on the fly).

It also seems like transparency doesn't work on GUIs displaying dialog options. You also can't do this with Text Windows - perhaps Dialog GUIs are classed as being Text Windows, even when they're not? (Anybody know if this is the case?) This would also explain the border thing.

If so, you can either:
i) Give up on transparency.
ii) Code your own dialog engine, that allows you to position the options as you like, and use transparency. (There was one around somewhere - but last I heard it was out of service until it got upgraded to the new scripting. Anyone know what I'm talking about?)
iii) Cheat a little. Display the options on a GUI with no background image or colour, and use run-script and dialog_request to turn on a 'Background' GUI behind it. You can change the transparency on the second GUI as you like, and change the positions to 'place' the options wherever you want, relative to the background image.
I know what you're thinking ... Don't think that.

DonB

#10
The centre is no problem, since I'm actually using 320x200..

Tho.. thanks for your reply.. I will try to do the trick with the two GUI's overlapping eachother.. how much GUI's can AGS take in one game? 100?

As a second thought.. I ain't gonna use it, I'm gonna use text windows in stead, and try to make a nice personal touch by making another kind of border around it..

But.. you made me interested in the SIERRA style dialogs, not that I'm gonna use it on the File Closet, but still..

I saw you using it in the Amulet Of Kings demo..
its massive!

Is this also with GUI's? I guess not.. is there a tutorial for this kind of dialogs?

Ashen

According to the manual, the limit is 50 GUIs per game, whcih seems to hold good into 2.71. I've never come close to that, though.

Glad youve got it sorted out, though, even if it's not quite what you wanted.

And, although we're drifting away from the original topic:
Sierra-style speech is easy - just select it from the drop-down menu on the 'General Settings' window. I prefer 'Sierra-style w/ background' - it's the one that displays the speech on a background (obviously enough), which makes it easier to read and looks better. That uses a GUI - by default the one you're using in 'Text windows use GUI', or the plain white-with-black-border message box, if you've got nothing set there.
I know what you're thinking ... Don't think that.

DonB

#12
Okey that's it Ashen, no more easy-for-you, difficult-for-me questions todayÃ,  ;D

U helped me out great, once again, i owe you!!

DonB

As I notice this topic falls fown, I guess you guys think it's solved.. it's almost solved :) (I know Im a burden)

..
time to brake my promise..

No.. no.. this is not it I'm afraid, I realise now you misunderstood my q (logical since my q was way too vague I see now) and thought I ment just speech.. cause this is for speech only.. I actually ment character speak.. not speech style.. cause how can I have multiple speech GUI's.. that's impossible right.. so what's the plan on having character talk thru a GUI with an avatar beside it.. (avatar will just be a background image.. of course)

I maybe thought of:
Two GUI's..

One GUI for the EGO-character..

Other GUI for the npc's talking..

to have a picture/avatar/icon beside it.. maybe the solution is making an object appear beside the GUI.. so you not have to make multiple GUI's for each individual npc..

confusing what I say? I guess so.. since I ain't so good in the English language.. so maybe you guys can tell me how to make Amulet-Of-King-wise avatar-dialogs, cause that's what I was aiming at, not speech-layouts..

Ashen

Don, I sent you a PM about this, to avoid unnecessary posts like this one.

Amulet of Kings used Sierra-stryle speech. That takes care of the little avatar by the speech thing - that's pretty much what Sierra-style speech is. Just assign the picture - or series of pictures for an animated one - to a view and set that as the character's Speech View, sorry if I didn't explain that properly before.

Now, if you really want to use GUIs, you can do that too. ~}Shade{~ made a module to mimic Sierra-style speech, and make it easier to change image (e.g. for different emotions), that's available here. Or the code is available here, or my adapted version is here. However, none of them are easily used in Dialogues
I know what you're thinking ... Don't think that.

DonB

Ashen, I am very sorry I didn't saw it before.. This is exactly what I was looking for.. respect! and solved..

SMF spam blocked by CleanTalk