LucasArts GUI Help Thread (NEW Scumm GUI Available!)

Started by TerranRich, Fri 01/08/2003 06:04:47

Previous topic - Next topic

storycatchermike

Can someone possibly give me the entire code for making a lucasarts inventory? I've tried to do it, and I can't figure it out at all. Anyone think they can do that for me?
Story Catcher Mike (Founder of Knights Creations)
Upcoming AGS game by me: Sir Tilean and the Way of the Knight (Game Total = 5%)

storycatchermike

Umm...since no one said anything to my last one, I'm gonna post something else. Can anyone help me with my inventory window? I got it to load up and stuff, but it is loading up on startup. How do I stop that? Also, how do I get it so you can look at and grab items? Whenever I click on an item in look or get mode, it just changes the icon. What am I doing wrong?
Story Catcher Mike (Founder of Knights Creations)
Upcoming AGS game by me: Sir Tilean and the Way of the Knight (Game Total = 5%)

Ashen

I think your last question was a bit vague, which is why no-one answered. Read the GUI section of the BFAQ, and maybe Darth mandarbs Custom Inventory thread, for some pointers, then ask back if there's something specific you don't undersatnd.

1. To stop it appearing on start up, got to the GUI window, and set the 'Visible' property to 'Popup Modal'. OR, leave it set to 'Normal', and add a GUIOff() command to the game_start function, or in the Player enters screen (before fade-in) of the first room. Then, you'll need to have something (e.g. akey press, or a button on another GUI) that turns it on when you want it.

2. You probably need to set up the interactions for the different modes for each inventory item, on the Inventory' window of the editor. By default, 'Use'ing the item will set it as active, and changes the cursor graphic to reflect that.
I know what you're thinking ... Don't think that.

storycatchermike

Actually, I figured out what all was wrong. Now I have another question. I'm trying to make a custom "quit" screen, but whenever I put in the script, the custom quit screen comes up anytime I push a button on the Options GUI. Anyone think they can help with that? Does anyone have a script that can keep that from happening?
Story Catcher Mike (Founder of Knights Creations)
Upcoming AGS game by me: Sir Tilean and the Way of the Knight (Game Total = 5%)

strazer

QuoteActually, I figured out what all was wrong.

Care to tell us what was wrong?

As for the quit screen, in addition to the GUI a control was clicked on, you also have to check which control it was, hence your interface_click function should look something like this:

Code: ags

function interface_click(int interface, int control) {

  if (interface == YOURGUI) { // if any control on that GUI was clicked
    if (control == 2) { // if control no. 2 was clicked (quit button)
      QuitGame(0); // quit game without asking
    }
  }

}


Note I have used "control" as the variable name instead of the default "button" since I like that term better.

And please, if you have basic questions such as this that are not directly related to the subject of the thread, please open a new thread in the Beginner's Forum instead of posting to the sticky threads. Thanks.

storycatchermike

Quote from: strazer on Mon 18/04/2005 04:30:20
QuoteActually, I figured out what all was wrong.

Care to tell us what was wrong?

As for the quit screen, in addition to the GUI a control was clicked on, you also have to check which control it was, hence your interface_click function should look something like this:

Code: ags

function interface_click(int interface, int control) {

  if (interface == YOURGUI) { // if any control on that GUI was clicked
    if (control == 2) { // if control no. 2 was clicked (quit button)
      QuitGame(0); // quit game without asking
    }
  }

}


Note I have used "control" as the variable name instead of the default "button" since I like that term better.

And please, if you have basic questions such as this that are not directly related to the subject of the thread, please open a new thread in the Beginner's Forum instead of posting to the sticky threads. Thanks.

The problem that I had was that I had it set to "normal" instead of "popup Model" I do that sometimes.

Also, I dunno if that'll work, because that is extremely similar to the code I used.  What I'm trying to get it to do is come up with the main character asking if the player is sure if they want to quit or not, and then go to the GUI which has the "quit" and "play" buttons. I can't get it to switch, though, without the GUI popping up whenever I click any of the buttons. It should only come up when I click the quit button, but it comes up when I hit any of the buttons, except for restart.
Story Catcher Mike (Founder of Knights Creations)
Upcoming AGS game by me: Sir Tilean and the Way of the Knight (Game Total = 5%)

monkey0506

It sounds to me like perhaps you code wasn't just like strazers... Maybe you were trying to do something like

Code: ags
if (interface == GUINAME) {
  if (control == 2) {
    gGuiname.Visible = false;
    QuitGame(0);
    }
  }


But you forgot a set of braces, i.e.:

Code: ags
if (interface == GUINAME) {
  if (control == 2) 
    gGuiname.Visible = false;
    QuitGame(0);
  }


Which would turn off the GUINAME GUI when you click on control 2, but would run QuitGame(0) no matter which control you click on...Perhaps...Or, you could try posting the code that you're actually using so we can see what's going on...

storycatchermike

#227
I hate to say it...but that made no sense...
Code: ags
   if (interface == OPTIONS) {
    if (button == 5) SetGameSpeed(GetSliderValue(2,5));
    if (button == 13) SetMusicMasterVolume(GetSliderValue(2,13));
    if (button == 10) SetSpeechVolume(GetSliderValue(2,10));
    if (button == 4) SetSoundVolume(GetSliderValue(2,4));
    if (button == 0) SaveGameDialog();
    if (button == 1) RestoreGameDialog();
    if (button == 2) RestartGame();
    if (button == 3) QuitGame(1);
    if (button == 8) Display("Game by Knights Creations with use of AGS. AGS copyright of Chris Jones.");
    if (button == 9) {
      GUIOn(1);
      GUIOff(2);
    }
    if (button == 3) DisplaySpeech(EGO, "Art thou shure thou wishes to quit?"; {
      GUIOn(5);
      GUIOff(2);
       }
    } 

That's my entire options menu.
Story Catcher Mike (Founder of Knights Creations)
Upcoming AGS game by me: Sir Tilean and the Way of the Knight (Game Total = 5%)

Scummbuddy

You do have a problem with braces here, and a missing closing parentheses:
Ã, 
Ã,  if (button == 3)
   { DisplaySpeech(EGO, "Art thou shure thou wishes to quit?");
Ã,  Ã,  Ã,  GUIOn(5);
Ã,  Ã,  Ã,  GUIOff(2);
Ã,  Ã,  Ã,  Ã, }
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

monkey0506

#229
Quote from: Scummbuddy on Wed 20/04/2005 22:09:39
You do have a problem with braces here, and a missing closing parentheses:

   if (button == 3)
   { DisplaySpeech(EGO, "Art thou shure thou wishes to quit?");
      GUIOn(5);
      GUIOff(2);
       }


Edit:  Thank you for saying exactly what I just said, only with using his script instead of the pseudo code...

Edit:  Oh...I just realized I wrote my pseudo code in 2.7 syntax instead of the old-style code.  Which would be why it made no sense to him...My mistake mike, the code I used utilizes the syntax of the yet to be released (still in BETA) AGS 2.7...

storycatchermike

oops...forgot to put that in when I typed it out...it still isn't working v.v
Story Catcher Mike (Founder of Knights Creations)
Upcoming AGS game by me: Sir Tilean and the Way of the Knight (Game Total = 5%)

=The=Brat=

look im gonna be laisy. has anyone talked about a CMI styled GUI and if there has been talk on this then wat was the final result.

sorry, to many pages to look through

Scummbuddy

I hope browsing this link isnt too much of an inconvienence for you. http://www.freewebs.com/skimbleshanks/templatesandmodules.htm

Seriously, If you are too lazy to use our search function, what makes you think you are willing to code, and why should we help you?
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

=The=Brat=

sorry i forgot all about the search function

Gilbert

At least the search function is disabled for the time being. :=

Scummbuddy

you win this round, brat. but ill get you. you and your little brat-dog too.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

thumtron

Hey there.

I got a very specific problem with one of Proskritos (btw: fantastic) templates, the FOA template. I modified a lot, and it all worked out well, but now there is one thing I don't get.

Whenever I you use the "Close"-Button it will work for one time, displaying "SchlieàŸe (whatever)" in the Action Bar and the default Message. But only for one time.

I replaced the standard font with a font that features German characters, so that's not the problem. I just don't get why it works just one time, and then does not display the Mode in the action bar anymore, no matter how often you klick it. All other modes work fine.

Is it something about the cursor modes? I messed around a bit with them, I still haven't gotten behind, why "Close, Open, Push, Pull" have got the same cursor mode. Can somebody explain that to me?

Thanks in advance, I would have browsed the forums for an answer, but the search was disabled.

Mats Berglinn

#237
I've started to play around with the templates in the 2.7 version of AGS but when I try to test them I get this message:

There was an error compiling your script. The problem was:
In: 'Global script'

Error (line 221): 'gui' is a global var; cannot use as name for local.

This happens in both MI2 template and FOA template. What's actually wrong? How do I fix this? Does somebody know?

EDIT: The problem IS the same in the DOTT template too.

Scummbuddy

youll need to find and replace all those names which are now reserved for the engine with another, such as gooey, or something similar as for you to understand what you mean it to be.

These templates are not updated to work with the recent version of AGS 2.7, so using them is not suggested, with that version. Feel free to use them with the version they were compiled with, since I believe I have read that Proskrito has done all the updating he wishes to do with those templates. If I ever get any free time, I was considering doing an overhaul on them to work with the recent release, but don't wait up for me.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

RickJ

I'm in the process updating the demo to be V2.7 compliant.  I am about to begin work on the LEC GUI room and I wonder if it would be better to abandon the previous LEC gui example in favor of a template?  Rui has recommended any of Proskritos templates for this purpose.   What do you guy over here think?

SMF spam blocked by CleanTalk