The MASM Forum Archive 2004 to 2012

Project Support Forums => HLA Forum => Topic started by: Paul Panks on August 20, 2005, 06:22:42 PM

Title: HLA question
Post by: Paul Panks on August 20, 2005, 06:22:42 PM
I'm trying to add the following to HLA Adventure:

When the user types stuff like "examine tree", "examine logs", "examine forest", "examine <whatever>" the game then should respond like the following:

You examine the object for awhile, but determine it has no use for you.
Inanimate objects such as the logs on a fire, or the leaves of a tree, while interesting to you, serve no purpose beyond visual scenery.

How do I add this? I'm using str.index.

Paul
Title: Re: HLA question
Post by: Randall Hyde on August 23, 2005, 07:36:26 PM
Quote from: Paul Panks on August 20, 2005, 06:22:42 PM
I'm trying to add the following to HLA Adventure:

When the user types stuff like "examine tree", "examine logs", "examine forest", "examine <whatever>" the game then should respond like the following:

You examine the object for awhile, but determine it has no use for you.
Inanimate objects such as the logs on a fire, or the leaves of a tree, while interesting to you, serve no purpose beyond visual scenery.

How do I add this? I'm using str.index.

Paul


Look up str.tokenize and use that instead. It breaks a string up into the consitutent words that make up the string, and then you can run through various algorithms (e.g., the HLA table facilities) to match the individual words. The AGE (HLA Adventure Game Engine) system uses this technique.
Cheers,
Randy Hyde