Updating the I7 Handbook

I’ve concluded that it’s time to update the Inform 7 Handbook. In particular, the discussion of Extensions is seriously out of date.

If there’s anything in the Handbook that you feel needs to be changed (or added), please drop a comment into this thread! Zed has pointed out some problems, but there may be other issues I can tidy up.

In particular, I’m not planning to re-try every single code example, because my I7 chops are seriously rusty and because it would take too long. If there’s any code that doesn’t work, or even any that you’re suspicious may not work (or that you feel could be explained better), I hope you’ll let me know. Thanks!

12 Likes

Jim,

Consider making an Addendum as has been don with I6 DM4. The addendum would be a easy reference to check for additions and changes leaving the original text intact. The Addendum would be easy to modify over time.

It’s a little more complicated than that. The sections on Extensions are seriously wrong and misleading. I’ve downloaded the current raft of Extensions, and the first two I tried compile but they don’t do what they’re supposed to do.

Other than that and fixing a few Web URLs, there’s probably nothing that needs to be changed.

1 Like

Here’s the new material on Extensions, which will replace the old material in the Handbook. Please let me know if you spot any problems with this! (And ignore the indentation in the last code block if that gets mangled; I’m just doing a quick copy/paste here.)

–JA


Extensions for Inform

A number of people in the Inform 7 community (which exists almost entirely on the Internet, though local meet-ups have popped up here and there) have written extensions for Inform. An extension is a file containing code that can be used by authors to do something specific — something that’s not included in the standard version of Inform.

There are extensions for creating tricky kinds of objects, such as liquids and secret doors; for producing smoother and more interesting conversations between the player character (PC) and non-player characters (NPCs); for constructing menus of hints that your players can consult; and for many other purposes.

Extensions are written using the Inform programming language — so technically, an extension can’t do anything you couldn’t do yourself. But most of them were written by experienced Inform users, have been tested and debugged, and come with documentation that tells how to use them. So why spend a week working out how to do something tricky when you can download an extension and have it working in half an hour?

Unfortunately, the situation with respect to extensions has become a bit disorganized and confusing. Some extensions that were written years ago for earlier versions of Inform won’t work in 6L02, 6L38, or 6M62, because they haven’t been updated. If you try to include one, the compiler will issue an error message. Sometimes updating the code in an extension is simple enough that you may be able to do it yourself. (See Appendix B for tips on how to do this.) Or the old extension may be irremediably broken.

It was formerly the case that all extensions could be downloaded from an Extensions page of the Inform 7 website, but that page no longer exists. What’s worse, the Inform IDE provides clickable links to a repository called the Public Library — but while those links still work, the archive in the Public Library is not being maintained. Do not under any circumstances click on any of the blue or purple buttons in the Public Library page! Doing so runs the risk of replacing an extension that works with an older version that doesn’t. Clicking on a button in the Public Library page that says INSTALLED may not be a great idea either; I make no promises.

Currently (as of November 2021) the I7 extensions are to be found on github (GitHub - i7/extensions: Inform 7 extensions -- some may be ready for public use, others may be barely working experiments. Enjoy!). In the right-hand column on that page is a Readme link. The Readme will tell you how to download all of the extensions at once, as a single zip file, and how to install them once you’ve downloaded them.

Once you’ve done that, the documentation for each extension will now be available under the Home button in the Extensions page of the Inform program. You’ll find that the extensions are listed alphabetically by the first name of the author.

And there are so many! How to find what you need? The Public Library page in the IDE lists extensions by category, After finding an item in this list that looks promising, you can go back to the full list by clicking the Home button at the upper right and then locate the item you want.

Before tossing an extension into your work-in-progress, I’d suggest that you try running it in a separate project that you use only for testing. Most extensions have example games that you can load into the Source window by clicking that little square button to the left of the example’s title. When in doubt, I’d suggest that you stick to extensions written by authors who are known to be competent — Emily Short, Eric Eve, Aaron Reed, Andrew Plotkin, Dannii Willis, and perhaps one or two other people. If you can’t find what you need among their contributions, then jam on with whatever strikes your fancy.

If you’re upgrading to Inform 6L38 (or a later version) from an earlier version and you already have some extensions installed, you’ll need to install them using a slightly more complex process. Basically, you need to drag your old folder of extensions off somewhere, so that Inform won’t be able to find it. In Windows, the usual location for this folder is My Documents/Inform. In the MacOS, it will be in the Library folder in your folder in Users (for instance, Users/jimaikin/Library/Inform). However, the MacOS tends to want to hide this Library folder from users. If you can’t find it, open a Terminal window. Type this line and hit Return:

chflags nohidden ~/Library/

This code will make the Library folder show up. Please don’t make any other changes in the Library! Once you’ve deleted the Extensions folder from Library/Inform, you can safely download and install the current library of extensions.

Once the extensions are installed, using one of them in your game is easy. Near the top of your source code, just below the name of the game and the author byline, enter a line like this:

Include Notepad by Jim Aikin.

This format is required: You have to give the name of the author, and you can’t put a comma after the name of the extension.

It’s possible to open extension in a new window in the Inform IDE and edit the code just the way you would any other Inform code. If an extension doesn’t work, you may want to try this, but it’s not something you should do as a matter of course. Until you become an Inform power user, it’s far too easy to create problems that are messy and hard to diagnose by editing an extension. If you want to try editing an extension — for instance, because you think it has a bug in it — make a backup copy of it first by copying the file and pasting it to a new folder on your hard drive. That way, if you don’t get the results you’re expecting, you can restore the original version without needing to download it again.

Some extensions use other extensions. If extension A uses extension B (by including it, as shown above) but extension B has been updated more recently than extension A, extension A may now be broken. In this type of situation, your best bet is to report the problem, either in the intfiction.org forum or directly to the extension author.

Appendix B: Updating Older Extensions

Extensions are an important and convenient way of extending the functionality of Inform 7. Many of them are available, but their reliability is not guaranteed. Some may be out of date and won’t compile with the latest version of Inform. Others may be current but experimental and not yet complete or well tested. At this writing (November 2021), the most current archive of extensions is in a github repository at GitHub - i7/extensions: Inform 7 extensions -- some may be ready for public use, others may be barely working experiments. Enjoy!. You can grab single extensions from there, or consult the Readme (GitHub - i7/extensions: Inform 7 extensions -- some may be ready for public use, others may be barely working experiments. Enjoy!), which will tell you how to download everything at once and install it.

Important: Once you have done this, you must avoid clicking on the blue or purple buttons in the IDE’s Public Library page. The Public Library is dead, and those buttons are more likely to get you in trouble than to help you. They may overwrite an extension that works with an older version that doesn’t.

Some older extensions may work in the latest version of Inform without any changes. With other extensions, the needed changes may be so massive that considerable study may be required. In between these two categories, however, are some extensions that can easily be tidied up. If you see one in the github repository that you think might be useful, feel free to download it, install it by putting it in a folder in your Extensions folder, and give it a try.

One of the issues you may find with older extensions is that certain details of Inform syntax have changed. For instance, the old “change … to” syntax is no longer supported. The new syntax is “now … is”. After opening the extension in the Inform IDE or in the text editor of your choice, use the Find command to find all instances of the word “change” and edit those lines as needed.

Another change is that the word “consider” is no longer used to send the game off to a list of rules in the Standard Rules. The new syntax is “follow”. Again, a quick search-and-replace can deal with this.

The code “if using … option” is another non-functional bit of syntax. Replace this with “if the … option is active”. References to the Inform 6 Library Messages, which take the form “L__M”, no longer work, so you’ll need to replace those with new output messages.

A bigger problem in some extensions is procedural rules. At one time, these were used to bypass normal rules in the Standard Library under certain conditions, but they’re no longer allowed. One way to get around this is to write a new rule that replaces the normal rule, insert it in place of the normal rule, and add the required conditions to it. The handy phrase “do nothing” has the effect of bypassing the rule. Here’s a quick example, not from an extension but from the 2009 edition of this Handbook. The “Dangerous Jewel Box” example in Appendix C originally contained this code:

A procedural rule: if taking gems when the jewel box is dangerous then ignore the announce items from multiple object lists rule.

A procedural rule: if removing gems from the jewel box when the jewel box is dangerous then ignore the announce items from multiple object lists rule.

The idea behind this code, obviously, was to bypass the “announce items from multiple object lists rule” in one specific game situation. Here’s how the same code looks today — a new rule that replaces the old rule, checks the game-specific situation, and says “do nothing” if that’s what’s needed:

This is the new announce items from multiple object lists rule:
	if the current item from the multiple object list is not nothing:
		if taking gems when the jewel box is dangerous:
			do nothing;
		else if removing gems from the jewel box when the jewel box is dangerous:
			do nothing;
		else:
			say "[current item from the multiple object list]: [run paragraph on]"

.

The new announce items from multiple object lists rule is listed instead of the announce items from multiple object lists rule in the action-processing rules.

3 Likes

Spotted a slight typo. In the upgrading paragraph, remove the unnecessary ‘the’ where it says ‘in the MacOS’.

This thread is from 18 months ago. I didn’t end up revising the Handbook at that time, but now that Inform 10 is up and running, I need to get my ass in gear. But that raises a question:

Does anybody really use the Handbook? I’ve seen a few references to it here or there in the forum, and as I look at the Documentation and the Recipe Book I don’t feel the need for a separate Handbook has evaporated. Still, we’re talking about a month or two of dedicated work. If nobody is going to benefit from it, why would I bother?

Here’s a more nuts-and-bolts way of asking the question: If I were to do a Kickstarter or GoFundMe for an updated (and expanded) Handbook, would you sign on? How about if I do a print edition and make it available on Amazon? Would you buy it? Do you think other people might buy it?

5 Likes

Anecdotally, I’ve certainly seen folks mention it in the forum as well, and dunno whether you’re in chat but it comes up there pretty regularly too, so I think it’s the case that folks are using it. Personally I’d probably be able to kick a few bucks into a Kickstarter since I think it’s a helpful resource for the community, though I’m not sure I’d buy a print copy absent that help-get-it-funded impetus (mostly just because I’m pretty firmly in the try-stuff-and-muddle-through phase of the Inform 7 learning curve these days).

4 Likes

I think the value of the thing is in making it freely available. A print edition wouldn’t sell a lot of copies to the people who need it most.

Therefore, the crowdfunded model makes more sense to me. Pre-fund the work, release it when it’s done.

(You could also make a print version available, but again, it’s not going to be a big seller. The print version of the DM4 makes five, maybe ten bucks a month.)

4 Likes

I agree that the Handbook is still very relevant. Once a newcomer has gone through one or two basic introductory tutorials, I think it’s the best thing we have to point them toward.

While a print version would be a nice option, I think a web version would be much more useful overall: it would let you link straight to the docs or other resources or to runnable/modifiable examples of code on snippets.borogove.app. (Of course, having put a lot of effort into webifying I7 docs, I would say that, wouldn’t I.)

I’d sign on to crowdfund a revision.

1 Like

Who would host the html file(s) of the Handbook? I don’t really have a server, though I use my musicwords.net account to make things available.

1 Like

Thanks for the thoughts. I suspect you’re right about the print version being very marginal as a seller. On the other hand, my impression is that a lot of people feel nostalgic about Aaron’s book.

1 Like

It would be great if you were to update your book.

My young daughter and I used it when were were starting out with Inform.

We printed it out via Lulu, for ourselves, and you kindly gave permission to share the link on this forum. It quickly sold 8 copies, and a further 3 since then (all at cost price). But you might get more interest in the context of a Kickstarter project. I’d pay for an updated print version.

I also have Aaron Reed’s Inform book, in print and PDF formats, but haven’t read it yet. I like the idea behind his book, but haven’t had the energy to work through the example game. Also, the consequences of out-of-date code in your book’s snippets seemed easier to deal with.

His Kickstarter pages for the 50 Years book were very persuasive so perhaps he could offer some advice. I agree that it would be best overall for the book to be available free as a website – but for me, PDF format is just as good as HTML, as it’s easier to feel lost on a website. Maybe you could do multiple formats.

3 Likes

Could it just go on the IF Archive somewhere?

2 Likes

That would be one solution, yes. I don’t think it would be the only solution. There may be some other possibilities.

2 Likes

Sure. Or we could have a separate ifarchive subdomain just for this.

(The online DM4 is on the IF Archive machine, although we’re still using the old inform-fiction.org domain for it.)

2 Likes

Github Pages are a solid option too. You can write in Markdown, and you get free web hosting. Or you can just upload HTML files.

2 Likes

To provide my own anecdotal data for this, I just read through version 2.0 of the Handbook a couple of weeks ago, as part of my journey to continue to build on my Inform 7 knowledge. As I’ve been diving into some of my own coding, I’ve found myself frequently referring back to sections in the Handbook.

So, the answer-- for me in any case-- is yes, and also recently so. It’s also been highly relevant and useful in my pursuits even though it was written for 6L38. Adjusting for version 10 has not been a huge issue in my experience.

2 Likes

I do. When I wrote my game for EctoComp last year, I had two references at hand: your Inform 7 Handbook and Aaron Reeds Creating with Inform 7. They both got me through. I would have been unable to complete the game otherwise.

PS. I purchased the hard copy from Hulu. It is very nice. I would definitely be interested in a crowd funded project.

1 Like

When asked, I recommend the Handbook to new authors. I didn’t get a lot out of Inform’s documentation until I had a little experience. I’d personally only be interested in a digital version, since I would refer to it while coding. In any case, I would support a crowdfunding effort out of gratitude for the help I’ve gotten from the Handbook.

4 Likes

Ditto Drew’s comment, It (the handbook) is really how I got started and I’d kick in something as well to see it updated. I also keep it open when I’m coding:)

2 Likes