Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Paper Carnival on Fri 24/10/2003 19:16:00

Title: That's it! I hate GUIs!
Post by: Paper Carnival on Fri 24/10/2003 19:16:00
I'm sorry to say that, but the way GUIs works just sucks

I mean, You can easily create option forms and stuff like that... But it's all too limited and works stupid if you ask me, especially for inventory GUIs. Ok, maybe there *is* a way to do what I want after all, but I still can't find that and it should be a lot easier to do what I want.

I mean, why doesn't the GUI detect the mouse clicks if the mouse is over the form? Or why do GUIs with Mouse YPos visibility go away when I click a button (even if I don't want them to)? Should I mention the fact that Popup Modal GUIs are always behind GUIS with Normal or Persistent visibility?

Come on, it can certainly be better than that. I believe one of the most importand things AGS needs is GUI flexibility. This thread might look like a complaint and probably this is said before (I used the search feature but I couldn't find anything like that), but why is the GUI mechanism so close-minded? Well, here is a list with suggestions in case you got lost:
a) Detect mouse clicks when clicking on a GUI
b) Order of GUI appearence?
c) Don't turn off a Mouse YPos GUI when a mouse key is pressed, but give the choice to the user
d) "Reverse" Mouse YPos visibility, so you can have a GUI coming from below (try the current one and you'll see what I mean)
e) many, many more I can't remember right now (maybe I'll post them later)

I really need to have some more control over the GUIs , or else I'll have to use the default inventory  :-X, something I really don't like. Thanks for reading this  anyway ;D
Title: Re:That's it! I hate GUIs!
Post by: Ishmael on Fri 24/10/2003 19:48:01
You dont seem compitable with AGS.....  :( Learn some scripting. You could have kindly asked how to do those things, if they can be done, with scripting, instead of announcing that you hate GUIs because AGS doesn't have straight one mouse click system to do something more advanced.

But serioulsy, most of that can be done. Right now I'm on a non-AGS computer, so I can't give examples... and I don't have time.. Indiana Jones and the Temple of Doom is on :P
Title: Re:That's it! I hate GUIs!
Post by: scotch on Fri 24/10/2003 19:50:01
Could you clarify what you mean by 'Detect mouse clicks when clicking on a GUI' <- that's what interface_click is for isn't it?

The only thing in your suggestions that can't be done with the current system is to change the order the GUIs appear, I think, which would be useful sometimes.  If you want things to work very specifically you can't expect it to be that way by default, it's not what most people will want, that's what scripting is for.

I may well be misunderstanding you though.

The GUI system has been used to make anything from scumm to sierra to complicated inventories or the sims style system in my game, it obviously doesn't suck.
Title: Re:That's it! I hate GUIs!
Post by: Pumaman on Fri 24/10/2003 22:12:10
Quote from: Guybrush Peepwood on Fri 24/10/2003 19:16:00
Come on, it can certainly be better than that. I believe one of the most importand things AGS needs is GUI flexibility. This thread might look like a complaint and probably this is said before but why is the GUI mechanism so close-minded?

The GUI system was not designed to annoy you as much as possible. "Why doesn't it" questions are usually answered by "because I haven't had time to do it yet". Plus, you have to understand that generally people don't use the GUI editor much - just to set up their GUIs at the start of the game. Therefore, improvements to it are not as important as to, say, the interaction editor or scripting, which you tend to use on a very regular basis.

Quote
a) Detect mouse clicks when clicking on a GUI

Clicking on a GUI button or object fires interface_click; clicking on the background fires on_event with GUI_MDOWN

Quote
b) Order of GUI appearence?

This is a known issue at present, the order is the order in which they are displayed in the list in the GUI editor (ie. GUI 5 is always in front of GUI 3, etc). It's on my to-do list.

Quotec) Don't turn off a Mouse YPos GUI when a mouse key is pressed, but give the choice to the user
d) "Reverse" Mouse YPos visibility, so you can have a GUI coming from below (try the current one and you'll see what I mean)

The mouse ypos GUI is just designed as an easy-to-use Sierra icon bar. You can do what you want with a normal GUI and popping it up with a text script depending on the mouse location.

Title: Re:That's it! I hate GUIs!
Post by: Paper Carnival on Sat 25/10/2003 07:09:33
Ok, I apologize. Maybe I wasn't very kind. Ya c, I was feeling rather sleepy. But anyway,
QuoteYou dont seem compitable with AGS.....  Learn some scripting. You could have kindly asked how to do those things, if they can be done, with scripting, instead of announcing that you hate GUIs because AGS doesn't have straight one mouse click system to do something more advanced.

But serioulsy, most of that can be done. Right now I'm on a non-AGS computer, so I can't give examples... and I don't have time.. Indiana Jones and the Temple of Doom is on
Well, I do know basic scripting with AGS and I thought that this is kinda like an advanced question. I wanted to ask if that's already possible but I forgot (I always forget something). Oh and I did ask how to do some inventory related stuff in the beginners forum, but I still didn't get a reply

QuoteCould you clarify what you mean by 'Detect mouse clicks when clicking on a GUI' <- that's what interface_click is for isn't it?

The only thing in your suggestions that can't be done with the current system is to change the order the GUIs appear, I think, which would be useful sometimes. If you want things to work very specifically you can't expect it to be that way by default, it's not what most people will want, that's what scripting is for.

I may well be misunderstanding you though.

The GUI system has been used to make anything from scumm to sierra to complicated inventories or the sims style system in my game, it obviously doesn't suck.
I'm sorry again, but I am not used to the way AGS works. I know almost anything that can be done with Game Maker scripting, which works in a completely different way. Don't ask me to use game maker instead of AGS because the only benefit I have with making the game in GM is that I create my own engine. It's not I can't do it but GM is rather slow and unstable and has less control over some files, no matter how much you try (unless you make a plugin).

What I meant with detect mouse clicks on gui is clicking on the background. If I put in a code:
If (button==1) //dosomething
else if (button==2) //dosomethingelse
else GUIOff(4);
That wouldn't work. Neither would it in on_mouse_click. Now this
Quoteclicking on the background fires on_event with GUI_MDOWN
is what I wanted. Thanks Chris! (funny, I've been trying to figure it out from the manual for a week and I can't believe it was there :P)
QuoteThe GUI system has been used to make anything from scumm to sierra to complicated inventories or the sims style system in my game, it obviously doesn't suck.
Again, I'm sorry but I searched everywhere to for the solution using the manual or even tutorials, but I couldn't find any.
QuoteThe mouse ypos GUI is just designed as an easy-to-use Sierra icon bar. You can do what you want with a normal GUI and popping it up with a text script depending on the mouse location.
Yeah I know but wouldn't it be a easier that way? Well, actually I prefer Chris to spend more time to put things you can't do yet, but I think it was a nice suggestion...

I apologize again for it and I hope u forgive me :). You forgive me, right? Right ???
Title: Re:That's it! I hate GUIs!
Post by: Pumaman on Sat 25/10/2003 13:15:18
Quote
Quoteclicking on the background fires on_event with GUI_MDOWN
is what I wanted. Thanks Chris! (funny, I've been trying to figure it out from the manual for a week and I can't believe it was there :P)

This is a fair point actually, it's not a very intuitive way of doing things, and it would probably be better for interface_click to be called with -1 as the button number or something, to signify a click on the background.
Title: Re:That's it! I hate GUIs!
Post by: scotch on Sat 25/10/2003 13:20:24
I would agree with that, I didn't realise there was a way to catch clicks on the background of a GUI, it's improved mine a bit now I can.  I assumed it'd be in interface click if there was.
Title: Re:That's it! I hate GUIs!
Post by: Paper Carnival on Sat 25/10/2003 14:03:03
Here is some of the code I created with this thingy:

function on_event(int event, int data) {
 if (event == GUI_MDOWN)
 if (data == COIN)
 if (IsButtonDown(RIGHT))
 GUIOff(COIN);
}

It works great! I'll use it even more later for more GUIs (especially for the inventory), but it's only what I have put so far. It's good because it can also know the button pressed by using the IsButtonDown function!

There is one bad thing though: It detects the click even if the mouse was over a button! That's not a problem to me at all; infact, it would be better for my purpose. However, there should be a way to detect mouse clicks only if the user clicked the background and not any buttons. You never know, somebody might use it.
Title: Re:That's it! I hate GUIs!
Post by: scotch on Sat 25/10/2003 14:06:56
I have that in my script, you just have to use GetGUIObjectAt:

function on_event (int event, int data) {
 if(event==GUI_MDOWN && data==3) if(GetGUIObjectAt (mouse.x, mouse.y)==-1) GUIOff(VERBSELECT);
   }
Title: Re:That's it! I hate GUIs!
Post by: Paper Carnival on Sat 25/10/2003 14:31:04
Oh yeah, how stupid of me :P... Boy I have still lots of things to learn (I only used AGS for a week or two ya c). I was aware of the other similar functions (like GetHotspotAt), but not of this one.

When I'm over with the inventory thingy (it won't be today, I have to go in a while) I'll make a template version to help other guys like me.
Title: Re:That's it! I hate GUIs!
Post by: Ishmael on Sat 25/10/2003 16:22:49
I apologize for my reply, it was a bit unpolite... I think I was tired aswell...

I made the VCoin in EFL with the on_mouse_click and repeadetly_execute.... This info here could help me make it easier and better... or I'll just templateize it... or something...