This is a partial list of things that people ask me frequently in different contexts; it is likely to grow. (Last updated April 2011.)
PLEASE NOTE: This is not a good place to comment with specific coding questions, bug reports, or suggestions for future development. If you want to talk about those things, please go on through to the linked forum.
Is there a full description of syntax for this language? Or: is there a BNF document for Inform 7?
Yes. See the syntax list.
Where should I ask questions about my Inform 7 coding problems?
Are there complete games whose source code I could look at?
How should I structure my code?
In whatever way you’re comfortable with. My personal preference is usually to write general rules about the world model first, then to follow with the actual rooms of the game, and put plot and scene materials (if relevant) towards the end. Your arrangement may be completely different, and to some extent it’s useful to let it be dictated by what kind of game you’re writing. If your game is very geographically structured, it makes sense to arrange your code by region; if it’s very temporally structured, then maybe making one chapter per scene will work better for you.
I’ve written a line in my source text that begins something like “if the player is in the Library, say “Squonk.”” It doesn’t compile! Why not?
Possibly you haven’t made your if-statement part of any specific rule; see the beginning of the Review of Chapter 11 on Phrases.
I’ve written an action to let the player manipulate objects in another room, but I keep getting a “You can’t reach into the Other Room” message.
Try defining your action to apply to visible objects only. See the Advanced Actions chapter on Visible vs. touchable vs. carried.
I’ve defined an action with an understand rule to apply to something preferably carried, but it isn’t generating an implicit take.
You also need to make your action apply to carried objects only. See the Advanced Actions chapter on Visible vs. touchable vs. carried.
I’ve written an action, but it doesn’t seem to fire when I use the command in question.
Compile your game, then type ACTIONS, then issue the command you think should cause your action to occur. This will tell you a) whether you’re generating the right action at all, and b) if so, whether you’re getting stopped by a check rule. If the right action is not occurring, then the problem is probably that you haven’t constructed your understand rules correctly (see the chapter on Understanding); if it is occurring but getting stopped, then maybe the action rules are designed wrong (see Advanced Actions, and also the Index on Actions, which may be able to give you details on the specifics of the action).
TAKE ALL keeps trying to take stuff I don’t want it to.
See the Activities chapter on the rule for deciding what all includes.
Can I7 be used to write games in languages other than English?
Yes: there are now French, Italian, German, and Spanish language extensions available, and other language extensions could be created based on the same model.
Can I7 games be set up to be played over a web browser?
Yes. See here for more details.
Can I7 games be played on handheld devices?
Yes. There are a number of custom Z-machine interpreters for handhelds; see the ifwiki page on interpreters. CellarDoor for PalmOS seems to receive especially rave reviews. CellarDoor also handles Glulx games.
What about the iPhone or iPad?
A version of Frotz is available for iPhones and iPads. It comes bundled with a bunch of IF, and it is also possible to move onto it new games from IFDB. Recent versions can play Glulx games and show at least some graphics, though this functionality is new and may be fragile.
Can I7 games be bundled with executables so the player just has to click to play?
For some platforms. I don’t encourage this in most circumstances, because many modern interpreters are designed to provide an iTunes-like front-end to your IF collection, not to present a single game. However, if you’re determined, see Bundlemonkey.
Does I7 support multimedia (sounds, images, etc.)?
Inform permits the creation of Glulx games with illustrations either in the main text window or in a separate window; the creation of short animations in a separate window display; the playing of sounds in AIFF and Ogg Vorbis; the use of hyperlinks; and mouse input accepted in a graphical window, which means that you can design something like a clickable compass rose. There are limitations in what the interpreter built into each application will do, currently: though you can export a mouse-using Glulx file from Windows Inform, hyperlinks and mouse input don’t work in the built-in terp, while Mac Inform does not correctly play sounds from the built-in interpreter. Work is still being done here.
Those using these features may be interested in the extensions on the Inform 7 extensions page listed under “Screen Display”.
If these extensions don’t cover all you want to do, you may have to branch out and code your special interface using inclusions of Inform 6; see Adam Cadre’s Gull guide for more on what is possible in this line. It may also help to look at the existing Glulx extensions in order to get an idea of how they hook into the existing system.
Does Inform 7 support real-time games?
There’s no built-in syntax to do this, but both the z-machine and Glulx are capable of real-time behavior, and there are extensions to help access this functionality. Timed events may not yet be fully supported by the Glulx interpreter in the Windows application, but this might be possible to solve by outputting the game and trying it in another interpreter.
Could Inform 7 be used to build multi-player games, or to program a MUD?
Could Inform 7 be used to write graphical adventures?
Maybe, in a totally painful way: using the GLIMMR extensions, it would be possible to layer sprites in a visual environment in a Glulx window, while suppressing the parser and directing input through mouse clicks. But why in the world would you want to do this? I7 is designed for a different domain; while it does have some multimedia abilities, it’s really not ideally adapted for graphical input and output. If that’s what you want to write, I recommend looking into something like Ren’Py (for visual novels) or SLUDGE (for full-on graphical adventure games). Both of those skip over all the parser business that I7 spends so much time on, but do provide extensive facilities for placing and handling images.
Could Inform 7 games be displayed with an alternative interface, say in Flash?
Not easily in Flash itself, but there’s some progress towards prototypes that would allow for substantially different front ends.
David Cornelson’s Textfyre company has created its own Glulx interpreter with a different approach to I/O, some version of which is likely to be made available for non-commercial use by the IF community. Information on FyreVM is available here: it would allow a Glulx game to be combined with UI components in Flash or other programming platforms.
You may also be interested in the (unfinished, not yet usable) Vorple project.
Does I7 allow you to manipulate external files or read external URLs?
Yes, and sort of, respectively. Though there is no built-in browsing capacity, I7 can write out and read in files; if it is running on a machine with an accompanying script (for instance), the script can write requested information to a file that the game can then load. See the chapter on Figures, Sounds, and Files.
Specific coding questions
How do I change the default messages? Or: how do I use first or third person responses, or past tense, in my library messages?
A light-weight way is to remove or change the rules that generate responses to specific actions. This is best if you just want to change a handful of responses.
Sometimes people also want to change the tone of the entire library, though, or — as mentioned in the question — use a different person or tense. If so, see Ron Newcomb’s library messages extensions on the extensions page.
How do I suppress the description of an object which is on a scenery supporter during a room description? Inform keeps printing “On the table you see…”, but I’d rather mention the object differently or not at all.
See the activities pertaining to printing the description of a locale.
How do I model a…
As a first resort, check out the “Recipe Book” section of the Index, which lists a lot of common IF objects and situations and gives examples of how to solve them. If that fails, you may also want to look at the Inform 7 extensions page, which contains a bunch of downloadable libraries that you could easily plug in and use. If that doesn’t cover your needs, you could ask for coding suggestions from the rec.arts.int-fiction newsgroup.
How do I change room descriptions, make a room appear differently the first time it’s entered, change the way a list of objects is presented, or hide objects in a room?
There are lots of ways; see the “Looking” section of the Recipe Book for a detailed breakdown of the problem.
You can also replace Inform 7’s existing room description system with one provided by my extension Room Description Control. This gives the author a lot of more-detailed control over the way room descriptions work, but may be overkill for most applications.
What’s the best way to code a non-player character for conversation?
That really depends on the kind of game you’re writing and the kind of interaction you have in mind. The Recipe Book provides a bunch of options exactly because there isn’t a single best answer.
How do I pause the game, wait for a keystroke, change the color of the screen or letters, or make major changes to the status line?
Several extensions come included with Inform to help with these sorts of things. To find out how to use them, look in the Installed Extensions section and then read their individual documentation. Basic Screen Effects and Glulx Text Effects handle many kinds of lettering issues; the Unicode extensions provide support for a wide range of glyphs; Punctuation Removal and Case Management do small but sometimes useful tasks with the player’s input and game output. There is also a menu system and a sample help menu extension to go with it, if you want to offer your player a menu of instructions for playing IF.
How do I erase text that has already been printed to the screen?
Sorry, you can’t do this selectively. You can use Basic Screen Effects to clear an entire window, but you can’t remove just a word or paragraph at will.
How can I create a dispenser that gives out a large number of identical objects? Does Inform support dynamic object creation?
Inform does not by default support dynamic object creation, for reasons to do with the structure of the z-machine. You can, however, create a large stash of identical objects and move them into play. See the Recipe Book section on “Dispensers and Supplies of Small Objects” in the Physics chapter.
In Glulx, you have another option: Jesse McGrew’s Dynamic Objects extension, available from the extensions page. See the extension documentation for details.
What’s the best way to make an object that the player can’t see or refer to until he’s examined something else in a room?
Create the object off-stage — that is, don’t give it a location at all. Then move it to the location when the player first examines what he’s supposed to examine.
Permissions and Licensing
Can I use code from the Manual examples in my own game?
Absolutely. That’s what it is there for. Feel free to copy and adapt as you like.
Can I use extensions in commercial works?
Yes. They’re listed under a Creative Commons attribution license, which is the least restrictive license Creative Commons offers; this means that you are only required to credit their authors. See the Creative Commons page for more on these.
Why isn’t Inform 7 open-source? Is the source going to be released? When?
This is discussed somewhat in the January ’07 thread about where Inform is going.