SLUDGE Console is a text input engine I developed for SLUDGE. Originally created for text adventure games, I realised after making it portable to include in any SLUDGE game that it was more useful as a console that can be used to change variables and rooms on the fly and add or remove inventory objects, rather than having to keep recompiling the entire game every time I wanted to test something.
Note that SLUDGE Console is not a change to SLUDGE's source code, but rather made up entirely using SLUDGE's built-in functions. This unfortunately means that anything the console can do needs to be manually put into the .SLU files themselves, but it takes only a small amount of effort and could easily save you lots of time debugging your game.
Because it was originally designed as a text engine, SLUDGE Console can be used for that too, allowing you to check for words typed at any position in a sentence, for example, only accepting verbs if they are the first word typed. It will also convert number strings into numerical values automatically.
Here's a list of some of its features:
- Easy to implement - SLUDGE Console was designed specifically to make it as easy as possible to implement into an existing SLUDGE game. All the parts you will need to change yourself are clearly marked with comments and all variables are prefixed with csl_ to prevent clashes (although you may wish to change the names of a few variables that you will use often to something shorter).
- Automatic conversion of strings into numbers and boolean values - SLUDGE console will automatically convert the strings "true" and "false" into boolean values, any typed numbers into numerical values and will also strip any unnecessary punctuation and convert all upper case into lower case. All of this is also done "behind the scenes", so the player sees no difference in what they typed.
- Treats similar words the same - An area of the code is reserved to define similar words to be treated the same, so you don't need to keep checking for either "grab", "take", "get" and "pick up" to trigger the same response, for example.
- Easily defined default behaviour - Another area is reserved specifically to spit out default responses to certain commands the if user failed to give a valid response.
- Word wrapping - SLUDGE doesn't do this to any non-spoken text, so SLUDGE Console handles it for you. This way you don't need to worry about splitting up your strings so they fit.
- Delayed scrolling - Just pasted too much text at once to fit onto the page? SLUDGE Console will only paste one screen's worth of text at a time and will wait for confirmation from the player before continuing so they don't miss anything.
- Text history - Save a number of strings to memory and look back through them at any time by scrolling up and down through previous text.
- Comes fully integrated with the Verb Coin example - A separate copy of the Verb Coin example that comes with the SLUDGE development kit is included with the console fully integrated, so you can implement it into your game even more easily if your game is based off of that example. It also comes with examples on how to set up adding items to the inventory, view and change variables and swap rooms fully implemented too.