LucasArts GUI Help Thread (NEW Scumm GUI Available!)

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

Previous topic - Next topic

abstauber

QuoteMaybe i have an older version?
That could be it. In the recent versions of this template, this function is called from the GlobalScript at line 41 inside game_start().
In any case, here is the function :)

Code: ags

//guiscript.ash
import function InitGuiLanguage();


Code: ags

//guiscript.asc
function InitGuiLanguage() {
  AdjustLanguage();
  int i;
  GUIControl*gc;
  Button*b;
  
  while (i < A_COUNT_) {
    gc = gMaingui.Controls[action_button[i]];
    b =  gc.AsButton;
    b.NormalGraphic=action_button_normal[i];
    i++;
  }
}


PS.
Quoteit gives me unresolved import initguilanguage.
remember, ags script it is case sensitive: InitGuiLanguage  ;)

rmonic79

thanks tomorrow i'll give it a try.
p.s. i wrote it without uppercase but in the script it was right ;)

rmonic79

It seems to work really fine thanks Abstauber :)

rmonic79

Another "maybe" dumb question but i didn't find a solution yet.
Always regarding the GUI changes we need to change the colors of the square and the text of the listbox in runtime (gsave and grestore).
The options list of the object are different from the other gui and there's no signs of textcolor,selectedtextcolor or selectedbackgroundcolor or, is there a workaround?

abstauber

Hmm.. it really seems like listboxes do not allow to change colors during runtime - only fonts. Has this been overlooked for such a long time? Maybe it's best to open a separate thread for this.

Crimson Wizard

#505
Quote from: abstauber on Mon 11/04/2016 10:19:45
Hmm.. it really seems like listboxes do not allow to change colors during runtime - only fonts. Has this been overlooked for such a long time? Maybe it's best to open a separate thread for this.
I believe there is already a general issue about non-changeable GUI properties in the tracker.

The workaround for background color (I think) is to create GUI background image and dynamically draw it.

rmonic79

Hi guys we've found another strange behaviour, when interface is disabled and we press a shortcut button on keyboard the cursor appears. Is there a way to ignore them?

abstauber

Oops, seems to be another bug:

Code: ags

//line 110 in GlobalScript.asc 
//old
  if (!IsGamePaused()) {

//new 
 if (!IsGamePaused() && !is_gui_disabled())

rmonic79

#508
thanks for reply, we have a problem that doesn't regard paused game, we have a little minigame where you have to press mouse button fast meanwhile maingui, gaction and interface are disabled. If we press qweasdzxc or another keyboard keycode the cursor show it again.
[Half solved with mouse.visible false]

rmonic79

Hi guys i'm trying to disable in a specific scene keyboard shortcuts in wich way i can do it?
(i made a variable in setactionbutton in guiscript but didn't work)
Thanks

Danvzare

Quote from: rmonic79 on Thu 16/06/2016 16:36:19
Hi guys i'm trying to disable in a specific scene keyboard shortcuts in wich way i can do it?
(i made a variable in setactionbutton in guiscript but didn't work)
Thanks
That's easy. Create a variable. Go into the global script. Add an IF statement so the code to run those shortcuts, only runs when that variable is in its default state. Set the variable to something else at the start of the scene where they're disabled. Set the variable to its default state at end of the scene where they're disabled.
I hope that helps. If it doesn't, I can try and post the exact code I would use (if someone else doesn't beat me to the punch that is).

Khris

SetActionButton() is the inital setup.
Keyboard shortcuts are implemented using a loop at the end of GlobalScript/on_key_press, this loop calls SetAction().

You can either exit on_key_press before the loop, or exit SetAction() at the start. I suggest the latter because it will completely disable the entire mechanism.

rmonic79


rmonic79

Hi guys, one of my tester yesterday found a null point referenced error on mouse_on_click. I was able just a  minute ago to reproduce it. It occurs when you press "use with" with keyboard shortcut and quickly move cursor outside inventory gui.
the error is on line 1559
Code: ags

  if (Mouse.Mode==eModeInteract)
            {
              if (isAction(eGA_Use) && ii.IsInteractionAvailable(eModeInteract))
              {
                ActionLine.TextColor=ActionLabelColorHighlighted;
                ii.RunInteraction(eModeInteract);
                SetAction(eMA_Default);
              }
               else player.ActiveInventory=ii;
             }
          else 
           {
              if ( (Mouse.Mode >0 && Mouse.Mode <10 )&& ii != null)
              {
                GSagsusedmode=Mouse.Mode;
                ActionLine.TextColor=ActionLabelColorHighlighted;
                ii.RunInteraction(Mouse.Mode);
                SetAction(eMA_Default);
              }
             
           }


i solved like this

Code: ags

  if (Mouse.Mode==eModeInteract)
            {
             if (ii!=null) //HERE
             {
              if (isAction(eGA_Use) && ii.IsInteractionAvailable(eModeInteract))
              {
                ActionLine.TextColor=ActionLabelColorHighlighted;
                ii.RunInteraction(eModeInteract);
                SetAction(eMA_Default);
              }
               else player.ActiveInventory=ii;
             }
            }
         else 
           {
              if ( (Mouse.Mode >0 && Mouse.Mode <10 )&& ii != null)
              {
                GSagsusedmode=Mouse.Mode;
                ActionLine.TextColor=ActionLabelColorHighlighted;
                ii.RunInteraction(Mouse.Mode);
                SetAction(eMA_Default);
              }
             
           }


Do you think that's enough?
For now it works fine...

abstauber

It looks fine to me. You could also play save and add the check for inventory item in the right click area as well.

Code: ags

    //right click in inventory
    else if (button==eMouseRightInv) {
      if (alternative_action==eMA_Default) {
        SetAction(eMA_Default);
      }
      else {
        SetAction(alternative_action);
        used_action=global_action;
        GSagsusedmode=Mouse.Mode;
        if (Mouse.Mode==eModeInteract && ii != null) { // HERE
          if (isAction(eGA_Use) && ii.IsInteractionAvailable(eModeInteract)) {
            UpdateActionBar();
            ActionLine.TextColor=ActionLabelColorHighlighted;
            ii.RunInteraction(eModeInteract);
            SetAction(eMA_Default);
          }
          else player.ActiveInventory=ii;
        }
        else {
          UpdateActionBar();
          ActionLine.TextColor=ActionLabelColorHighlighted;
          inventory[game.inv_activated].RunInteraction(Mouse.Mode);
          SetAction(eMA_Default);
        }
      }
    }

Btw. I still didn't manage to replicate the crash - at least not in this tiny sample game.

rmonic79

Thanks Abstauber we'll make a little test and we confirm the right behave of this thing.

By the way, we have another half turnarouded problem.
We have the languages selection at the start of the game everytime you launch it. If we have saved an italian game, launched the game again and english language is selected before load the gui will be Italian but the language will be english. Now, we've find a solution in event restore using Game.changetranslation. In this way the load will be in the original saved language. We would like to load the game with the language selected at the start of the game. It can be done?

MrJackAttack

Hi,

I am new to AGS, and have a question regarding Art and the MI verb interface resolution at 320x200

So, in GIMP I have created art for a room, at 320x200, filling the entire space of 320x200. From my research, I have gathered that most of the classic adventure titles adhere to that resolution.

The problem I am encountering is that, the Verb Interface ends up blocking just under half of my art, when I import it into the program for use.

My question is, do I have to create art, leaving blank/black space at the end of my "room" for the verbs to fit in?

If so, what are the dimensions of the verb bar? and what is the dimension of space that I can draw in?

or, is there anyway of scaling the art I have already made to fit in the smaller view point.

Or could I move up the resolution to 640x480, and still use the 320x200 art?

Thank you for any help.
MrAttack

Khris

There are several options:

- use the LW BASS template instead. If you absolutely want a 9-verb game, read on.

- let the room scroll. The default height of the GUI is 57 pixels (the action bar GUI is at a Y coordinate of 143), so if you simply add 57 blank rows of pixels to your background, increasing it to 320x257, the room will scroll vertically. The character is auto-centered, so results may vary, and you might want to use custom scrolling instead.

- make the action bar background transparent (if it isn't already) and sacrifice some of your art.

- hide the GUI, and show it if the player moves the mouse to the bottom of the screen. Experienced players will use the shortcut keys for the verbs anyway. This is actually what I would do: slide the action bar and verb GUI down so the verb GUI fully disappears and the action bar is at the bottom. If the mouse moves over the action bar, slide them back up.

- increase the game's resolution. Newest AGS versions allow completely custom resolutions, so you could in fact create a 320x257 game and move the action and verb GUIs down accordingly. You'd have to again add 57 blank pixels to your 320x257 room backgrounds.
This is not recommended if you want players to play your game full-screen, but with a 320 game you probably don't want that anyway. I personally rarely use a factor greater than 4 and play all 320 games windowed.

Snarky

Quote from: Khris on Wed 08/03/2017 17:31:27
This is not recommended if you want players to play your game full-screen, but with a 320 game you probably don't want that anyway. I personally rarely use a factor greater than 4 and play all 320 games windowed.

I, on the other hand, always play low-resolution games in full screen, but high-resolution games (that don't need to be scaled up) usually windowed. Not sure why...

MrJackAttack

Quote from: Khris on Wed 08/03/2017 17:31:27
There are several options:

- use the LW BASS template instead. If you absolutely want a 9-verb game, read on.

- let the room scroll. The default height of the GUI is 57 pixels (the action bar GUI is at a Y coordinate of 143), so if you simply add 57 blank rows of pixels to your background, increasing it to 320x257, the room will scroll vertically. The character is auto-centered, so results may vary, and you might want to use custom scrolling instead.

- make the action bar background transparent (if it isn't already) and sacrifice some of your art.

- hide the GUI, and show it if the player moves the mouse to the bottom of the screen. Experienced players will use the shortcut keys for the verbs anyway. This is actually what I would do: slide the action bar and verb GUI down so the verb GUI fully disappears and the action bar is at the bottom. If the mouse moves over the action bar, slide them back up.

- increase the game's resolution. Newest AGS versions allow completely custom resolutions, so you could in fact create a 320x257 game and move the action and verb GUIs down accordingly. You'd have to again add 57 blank pixels to your 320x257 room backgrounds.
This is not recommended if you want players to play your game full-screen, but with a 320 game you probably don't want that anyway. I personally rarely use a factor greater than 4 and play all 320 games windowed.

Thank you Khris, you have been very helpful.

Cheers
MrAttack.


SMF spam blocked by CleanTalk