Question about List Boxes

Started by joelphilippage, Mon 24/12/2007 20:47:26

Previous topic - Next topic

joelphilippage

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.
Code: ags
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.



.M.M.

Why you aren't using AGS dialog system???

joelphilippage

I also want this to be available for interactions with objects and be able to combine them. More like a Discworld Noir Notebook.



GarageGothic

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?

joelphilippage

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.



SMF spam blocked by CleanTalk