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.
Why you aren't using AGS dialog system???
I also want this to be available for interactions with objects and be able to combine them. More like a Discworld Noir Notebook.
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?
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.