Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: salbert on Tue 26/05/2020 16:18:43

Title: Does the text parser allow for prepositions and indirect objects?
Post by: salbert on Tue 26/05/2020 16:18:43
For example, say I wanted the player to be able to type something like "Place box on table" or "throw knife at monster". Does it allow for prepositions and indirect objects like that, or is it limited to simple [VERB][NOUN] combinations?
Title: Re: Does the text parser allow for prepositions and indirect objects?
Post by: Khris on Tue 26/05/2020 16:54:11
It can match all that easily, provided that all the words are in the word list.
"on" and "at" are in the ignore list, so if you add "place", "box" and "table", then call this first:
Code (ags) Select
  Parser.ParseText("Place box on table");

the following will all be  true:
Code (ags) Select
  Parser.Said("place anyword anyword")
  Parser.Said("place anyword table")
  Parser.Said("place box table")
Title: Re: Does the text parser allow for prepositions and indirect objects?
Post by: salbert on Tue 26/05/2020 20:21:06
I see. Thanks for the clarification!