Inform 7 Home Page / Documentation

§27.7. Extensions and story file formats

Inform compiles to several different story file formats, and in each case uses only a small part of their abilities - especially when it comes to fancy tricks with the keyboard or screen. So people may well want to write extensions which provide access to some of these tricks (like "Basic Screen Effects", included in the standard Inform distribution, but more so). Unfortunately, these tricks are very likely to fail to compile - or fail to work - on some of the possible story file formats, so the resulting extension would probably go wrong (and mysteriously wrong) for users who have chosen a different format.

Inform therefore provides a way for extensions to declare the formats they are compatible with. All that is required is to add a proviso in brackets after the title is declared:

Version 2 of Basic Screen Effects (for Z-Machine version 8 only) by Emily Short begins here.

Other examples might be "(for Glulx only)", or "(for Z-machine only)". If no such proviso is given, the extension is assumed to be compatible with every story file format.

Extensions are also able to include material which is only used on some story file formats and not others - in principle, this might allow the same facilities to be provided to the author whatever story file format is used, but to achieve these effects differently depending on the current Settings. The convention here is exactly like "not for release": if a heading or subheading in the source text contains a bracketed proviso, then the material under that heading (and under its dependent subheadings) will be ignored if the current story file format does not match. For example:

Section 2.3G (for Glulx only)

To reveal the explosion:
    [...the Glulx way...]

Section 2.3Z (for Z-machine only)

To reveal the explosion:
    [...the Z-machine way...]

would ensure that "reveal the explosion" works nicely whichever story file format is used.

arrow-up.png Start of Chapter 27: Extensions
arrow-left.png Back to §27.6. Version numbering
arrow-right.png Onward to §27.8. Extensions can include other extensions

**ExampleTilt 3
Displaying the card suits from our deck of cards with red and black colored unicode symbols.