MODULE: CustomDialogGui 1.9

Started by abstauber, Sun 14/12/2008 16:03:36

Previous topic - Next topic

abstauber

I assume, you set up the GUI in your global script. So you need the following line in there as well.
(place it somewhere in the first lines and not in a function)

Code: ags

import CustomDialogGui CDG;



uswin

Hi, abstauber, your module is great, well I had a question, is it possible to create custom GUI to use for Speech / text in ags ( not for dialog option) in your module ? , Just like speech / text gui in japanese RPG game ?





thanks.


abstauber

Hi, thanks for using :)
But I'm afraid if you "just" want the speech to be displayed in a GUI, you don't need this module. It's just for selecting and showing dialog options, not for the speech itself.

As far as I know you could use the option: "custom text-window GUI" in the general settings tab.

uswin

Well, yeah, I already know that custom text gui thing,
but the point is, custom text gui doesn't give me the flexibility to create a text gui such as in the above picture, (with a character picture above the text gui and other decoration that doesn't use tile).
And when I see your module which is quite similiar with what i thought so i'm just curious.
Please let me know if you ever come across the solution for something like this

well thanks for the reply ;D

abstauber

A little off topic, but you could try denming's video tutorials starting from part 34
http://www.youtube.com/watch?v=zZpRKs4rZQY
This could be what you need.

Maybe there's also someone on the beginners forum who has some experience in sierra style portrait dialogs.

Good look :)

uswin


Dualnames

Attempting to update from 1.3 to 1.4, a rearrangement of some short happened to all the elelements of my custom dialog guis and they're all 25 pixels to the right..does this have to do with the centering thing?
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

abstauber

*cough* I've messed up left and right in the before 1.4.
You should be fine, if you just flip left and right.

If it doesn't help, could you give me some more details?

Tanique

First of all fabulous job with this module!  It's so thorough and leaves so much to the imagination!  Great work and thank you for sharing!  Just an observation about the right-left switch:

Quote from: abstauber on Sat 04/07/2009 11:22:45
*cough* I've messed up left and right in the before 1.4.
You should be fine, if you just flip left and right.

If it doesn't help, could you give me some more details?

I think what has occurred is the letter display buffering is no longer in sync with the mousover-hotspot buffering.  If you put a "this.border_left" value of 30, the mouse will not highlight any text while hovering within the first 30pxls on the LEFT side of the GUI, which is what it's suppose to do.  However, at the same time, it is also producing a text display boundary 30pxls from the RIGHT of the GUI.  Both the text and the mousover-highlighting borders need to be in sync for left/right, because right now their lefts and rights are opposite, and yet scripted into the same single value.  Hopefully what I said makes sense.  If it doesn't let me know and I'll try to find another way to explain it.

Also, I have a suggestion, although I'm not sure how easy it is to script.  For the vertical autosize function, it appears that the dialog window is always stretched downward to accommodate new text.  Is there a way to make the bottom of the dialog box the anchor point so the box stretches upwards instead?

Thanks again for a great module.  Keep up the good work!

abstauber

Hi Tanique,

thanks a lot for you feedback. Here's a new beta which should iron out those problems with the highlighting:
CustomDialogGui_beta.zip

While I've been correcting the highlighting, I've stumbled upon a problem with the alignment of the arrow sprites. So now the arrow position is independent from the gui borders, but on the downside, you have define their offset yourself.

Code: ags

    CDG.auto_arrow_up_offset_x      = 5;
    CDG.auto_arrow_down_offset_x = 5;
    CDG.auto_arrow_up_offset_y      = 4;    
    CDG.auto_arrow_down_offset_y = 16;  


I've also added your requested anchor point:
Code: ags

    CDG.mouse_anchor  = eAnchorTopLeft;


So now, all you need is to set the mouse_anchor to eAnchorBottomLeft.

If everything's fine with the beta, I'll update the first post and make it "public".

Tanique

Thanks Abstauber!

I played around with the beta and everything seems to be working fine.  Buffers and border edges seem to be happy again! Just one comment:

the new "this.mouse_anchor" is fabulous and I'm sure will be useful for a number of users.  However, is there a way to apply anchorpoint options for dialog boxes with fixed positions, not just for the mousecursor-position option?  As an example, I want to have my dialog box always in the bottom-left corner of the screen, so the dialog options will stretch the box upwards with the bottom edge always on the same position.  Basically, exactly what you did for this.mouse_anchor only for a fixed xy position.  I don't know enough about scripting to go about doing it myself.

Thanks again!

abstauber

I'm glad to see, that this bug is finally gone :)
Actually it's a good thing that you're yet learning to script. I bet, most users silently fix those bugs themselves rather than reporting it.

If I got you right, you like to have autosize with a fixed position featuring the mouse anchor.

Well, this should do it:
CustomDialogGui_beta2.zip

Could you please take a look and tell me if it works for you?

Tanique

lol I think I'm confusing you!   ??? My bad...

Ok I've fiddled around with the General Settings and what I'm looking for is "Print Dialog Options Upwards" to be "true"

With your module imported that option seems to do nothing. I think it's being overridden.  So if there's a way to change that setting in your module instead that would be super awesome  ;D

By the way, you rock.

abstauber

Hehe, maybe my subconscious didn't want to understand it, since the mouse anchor has been much easier to script ;D

Anyway, "print dialog option upwards" does the following, according to the Editor:
The first dialog option will be at the bottom, and the last at the top

Here's a new flag, that mimics this behaviour (I hope)
Code: ags

CDG.dialog_options_upwards=true; 


It does work in text mode as well as in vertical icon mode (without icon_sort_inv).
CustomDialogGui_beta3.zip

Btw. I'm getting kind of curious, how your GUI might look like ;)

Tanique

Hmm, so just to confuse us even more, it turns out that the "Print dialog options upwards" description, and what it actually does, are different lol.

If you have no special custom settings for a GUI set, and turn "Print dialog options upwards" to TRUE, all options are still listed downwards as usual.  BUT as the number of active options decreases and the list gets shorter, the top options shift DOWN instead of the bottom options shifting UP.

I'm a quick learner and after reading through your scripting I think I'm able to script what I want myself.  Give me a day or two and if I figure it out I'll post a demo of what I end up with and what the code looks like.

abstauber


abstauber

Thanks for you PM. Now I finally understand, what you've needed. :)

Here's the new beta:
CustomDialogGui_beta4.zip

I've renamed the var mouse_anchor to anchor_point, since it doesn't have much to do with the mouse anyway.

Here's a sample GUI which you can paste in the demo, after you've updated it with the beta:

Code: ags

    dialog_id = 0; 
    showGuiType.Text = "GUI: Text GUI bottom to top";
    CDG.setAutosizeCorners(49, 107, 43, 44);
    CDG.setAutosizeBorders(47, 108, 42, 109);
    CDG.seperator_visible       = false;
    CDG.autosize_maxheight      = 180; 
    CDG.bg_color                = 50744; 
    CDG.text_color            = 0;
    CDG.text_color_active     = 1;     
    CDG.gui_xpos                = 0;
    CDG.gui_ypos                = 200;
    CDG.border_left             = 17;
    CDG.border_right            = 16;
    CDG.border_top              = 5;
    CDG.border_bottom           = 5;   
    CDG.auto_arrow_align        = 3;
    CDG.auto_arrow_up_offset_x   = 5;
    CDG.auto_arrow_down_offset_x = 5;
    CDG.auto_arrow_up_offset_y   = 4;    
    CDG.auto_arrow_down_offset_y = 16;
    CDG.yscreenborder            = 0;
    CDG.xscreenborder            = 0;
    CDG.anchor_point             = eAnchorBottomLeft;
    CDG.dialog_options_upwards   = true;
    CDG.gui_pos_at_cursor        = false;
    CDG.autosize_height          = true;     



Edit: The beta is now final. These are the new options:

CDG.anchor_point
CDG.dialog_options_upwards
CDG.auto_arrow_up_offset_x
CDG.auto_arrow_down_offset_x
CDG.auto_arrow_up_offset_y
CDG.auto_arrow_down_offset_y

Digital Mosaic Games

I´ve tried to use your example and your template but it says It can´t be run with the beta version and I need AGS 3.2.0. But there isn´t a AGS 3.2.0 :(

abstauber

*cough* yes, I admit, it's a little awkward.
The module of course works with 3.1 - but I've compiled the demo with a release candidate of AGS 3.2.
So if you want to try out the demo, get the latest release candidate of AGS 3.2 here:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=37668.0

(you have to scroll down)

Sorry about this - as soon as the 3.2 goes final, I'll update the demo

Knox

Hey Abstauber,

I love this module! I was about to post a bug but then noticed it was fixed in your new release :)

However I ran into a little problem but im not sure if its your module though, causing the prob... Here is the prob:

Im using Custom Dialog1.5, 1024x768 and 32 bits. My customdialog GUI is a png with the pink color as transparent. Everything works great in window mode, but when I go full screen and have the borders on left or right for widescreen (in the release candidate), the customdialog GUI is off-center (part of it gets eaten from the borders, and its way way right off-center).

Would this have something to do with your module, or (more likely) the fullscreen with borders in the release candidate (2)?

If it has nothing to do with your module, Ill post this then in the bugs section.
--All that is necessary for evil to triumph is for good men to do nothing.

SMF spam blocked by CleanTalk