Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: jamesreg on Sun 13/05/2018 07:16:16

Title: Text Parser Multiple search question.
Post by: jamesreg on Sun 13/05/2018 07:16:16
I am working on a sci-fi game and am using the text parser to add a computer database to the game.
So far this is the way it works. I have it set up if you search a name like say John Smith you can type john, or smith or john Smith etc.
It will pop up a picture and profile of that character the way I want. But say I have a John Williams also and the player typed in John.
Is there anyway to have it show a list of multiple entries matching "John" Then allow you to select which one you want.?
If I could make this work it would add a whole new level to what I am doing.
Title: Re: Text Parser Multiple search question.
Post by: dayowlron on Sun 13/05/2018 12:16:06
You would have to use a listbox or a custom gui. if you want more than the name to show up you would need the custom gui.
Title: Re: Text Parser Multiple search question.
Post by: jamesreg on Sun 13/05/2018 15:29:54
That was to easy lol. Thanks

I figured out how to get it to list multiple entries but how would I go about getting it to now take a selected entry in the listbox and add that text to the text parser box.
Title: Re: Text Parser Multiple search question.
Post by: dayowlron on Sun 13/05/2018 21:46:30
Ideally you would use a List box event to do it, however I don't know if controls have events.
probably in the on_mouse_click function you would set the textbox's text property to be the selected items text is from the listbox.
Not sure how to check if it is the listbox that was clicked on since I have not worked with them much.

if (lstListBox.clicked on)????
    txtTextBox.Text =  lstListBox.Items[lstListBox.SelectedIndex];