Suggestions to extend Display functions

Started by CTxCB, Wed 01/02/2017 11:05:52

Previous topic - Next topic

CTxCB

I'm looking to create a prototype of Sierra's ImagiNation Network, to see if it's possible to revive the service under a new engine... Something which would be a lot better than trying to mess with the custom version of SCI (LSCI) which INN uses. Not including networking stuff that would probably be a module... There's some minor Engine & Editor things that would need changed to facilitate the game and sadly, I don't know C++ and can't add these changes myself:




1.) A change to Display, DisplayAt, DisplayAtY, DisplayMessage, DisplayMessageAtY and DisplayTopBar to support generated buttons (As in, not a GUI), even with a different GUI for each button (depending on what Button GUI it calls). Also a drop down menu in the GUIs Section of The Editor which is "New Button GUI", similar to "New Text Window GUI" but for buttons.

2.) A way to place buttons on the screen without a GUI, even with a different GUI for each button (depending on what Button GUI it calls).

3.) A change to DisplayTopBar to support a custom TopBar Border and Postition. Also a drop down menu in the GUIs Section of The Editor which is "New TopBar GUI", similar to "New Text Window GUI" but for the TopBar.

Crimson Wizard

#1
Something that I must explain first of all, PATCHES are for critical fixes only. This means that if any of those suggestion is taken, it goes into future developed version (3.4.1 or 3.5, and so on).

Regarding your suggestions.

1) it is impossible to put Buttons not on GUI, because it is how they are programmed. Also that does not make sense in the logic of GUI AGS uses. Perhaps if you explain why you need that, there may already be a solution.
2) do you really need a change to Display, when you can create any custom GUI you want, with bars, buttons, and texts, and display it on screen?
The Display functions are really just a default way to show some text on screen, when you do not want to meddle with scripting simple message box.

In general I feel like everything you want can already be made in AGS.

EDIT: Also, I cannot see the picture you posted, because server sais "access denied" to me.

CTxCB

Quote from: Crimson Wizard on Wed 01/02/2017 12:00:27
Something that I must explain first of all, PATCHES are for critical fixes only. This means that if any of those suggestion is taken, it goes into future developed version (3.4.1 or 3.5, and so on).

Regarding your suggestions.

1) it is impossible to put Buttons not on GUI, because it is how they are programmed. Also that does not make sense in the logic of GUI AGS uses. Perhaps if you explain why you need that, there may already be a solution.
2) do you really need a change to Display, when you can create any custom GUI you want, with bars, buttons, and texts, and display it on screen?
The Display functions are really just a default way to show some text on screen, when you do not want to meddle with scripting simple message box.

1.) SCI and LSCI uses a way which a display can be created with buttons in place, such as "OK" to hide a message on screen.
2.) The problem I have is that only works if I have fixed text to display, stuff like an error message could be any length and need buttons or a GUI to fit it, whereas I want something simpler which does all that for me, like making sure the buttons are the right size for the text without needing to create hundreds of buttons, thus the "Custom Button GUI" stuff. SCI does this itself, it never has button art, only the stuff for the corners, top, bottom, left and right and it uses them to make it's buttons.

Crimson Wizard

#3
Quote from: CTxCB on Wed 01/02/2017 12:05:57
1.) SCI and LSCI uses a way which a display can be created with buttons in place, such as "OK" to hide a message on screen.
2.) The problem I have is that only works if I have fixed text to display, stuff like an error message could be any length and need buttons or a GUI to fit it, whereas I want something simpler which does all that for me, like making sure the buttons are the right size for the text without needing to create hundreds of buttons, thus the "Custom Button GUI" stuff. SCI does this itself, it never has button art, only the stuff for the corners, top, bottom, left and right and it uses them to make it's buttons.

Everything you describe can be scripted in AGS Script. You can arrange elements on GUI at runtime, calculating their positions and sizes from text. I believe this is rather a question of "how to do this in AGS", than adding absolutely new features to the engine.
People were writing number of script modules in the past that help to put various advanced stuff in your game, like dialog options with icons, animated texts, and so on. Maybe there is even a script module for automatically resizing text windows. If not, someone will surely help you to script one. (maybe even me, if I find free time)

CTxCB

Quote from: Crimson Wizard on Wed 01/02/2017 12:11:26
Quote from: CTxCB on Wed 01/02/2017 12:05:57
1.) SCI and LSCI uses a way which a display can be created with buttons in place, such as "OK" to hide a message on screen.
2.) The problem I have is that only works if I have fixed text to display, stuff like an error message could be any length and need buttons or a GUI to fit it, whereas I want something simpler which does all that for me, like making sure the buttons are the right size for the text without needing to create hundreds of buttons, thus the "Custom Button GUI" stuff. SCI does this itself, it never has button art, only the stuff for the corners, top, bottom, left and right and it uses them to make it's buttons.

Everything you describe can be scripted in AGS Script. You can arrange elements on GUI at runtime, calculating their positions and sizes from text. I believe this is rather a question of "how to do this in AGS", than adding absolutely new features to the engine.
People were writing number of script modules in the past that help to put various advanced stuff in your game, like dialog options with icons, animated texts, and so on. Maybe there is even a script module for automatically resizing text windows. If not, someone will surely help you to script one. (maybe even me, if I find free time)
So, should I be making a normal GUI, making it a size and then messing with that instead? Not using text window GUIs or Displays at all?

Radiant

Somebody should rename this thread before it becomes a duplicate of the issue tracker  :grin:

Crimson Wizard

#6
Quote from: CTxCB on Wed 01/02/2017 12:39:26
So, should I be making a normal GUI, making it a size and then messing with that instead? Not using text window GUIs or Displays at all?

Yes, I think you should try doing that.
If you want same waiting behavior as Display function has, you may use Wait or WaitForKey function, for example.
Scripting more complicated things, like rearranging controls (buttons) dynamically, may take more time and effort, but we have forum for asking questions on scripting, and sometimes people can give very useful script examples there:
http://www.adventuregamestudio.co.uk/forums/index.php?board=2.0



Quote from: Radiant on Wed 01/02/2017 12:44:41
Somebody should rename this thread before it becomes a duplicate of the issue tracker  :grin:
Uh, yes, you are right, seeing this title there will be more people adding their suggestions soon (wtf)

I used my moderator rights to change the topic title to something more definitive.

Sorry if that annoys you, CTxCB, but people seeing threads like "suggestions for version XXX" usually have an urge to add more and more proposals in it :).

CTxCB

Quote from: Crimson Wizard on Wed 01/02/2017 12:46:44
Quote from: CTxCB on Wed 01/02/2017 12:39:26
So, should I be making a normal GUI, making it a size and then messing with that instead? Not using text window GUIs or Displays at all?

Yes, I think you should try doing that.
If you want same waiting behavior as Display function has, you may use Wait or WaitForKey function, for example.
Scripting more complicated things, like rearranging controls (buttons) dynamically, may take more time and effort, but we have forum for asking questions on scripting, and sometimes people can give very useful script examples there:
http://www.adventuregamestudio.co.uk/forums/index.php?board=2.0



Quote from: Radiant on Wed 01/02/2017 12:44:41
Somebody should rename this thread before it becomes a duplicate of the issue tracker  :grin:
Uh, yes, you are right, seeing this title there will be more people adding their suggestions soon (wtf)

I used my moderator rights to change the topic title to something more definitive.

Sorry if that annoys you, CTxCB, but people seeing threads like "suggestions for version XXX" usually have an urge to add more and more proposals in it :).
Thanks, take a look at this: http://www.sierragamers.com/uploads/24082/inn/15909.jpg -- How would I centre that title text in the bounds of it's sub-border? That's out of my range of knowledge.

Crimson Wizard

#8
Quote from: CTxCB on Wed 01/02/2017 12:54:33
Thanks, take a look at this: http://www.sierragamers.com/uploads/24082/inn/15909.jpg -- How would I centre that title text in the bounds of it's sub-border? That's out of my range of knowledge.

Unfortunately I cannot see the picture, when I click on it message sais "Access denied" and "The owner of this website (www.sierragamers.com) does not allow hotlinking to that resource (/uploads/24082/inn/15909.jpg)."

Anyway, let's assume there is a label with some text. First of all, if you want it to be constrainted inside border of certain size, then you may simply stretch label to its maximal allowed size in the editor, then set its TextAlignment property to "Top Middle".

If you want GUI to resize if the text does not fit in the provided label, this is a basic example of script:
Code: ags

int text_width = GetTextWidth(lblLabel1.Text, lblLabel1.Font);
// First, ensure label and GUI (where label is placed) are wide enough
if (lblLabel1.Width < text_width)
   lblLabel1.Width = text_width + 4; // just to add little margin
if (gMyGUI.Width < lblLabel1.Width)
   gMyGUI.Width = lblLabel1.Width + 4; // just to add little padding
// Now center label on GUI and GUI on screen
lblLabel1.X = (gMyGUI.Width - lblLabel1.Width) / 2;
gMyGUI.X = (System.ViewportWidth - gMyGUI.Width) / 2;

Of course this example does not take height into account, and also GUI may go wider than your screen, so there is room for improvement, but that is just to demonstrate basic principles.

SMF spam blocked by CleanTalk