Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: joelphilippage on Mon 24/12/2007 20:47:26

Title: Question about List Boxes
Post by: joelphilippage on Mon 24/12/2007 20:47:26
I am trying to make a gui with a listbox in it that will act as a global dialog system. This is the code I have.
function ListBox1_OnSelectionChanged(GUIControl *control){            //
  //////////////////////////////////////////////////////////////////////
  if(GetGlobalInt(3)==true){
    //
if(ListBox1.SelectedIndex == 0){
  cEgo.Say("Do you know any songs this crowd might like?");
  Clear();
  }
 
  }
}

I'm trying to get it so that if you select the first option the character will say that. For some reason he doesn't say anything. I already set the selection to -1.
Title: Re: Question about List Boxes
Post by: .M.M. on Tue 25/12/2007 20:28:24
Why you aren't using AGS dialog system???
Title: Re: Question about List Boxes
Post by: joelphilippage on Tue 25/12/2007 20:42:27
I also want this to be available for interactions with objects and be able to combine them. More like a Discworld Noir Notebook.
Title: Re: Question about List Boxes
Post by: GarageGothic on Tue 25/12/2007 21:24:26
Well, first of all, shouldn't "Clear();" be "ListBox1.Clear();"? Second, have you tried putting some Display commands in to see how much of the function is run? For instance, is GlobalInt 3 in fact set to true?

I'm also wondering if the GUI is pop-up modal, and whether this would keep the Say action from running. Maybe you should try closing the GUI before the Say command and see what happens?
Title: Re: Question about List Boxes
Post by: joelphilippage on Tue 25/12/2007 21:30:30
I can't believe I missed that. I should have put:
if(GetGloabal Int(3) == 1){
Thanks for pointing that out. It works great now.