Hello again. I wanted to share something I’ve been working on: a collection of extensions for the Inform 6 Standard Library.
A handful of you long-timers might remember the “ORLibrary” from when I6 was relatively new. A couple of years ago I ran across this post: Onyx Ring library v1.3C (2004.06.08)? and it inspired me to bring my library in line with the latest version of I6. I removed extensions with functionality now included in the Standard Library, tweaked it to take advantage of I6 features which didn’t exist when it was first created, and added a few extensions I always thought should be there. It’s been refactored a lot so code written against previous versions will need updating. To my eyes, seen through “I’ve-just-achieved-a-milestone” spectacles, the update looks shiny and new, but until now it’s had limited eyes on it so may be rougher than I expect. As such, I’m hedging my bets and considering this a “public beta”, but I have successfully produced an IFComp game using it, revised some previous works with it, and generated more than a hundred unit tests to help protect against regression, so this version has at least some measure of maturity.
Here’s a quick sampling of what the orLibrary is (and is not):
First, the orLibrary is not a replacement for the Standard Library, like Puny Inform or Platypus. This is a common misconception, owing in part to its “library” name. It can also feel like an alternative foundational library, depending on how much of it you choose to leverage.
It is a collection of opt-in extensions, designed to work together, which enhance the Standard Library. Once you’ve downloaded it, you can snap the framework into an existing WIP in 60 seconds or less, then begin picking and choosing the extensions you want to include in your project. The Z-machine and GLULX targets are both supported.
There are dozens of extensions. Some are deep and rich; others basic and convenient. Here’s a small sampling of things they bring to the table:
- Objects can be both containers and supporters and more. New forms of “containment” are easy to create, resulting in game text like:
There is a cubby here (on which is a book, in which is a lunch box, under which is a pair of shoes).
- You can define new state qualifiers:
On the table is a box (which is closed and glowing an eerie green).
- You can consolidate the output from multi-object verbs:
> take all rocks
5 rocks: Taken.
- You can declare inline styles and with text substitution and automatic noun-verb conjugation, honoring the narrative tense and person your game is written in:
orPrint("~$b;Don’t$n let the $i;man$n get you down!~ $the:actor(cry).");
“Don’t let the man get you down!” the ogre cries.
- You can use malleable string objects, enabling things like:
str = orStr.new("Dance a little jig.");
str.replace("Dance", "do").replace("a little j", "p").prepend("That’ll ")).print();
That’ll do pig.
It includes menus, queued player actions, autonomous NPCs, a framework to add implicit commands, a “Swiss Army Knife” of utilities, and quite a bit more.
The orLibrary User’s Guide attempts to adequately cover extensions which are likely to be useful to game authors while skimming over the more esoteric extensions likely to be used only by extension authors or “library hackers”. While dwarfed by the DM4, orLUG is still not tiny and has benefited from a few proof-readers. The easiest way to view it is via this free online viewer (it may take a few seconds to load) or to directly download it from GitHub. You can also just navigate to the project repository and get it from the “_extras” folder.
I also want to extend a tremendous thank you to @otistdog who spent a serious amount of time proofreading the orLUG and offering suggestions which would make the library itself more useful.
Anyway, please excuse the long post; I hope those still writing in traditional Inform will find this project useful.
Thanks.
Jim
