Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: on Sat 10/04/2004 16:14:57

Title: Trouble using text parser in dialogue
Post by: on Sat 10/04/2004 16:14:57
I'm trying to achieve the effect of having a dialogue between a player and a chatacter, where progress is dependent on the player telling the charatcer the correct password. According to the manual, the game will use the player's typed input to run the function dialog_request in the global script with the parameter being the number of the topic the player is in. So far so good.
The manual also says that, before running this, the game will call ParseText with the input so you can use Said() calls to respond.
This is my entry in the global script function dialog_request:

function dialog_request (int param) {
 if (param == 1) {
   if (character[EGO].inv[3] == 0) {
     RunDialog(11);
     }
   else {
     RunDialog(10);
     }
   }
 else if (param == 9) {
   if (SaidUnknownWord ("44XYZ")) {
     RunDialog(12);
     }
   }
 }

"44XYZ" is the password they need to type and 9 is the number of the topic they type it in.
However, on testing, the game will proceed to Dialog 12 without checking whether the contents of the Unknown Word buffer was the correct password. Does anyone know how to get this to work? I've tried removing the quotes from the 44XYZ but then it won't run at all.

Thanks
Title: Re:Trouble using text parser in dialogue
Post by: on Sat 10/04/2004 16:51:23
It's OK, I've worked it out! I just needed to put the password into the parser's list. I am not smart!   ::)
Title: Re:Trouble using text parser in dialogue
Post by: stuh505 on Sat 10/04/2004 16:59:23
Hello, I am new to AGS but your problem is a simple programming error.

First of all, I'd like to recommend