News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

HLA question

Started by Paul Panks, August 20, 2005, 06:22:42 PM

Previous topic - Next topic

Paul Panks

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

Randall Hyde

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