The first thing you need to understand about Inform is

In honor of the new year and a recent post by someone just starting out with Inform, I thought it might be interesting to collect some wisdom about how to approach the language as a newcomer (or as someone giving it a second look). What is the first thing that someone should know about Inform? Following are my first attempts:


The first thing you need to understand about Inform is…

  • Inform seems like magic if you’ve never done programming. When you start treating it that way you will quickly learn that it’s not magic, after all. Inform depends on you to communicate to it using certain patterns. You need to learn those patterns. Some of those patterns are about explaining to it how to translate what you type. Once you learn these, it will start to seem like magic again.

  • Inform at first seems silly if you have done programming in other languages. It takes so many words to do such simple things! If you think this is the case, you are thinking on the wrong level. Once you learn enough to make a proper comparison, you will be amazed that it takes so few words to do such complex things.

Please add your own!

13 Likes

This is probably getting a bit old (I say it a lot!), but if you’re coming from a traditional programming language, don’t think of Inform being easier to write. It’s not. You still have to look up the right arguments and types for a given function and all that.

Think of it as being easier to read. Our English-speaking brains are very well-tuned for skimming English. The point of Inform’s English-y syntax is to tap into that ability and make it easier to understand your code when you come back to it years later. (Remember, code is read a lot more than it’s written!)

12 Likes

As a corollary to the point, Inform 7 tends to offer a multitude of ways to solve a given problem. Often, the most idiomatic Inform 7 solution is whatever solution most resembles the problem statement in plain English.

5 Likes

The docs are nonsensically arranged, so don’t feel bad when you search for something in all the right places and don’t find it. Or can’t find the correct search term for it. Make an effort to find it yourself, but go ahead and ask someone to point you to it if you can’t find it.

Same thing with some of the syntax-- some of it makes no sense at all, like my recent struggles with “of the Table of X” and “in the Table of X.” So much of Inform’s syntax does make sense, and then you come across some vagary that makes you feel like beating your head on the table. It’s a mixed bag.

14 Likes

Inform 7 is a programming language.

But if you don’t know how to code, you can still learn Inform. Eventually you will realize that you have been coding for months and it’s not that scary.

(This is also my answer to “The first thing you need to understand about Twine is…”)

EDIT: (Well, almost. The first thing you need to understand about Twine is that it is several programming languages flying in close formation.)

15 Likes

Couple from me:

  1. If something weird is happening, ACTIONS and (especially) RULES are super helpful for diagnosing the issue. ACTIONS will tell you if there’s something wonky about how the player’s input is being parsed, while RULES will indicate where an output issue might be happening. RULES will shoot out a bunch of gobbledegook, but you usually just need to find whatever rule is listed before you get the weird output.

  2. Related to the above, sometimes you’ll realize that the issue stems from something in the Standard Rules. Those are just Inform rules written the same way as the ones you write, so they’re easy to change or work around, but finding them so you can see what they’re up to can sometimes be challenging; you can do this via the Index, but personally I find it easier to go to @Zed’s all-in-one page and CTRL-F my way through.

5 Likes

There are several really important (and lots more moderately important) things you have very little chance of understanding from the official docs alone. Read Jim Aikin’s Inform 7 Handbook. Bookmark a keyword search of IntFiction’s I7 category and use it liberally. Bookmark the I7 Documentation and Resources post. Read the linked-to Useful posts and threads, especially this: most common mistakes for those starting out with I7.

Use the Project Index, which provides a reference to many things you might have expected to be in the documentation.

The docs don’t attempt to convey all of the details of Inform’s default world model. Look to the Standard Rules themselves (that’s the 9.3/6M62 version, but the parts regarding actions are close to unchanged in v10.) and to @OtisTDog’s Standard Rules reference.

Ask for help. Don’t be shy: that thing you’re banging your head against and can’t figure out? It might be one of the things I referred to where there’s no real chance of getting it from the docs. Learn how to ask productive questions, i.e., ones that make it easy for other people to understand what it is you’re after so they can give you a relevant answer. (I had originally said “good” question there, but I changed it so it didn’t sound like some value judgement.) In particular, if some bit of code behavior is stumping you, work at boiling your code down to the simplest, most straightforward example that demonstrates whatever it is that’s vexing you. This’ll tend to be something like the shortest example too, but simple and straightforward are the more important goals. Use a code block to post it – you get one either with the </> icon above the edit box or by putting a line of 3 backticks: ``` above and below it – and copy-paste your example directly into it, so that tabs are preserved and other people will be able to copy it with the copy-to-clipboard icon that appears in the upper right of such code blocks.

Lab is a room.

(You’ll also often find it the case that you’ll solve your own problem during the process of boiling the problem down.)

12 Likes

Inform DOESN’T actually understand English.

I always say Inform doesn’t know what a room is. It doesn’t know what a thing is, but it knows a thing can be in a room. It doesn’t know what east is, but it knows a room can be to the east. It doesn’t know what going is, but it knows you can do it to a room. We are the ones who can assign the outside meanings to these ideas.

14 Likes
  1. Inform makes some quite complicated things almost trivially easy to achieve and other things surprisingly difficult.
  2. That said, it’s a mature language (albeit with its own preferred ways of doing stuff), and if something you think should be easy is proving infuriatingly difficult you’ll likely benefit from taking time out to rethink the problem from a different angle. Possibly what you’re trying to get Inform to do will be- on reflection- either not really necessary to your story or more easily achieved in a different way. Think obliquely, search out examples of what you’re attempting in the docs and Recipe Book, ask for ideas on this forum and most of all don’t fall into the trap of trying to simulate your way out of every problem.
  3. Even quite complicated code can be remarkably concise and easy to understand when read, even to the extent that exquisitely natural forms of expression (so-called syntactic sugar) can hide in plain view the code structures being used. This can be a little frustrating when you’re trying to understand not what something does, but how it does it, so that you can bend something similar to your own purposes. Try searching for a fragment of a similar phrase in the documentation.
  4. On the subject of which, the documentation is like a treasure chest that has been off-loaded after a particularly rough sea-voyage. Almost everything is still contained within it, but it’s a bit higgledy-piggledy and it may take a bit of searching to find that gem you know is in there.
  5. A lot of what has been cast in transit from the documentation can be found in the Index.
  6. But some precious artefacts have definitely gone astray and can now be found scattered across this and other forums, or in the collective consciousness of the Inform community.

Most importantly, nearly everyone on this forum has posed at least one daft question (and in my case, continues to do so). Don’t be shy to ask- you’ll probably get more and faster help here than you wanted or bargained for. And Inform is so vast and nuanced, even regular and longstanding posters here frequently learn (or relearn) something from every newbie question.

11 Likes

This.

I used Inform 7 for about 3 years before switching to TADS, and this was the singular thing that drove me absolutely crazy for all 3 years. All the little phrases that you absolutely need to know for certain cases are just scattered seemingly-randomly around the docs. It would take me 30 minutes to look up anything.

Does anyone know if there’s a resource or website or something that has these listed in one place? The one that sent me up a wall every single time was The printed name of George is "the tall man". which is used to change how a noun appears in-game.

Eventually I committed it to memory.

Also creating custom actions and rules took a bit to really get accustomed to.

11 Likes

Inform isn’t that other programming language/paradigm you’re used to. It’s not object-oriented, in particular!

3 Likes

You’re looking for the Index, which lists all phrases, rules, properties, and so on, but for whatever reason is not available anywhere except in the IDE.

It is useful to have in the IDE, certainly, because that means it can be updated with all the properties and phrases and such that you define in your own source. But it would also be very nice to have a “default” Index available on the web listing everything defined by Basic Inform and the Standard Rules, since that’s most often what people are looking for.

…hm. The Index is all HTML, isn’t it? I wonder how hard it would be to take the Index generated from “test is a room” and put it online. Might try that tonight.

8 Likes

(I actually left Inform 7 around the same time I left Windows, so I’m pretty sure I was using the IDE. There is a very real chance that I failed to figure out what the Index was. Hm.)

Well, I’ve mostly got an online-able version of the Index, but it refers to a lot of images with paths like inform:/doc_images/Beneath.png. The problem is, I can’t find a doc_images/Beneath.png in my Inform files (/usr/local/share/inform7-ide/) or in the source for the Linux IDE or…anywhere. Anyone happen to know where those files are kept?

for v10, inform7/Documentation/doc_images.
for 9.3, in your internal dir under Resources/doc_images.

1 Like

Having tried other languages (but not TADS), by far the best reason I have to use Inform is the abundance of examples.

In Dialog and Adventuron a couple of times I had to reach out to the authors of the systems to ask how to do things and essentially got folklore answers, oral tradition passed down.

Inform has lots of examples.

I learned the most by taking open source games or the example games and copying parts out. My first game Ether was originally all of Emily Short’s Glass copied and pasted and slowly trimmed down. I’ve copied Delightful Wallpaper several times as well.

3 Likes

I had done such a thing, but badly, never cleaning up the things that made it not work on a remote site though it worked locally. So I just fixed that.

9.3/6M62 Project Index

5 Likes

Oh, perfect! That’s exactly the sort of thing I want to be able to look at or link to.

1 Like

Oh, and another thing-

Writing in Inform becomes almost like modelling with slippery clay- in that it’s an endlessly malleable medium with its own aesthetic, sometimes almost sensual pleasures, separate and almost detached from any end product.

And therefore highly addictive.

4 Likes

The organisation (or otherwise, as some would have it) of the documentation is probably the frustration most frequently-voiced by newcomers to Inform.

There’s so much to remember that developing skills in finding one’s way around the docs and Project Index is something that will repay that effort one-hundred-fold.

With regard to your question, the difficulty is that searching the full documentation for “name” is going to throw up a a bewildering number of references, mostly not to do with the printed name property (although as it happens, perhaps by good fortune, it currently appears in the 8th entry in the list).

One way to go about this kind of very open search is to open the thematic index of examples in the documentation recipe book (in the current Windows IDE it’s the link at the bottom of the main index of examples on the right side of the right-hand pane when the documentation is opened), which will then open a list of all the examples (recipes) together with the ‘how to…’ they are intended to demonstrate.

Ctrl-F (or the Mac equivalent) will then allow a search of this list of ‘how tos’ for “name”, which rapidly throws up examples of changing the printed name of something.

EDIT: or, spend a few moments thinking of a narrower search term to avoid wading through a haystack of references in search of your needle: for example narrowing a search of the full documentation to “change the name” or “changing the name” instead of just “name” leads you immediately to the example “Gopher Wood” and

now the printed name of the bearded man is "Japheth";

EDIT2: or, to illustrate another approach and going back to previous comments on the Project Index, opening that and then the summary (Chart) of Kinds, then Ctrl-F “name” leads rapidly to:

object (plural objects)

Matches: value, sayable value
Objects are values intended to simulate physical things: places, people, things, and so on. They come in many kinds. The special value ‘nothing’ is also allowed, and can be used to mean ‘no object at all’.
Usually singular-named not plural-named, improper-named not proper-named.
Usually not ambiguously plural.
Can have printed name (text), printed plural name (text), indefinite article (text), list grouping key (text).

4 Likes