Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: magintz on Thu 24/07/2003 18:18:15

Title: Custom Input Box for search
Post by: magintz on Thu 24/07/2003 18:18:15
I'm trying to use a sort of search engine in my game. I do not want to use the default one, but a simple one with a text box, go button, and quit button, but nothing seems to want to work.

if (interface == PARSER) {
 if (button == 2) {
   if (GetTextBoxText(7,0,input)) {
      if (StrCaseComp(input, "llama")==0) {Display("YAY");}
       else {Display("NAY");}}}
   
 else if (button == 3)
   NewRoom(2);
   GUIOff(PARSER);
   

}}

can someone help me get ti to work?
Title: Re:Custom Input Box for search
Post by: SSH on Thu 24/07/2003 18:39:43
Assuming that PARSER is GUI 7 and your textbox is object 0, and this code is in interface_click with all the other numbers etc. correct, it looks fine to me.

But then I haven't done much with GUIs myself...
Title: Re:Custom Input Box for search
Post by: magintz on Thu 24/07/2003 18:45:04
QuoteAssuming that PARSER is GUI 7 and your textbox is object 0, and this code is in interface_click with all the other numbers etc. correct, it looks fine to me

Yes PARSER is GUI 7
Yes textbox is object0
Yes the code is in the GUI script section
No it doesn't work
Title: Re:Custom Input Box for search
Post by: magintz on Thu 24/07/2003 19:01:48
I've also now tried

if (interface == 7) {
 if (button == 2) {
   GetTextBoxText(7,0,input);
ParseText(input);
if (Said("llama")) {
 SetTextBoxText(7,0,"");
 Display("YAY");}
}

 else if (button == 3) {
   NewRoom(2);
   GUIOff(7);}
Title: Re:Custom Input Box for search
Post by: MachineElf on Thu 24/07/2003 19:09:42
What, exactly, is it that won't work?
Does none of the buttons work or just not the search button?
Title: Re:Custom Input Box for search
Post by: magintz on Thu 24/07/2003 21:16:57
Neither of the buttons work... I can type stuff in and press the buttons but nothing happens... nothing at all
Title: Re:Custom Input Box for search
Post by: magintz on Thu 24/07/2003 22:03:27
Thats the GUI below... please help :P

http://www.magware.pwp.blueyonder.co.uk/helpme.zip

should be GUI 7 (PARSER)
Title: Re:Custom Input Box for search
Post by: MachineElf on Thu 24/07/2003 22:36:33
Ok, I found your error.
You have a bracket too little just before if (interface == PARSER) and one too many in the end of the script.
Title: Re:Custom Input Box for search
Post by: magintz on Fri 25/07/2003 09:40:48
Thanks... why does it always have to be such a simple mistake :@(

I'm now getting a problem...

"Error: Said: Supplied word is not in dictionary or is an ignored word

hmm..." - sorted