Sign in to follow this  
Schade

Text game strings

Recommended Posts

Hello im working on a text based game. an right now you have choices to pick. But i wanna have it like in zork, N = north an stuff like use nasty knife on evil troll. how you gotta type out a command before it moves on. Thanks

Share this post


Link to post
Share on other sites
You could start off by googling for 'text parser' or 'natural language processing'

Basically, you need to look for recognised words within your text input string, decide which are verbs and which are nouns then take actions upon those.

e.g. If the user enters "take knife" then the action is take, and the object is knife.

It can quickly become much more difficult if you want more than just basic verb-noun inputs though. e.g. "Quickly take the rusty knife then use it to kill the large grue".

Here you will have multiple verbs and nouns, along with other natural language constructs such as adjectives, prepositions and such.

Share this post


Link to post
Share on other sites
Quote:
Original post by OldProgie2
It can quickly become much more difficult if you want more than just basic verb-noun inputs though. e.g. "Quickly take the rusty knife then use it to kill the large grue".


Which is why it's probably best to just use Inform instead.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this