Home | AGI Documentation | AGI Tutorials | AGI Tools | AGI Wiki | Community

2.6 Processing Parsing the Player Input

from AGDS docs*
Last updated: 31 August 1997
Retrived from the Internet Archive

* This is from the manual of AGDS (Adventure Game Development Toolkit) which contains a good deal of information about the AGI interpreter and its data formats. Translated from Russian by Vassili Bykov, vbykov@cam.org

NOTE: This is taken from the description of the said command from section 4.3

Here is how the input is matched. After the player types a message and presses Enter, the input line is processed by the interpreter.

  1. Interpreter removes all punctuation marks.
  2. All characters are converted to lowercase.
  3. All sequences of more than one space are replaced with a single space.
  4. Starting with the first word of the input, the interpreter looks up the vocabulary, trying to find the longest character sequence matching the entered.

If the search is unsuccessful, Var(9) is assigned the number of
the word in the message that failed to match and the processing
ends. If all the words have been assigned some codes:

If the sequence of code produced by the interpreter is

V(1), V(2),...V(m).

The test is performed as follows:

If Flag(2) = 0 or Flag(4) = 1, return FALSE.

Compare parameters W(i) and codes V(i) as follows:

Otherwise W(i) should be equal to V(i).

If all elements match, Flag(4) (`said' accepted the user input) is set to
1 and the command returns TRUE. Otherwise, FALSE is returned.

by helping to defray some of the costs of hosting this site. If it has been of help to you, please consider contributing to help keep it online.
Thank you.

© 2013 to present The Sierra Help Pages. All rights reserved. All Sierra games, artwork and music © Sierra.