Game Development Community

Text/command parsing

by Ed Johnson · in Torque Game Engine · 07/24/2007 (12:11 pm) · 2 replies

I didn't want to hijack Rube's old .plan, so I'm moving this topic here to the forums.

I am interested in creating a very simple text parsing system, reminiscent of Zork or Hugo's house of horrors.. two of my favorite games growing up :)

The creator of Vespers3d (a big inspiration) has given me a couple pointers as to where to get more info on the text parsing language.

I spoke with a couple friends, one of them being Michael Perry who graciously offered to package up some code snippets from a MUD engine he was creating. I have uploaded the files to my webserver here (2kb).

I have extended an invitation to anyone else interested in this to help make it a reality. I am available for collaboration via email and chat (Google Talk, Dream Games Irc, take your pick...) With help we may be able to have enough to submit a resource, and eventually, I'd love to make a simple Adventure Game with this. Hugo3d anyone? :)

#1
07/24/2007 (12:19 pm)
Reading through Michael's code (its pretty short) it seems like a good start. Now to get this base into Torque and extend it to understand the difference between verbs and nouns, and more complex phrases...
#2
07/24/2007 (12:54 pm)
Hey Ed. I am a firm subscriber to the KISS method :) All I did for my commandline parsing was toss a quick getword(1,%string) in the default engine chat message code. I then parsed the result and if it was a command I should respond to I called a specific function and killed the send of the chat message.

I believe in the end I actually whittled (*grin* nice typo heh) the code down to just parse the first char of the chat line and if char $= "/" I stripped out the / did a get word and processed the appropriate functions.

Good luck on your project.