LucasArts GUI Help Thread (NEW Scumm GUI Available!)

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

Previous topic - Next topic

Gurok

Regarding your dialogue problem, I haven't looked at the module thoroughly, but as a general rule when upgrading to 3.4.x:

Replace dialog_options_get_active with dialog_options_repexec
Ensure info.RunActiveOption(); is called from dialog_options_mouse_click (usually just pasting it at the end will do)

The manual hasn't been updated yet AFAIK, but CW laid out some more detailed guidelines here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=51050.msg636504472#msg636504472
[img]http://7d4iqnx.gif;rWRLUuw.gi

rmonic79

thanks guys, i've found a strange bug if i double click on savegame slot. It returns an error about SaveListBox_Click wrong number of parameter :2, expected 1. Any suggestion?

rmonic79

the editor says:

error running function savetextbox_click, runtime error wrong number of parameters to exported function savetextbox_click (expected 1 , supplied 2)

abstauber

Sorry for the late reply and thanks for the bug report.

In the globalscript, look for this line
Code: ags

function SaveTextBox_Click(GUIControl *control) {


and change it to
Code: ags

function SaveTextBox_Click(GUI *theGui, MouseButton button) {


This fixes it.

rmonic79


rmonic79

hi guys there's something that comings up with beta testing of our demo. If i use talk to on inventory item it doesn't show on the action bar but if i click it takes the unhandled and if i use pick up on inventory item automatically become use in the action bar.
About speak i would like that the action appears in the action bar and for pick up the action should remain pickup.
Give us an hand pls :)
p.s. (we are searching in the code but we don't understand well where is the part that connect the action bar and the inventory code, moreover this things, maybe, will be solved in the next release of the template.)

abstauber

I've just updated the template and addressed the issues you've mentioned. Please take a look at the modules thread for more information.

rmonic79

Quote from: abstauber on Wed 01/07/2015 13:43:11
I've just updated the template and addressed the issues you've mentioned. Please take a look at the modules thread for more information.
Thanks :)
We worked some hour to update our game made in 3.2 to 3.4.0.5 (we had to change the code line by line comparing old with new cause we added many things to the old one).Remains one little(or big) problem with complete customdialoguegui 1.6.3, instead of run dialogues on click, it highlights the sentence and nothing else happen. With your semplified customdialogue in the template or deleting the module, it works well. We are trying to figure out what's going on with no results.
Pls help us we wanna use for cycle :)

rmonic79

Hi Guy, we need to have blank gui when dialog is running, is it possible to do it changing something in guiscript instead of close and reopen gui in every dialogues?
Thanks.

abstauber

You could use a setting in the AGS editor.
In general settings, under "Visual" set "When player interface is disabled, GUIs should" to "be hidden"
Although this also hides the GUI for every other blocking event. Would this be sufficient?

rmonic79

#490
Quote from: abstauber on Fri 09/10/2015 17:09:13
You could use a setting in the AGS editor.
In general settings, under "Visual" set "When player interface is disabled, GUIs should" to "be hidden"
Although this also hides the GUI for every other blocking event. Would this be sufficient?
yes i tried it, but it has strange behaviour during walkto action (sometimes desappears, sometimes not).

and we have another question about doubleclickskip. We are searching for a way to disable and enable it (maybe using a global variable) without act on the speed and have it works also on objects.
we found that parts of guiscript code:
Code: ags
function WalkOffScreen(){
 //handles the action of hotspots with exit extension ('>e').
 //double click in such hotspots/objects... will make the player skip
 //walking to it. Look the documentation for more information on exits.
  
  // doubleclick
  if (UsedAction(eMA_WalkTo)) {
    if (timer_run == true) 
    {
      timer_run=false;
      if (MovePlayerEx(player.x,player.y,eWalkableAreas)>0) hotspot[GSlocid].RunInteraction(eModeUsermode1);
      if (MovePlayerEx(player.x,player.y,eWalkableAreas)>0) object[GSlocid].RunInteraction(eModeUsermode1);// we tried this

    }
    else
    {
      //doubleclick = false;
     timer_run = true;
      if (Go()){
        int x=player.x,y=player.y;
        int offset=walkoffscreen_offset;
        int dir=ExtensionEx(2,GSlocname);
        if      (dir=='u') y-=offset;
        else if (dir=='d') y+=offset;
        else if (dir=='l') x-=offset;
        else if (dir=='r') x+=offset;
        if (MovePlayerEx(x,y,eAnywhere)>0){
          hotspot[GSlocid].RunInteraction(eModeUsermode1);
          object[GSlocid].RunInteraction(eModeUsermode1);// and this one

        }
      }    
    } 
  }
}

but add, for example "object[GSlocid].RunInteraction(eModeUsermode1);" results in crash when re-entering in room

abstauber

#491
You need to check the location type first, before you can trigger the function.
Code: ags

function WalkOffScreen(){
 //handles the action of hotspots with exit extension ('>e').
 //double click in such hotspots/objects... will make the player skip
 //walking to it. Look the documentation for more information on exits.
  
  // doubleclick
  if (UsedAction(eMA_WalkTo)) {
    if (timer_run == true) 
    {
      timer_run=false;
      if (MovePlayerEx(player.x,player.y,eWalkableAreas)>0) {
        if (GSloctype==eLocationHotspot) hotspot[GSlocid].RunInteraction(eModeUsermode1);
        else if (GSloctype==eLocationObject) object[GSlocid].RunInteraction(eModeUsermode1);
      }
    }
    else
    {
      //doubleclick = false;
      timer_run = true;
      if (Go()){
        int x=player.x,y=player.y;
        int offset=walkoffscreen_offset;
        int dir=ExtensionEx(2,GSlocname);
        if      (dir=='u') y-=offset;
        else if (dir=='d') y+=offset;
        else if (dir=='l') x-=offset;
        else if (dir=='r') x+=offset;
        if (MovePlayerEx(x,y,eAnywhere)>0){
          if (GSloctype==eLocationHotspot) hotspot[GSlocid].RunInteraction(eModeUsermode1);
          else if (GSloctype==eLocationObject) object[GSlocid].RunInteraction(eModeUsermode1);
        }
      }    
    } 
  }
}


I also managed to add an option to hide the gui in dialogs.

In dialogscript.ash add this in the struct CustomDialogGui (e.g. line 37)
Code: ags
bool hide_gui_while_dialog;


In dialogscript.asc add this at the beginning
Code: ags
bool in_speech;


now add this to the init function (line 19+)
Code: ags
  
// Activate this to hide the action GUI while a dialog is active.
  this.hide_gui_while_dialog = true; 


add this to the beginning of _prepare (now line 133+)
Code: ags

  if (this.hide_gui_while_dialog == true && gMaingui.Visible == true && gAction.Visible == true) {
    gMaingui.Visible = false;
    gAction.Visible = false;
  }


and finally add this to repeatedly_execute (now line 738)
Code: ags

  if (in_speech == true) {
    in_speech = false;
    if (CDG.hide_gui_while_dialog == true && gMaingui.Visible == false && gAction.Visible == false) {
      gMaingui.Visible = true;
      gAction.Visible = true;
    }
  }

I will push these changes to the git repository and upload a newer template version later on.

rmonic79

Hi abstauber and thanks a lot. There is only one problem, the gui desappears when the first option appears. If there is only one question that the character say directly or there are some phrases before the options appear the gui is shown. Is there a turnaround to avoid this?
(We are searching in ags (3.4) to some that can check if a dialogue(generally) is running or not, or  something can check if the text is shown on the screen but nothing)

abstauber

Yeah, you are right. My solution can only work, if the custom dialog GUI has a chance to appear. Unfortunately I don't know of any events that are being triggered once a dialog starts. Therefore you would need to have some sort of global "in_speech" which needs to be set to "true" in every dialog script.
I guess I need to think about this some more.

rmonic79

Hi guys we  are making two different Guis and there are two big problems: the first one (but maybe we have find a workaround) the gui change always after fade in even in room load (using adjust language command); for the second one when we change gui we change also character but the inventory items of the previous character stay visible during fade in and then change. Any solution? Thanks for your time ;)

abstauber

Quotethe gui change always after fade in even in room load (using adjust language command)
Could you please provide some more details on the first problem - I somehow can't make sense of that statement.

Quotewhen we change gui we change also character but the inventory items of the previous character stay visible during fade in and then change
Both characters are in different rooms I suppose? I'll create a test case and see if I can replicate this. In the meantime, have you tried to force an update via invMain.CharacterToUse = cCthulhu; ?

rmonic79

in the guiscript we did something like
Code: ags

function AdjustLanguage() {
  
  // English
  if (lang == eLangEN){
    // yes/no-keys
    key_u_yes= 'Y';
    key_l_yes= 'y';
    key_u_no= 'N';
    key_l_no= 'n';
    
    // (eNum Name, Name, GUI Button ID, Sprite-Normal, Sprite-Highlight, Keyboard-Shortcut)
    if (FLASHBACK==false)
    {
    btnMainBack.NormalGraphic=123;
    SetActionButtons(eGA_GiveTo, "a_button_give    0  125  138 Qq");
    SetActionButtons(eGA_PickUp, "a_button_pick_up 1  126  139 Ww");
    SetActionButtons(eGA_Use,    "a_button_use     2  127  140 Ee");
    SetActionButtons(eGA_Open,   "a_button_open    3  129  142 Aa");
    SetActionButtons(eGA_LookAt, "a_button_look_at 4  134  147 Ss");
    SetActionButtons(eGA_Push,   "a_button_push    5  131  144 Dd");
    SetActionButtons(eGA_Close,  "a_button_close   6  133  146 Zz");
    SetActionButtons(eGA_TalkTo, "a_button_talk_to 7  130  143 Xx");
    SetActionButtons(eGA_Pull,   "a_button_pull    8  135  148 Cc"); 
    }
    else
    {
      btnMainBack.NormalGraphic=2184;
      SetActionButtons(eGA_GiveTo, "a_button_give    0  2220  2221 Qq");
    SetActionButtons(eGA_PickUp, "a_button_pick_up 1  2226  2227 Ww");
    SetActionButtons(eGA_Use,    "a_button_use     2  127  140 Ee");
    SetActionButtons(eGA_Open,   "a_button_open    3  129  142 Aa");
    SetActionButtons(eGA_LookAt, "a_button_look_at 4  134  147 Ss");
    SetActionButtons(eGA_Push,   "a_button_push    5  131  144 Dd");
    SetActionButtons(eGA_Close,  "a_button_close   6  133  146 Zz");
    SetActionButtons(eGA_TalkTo, "a_button_talk_to 7  130  143 Xx");
    SetActionButtons(eGA_Pull,   "a_button_pull    8  135  148 Cc"); 
    }
  }

some images are the same but the goal is to change all the button with different images when flashback variable changes.
After that we called the function inside a room load.
(p.s. we made a workaround reassigning the images first with an external function and the calling adjustlanguage, but if it's possible i would like to do it in a better way cause for all possible languages it's a bit frustrating :) )

rmonic79

forcing with mainInv.characterToUse seems to works fine THKS! :)

abstauber

Good to hear, I ditch the test case then :)
As for the other problem: instead of calling AdjustLanguage() inside room_load, try
Code: ags
InitGuiLanguage()
This calls also AdjustLanguage but also assigns all button images immediately.

rmonic79

it gives me unresolved import initguilanguage. in the header file of the guiscript there is the function imported but in the .asc the function doesn't exist. Maybe i have an older version?

SMF spam blocked by CleanTalk