diff --git a/resources/Documentation/Examples/Beachfront.txt b/resources/Documentation/Examples/Beachfront.txt index 3f9afae606..dfcc847cba 100644 --- a/resources/Documentation/Examples/Beachfront.txt +++ b/resources/Documentation/Examples/Beachfront.txt @@ -5,7 +5,7 @@ Index: SEARCHing for an item which moves into play Description: An item that the player can't interact with until they have found it by searching the scenery. For: Z-Machine -^^{SEARCHing for an item which moves into play} +^^{searching+action+} ^^{hiding things: until searched for} Suppose we have our player, a detective, searching for evidence; we don't want them to be able to use this evidence until they have performed the action that reveals it, but after that it should be visible in the room when they look. diff --git a/resources/Documentation/Examples/BeingPeter.txt b/resources/Documentation/Examples/BeingPeter.txt index 1f1ae57baf..94c09b1fd8 100644 --- a/resources/Documentation/Examples/BeingPeter.txt +++ b/resources/Documentation/Examples/BeingPeter.txt @@ -5,7 +5,7 @@ Index: Attitude rules Description: A set of rules determining the attitude a character will take when asked about certain topics. For: Z-Machine -^^{Attitude rules} +^^{rulebooks: outcomes} ^^{default outcome of a rulebook} ^^{|no outcome} Let's say that we're implementing a particularly irrational and volatile character. Some of the time she remains composed; some of the time she reacts with unexpected vehemence for reasons only partly related to what was said. diff --git a/resources/Documentation/Examples/BeingPrepared.txt b/resources/Documentation/Examples/BeingPrepared.txt index 1a1f23a569..56bd3f6fea 100644 --- a/resources/Documentation/Examples/BeingPrepared.txt +++ b/resources/Documentation/Examples/BeingPrepared.txt @@ -5,7 +5,7 @@ Index: Pocket added to every jacket Description: A kind for jackets, which always includes a container called a pocket. For: Z-Machine -^^{Pocket added to every jacket} +^^{assemblies} ^^{things+kind+: parts of} ^^{names: for things created in assemblies} {*}"Being Prepared" diff --git a/resources/Documentation/Examples/BeneathTheSurface.txt b/resources/Documentation/Examples/BeneathTheSurface.txt index fe7b90af9f..8bc3ad5fcf 100644 --- a/resources/Documentation/Examples/BeneathTheSurface.txt +++ b/resources/Documentation/Examples/BeneathTheSurface.txt @@ -5,7 +5,8 @@ Index: Hiding things under other things Description: An "underlying" relation which adds to the world model the idea of objects hidden under other objects. For: Z-Machine -^^{Hiding things under other things} +^^{prepositions, for sentence verbs} ^^{defining: prepositions for relations} ^^{sentence verbs: defining for relations with prepositions} +^^{hiding things: under other things} The standard world model provides for the idea of containers and supporters, but this is not the only way that objects can relate to one another in the real world. Here we try adding the idea of concealment beneath another object: diff --git a/resources/Documentation/Examples/Bogart.txt b/resources/Documentation/Examples/Bogart.txt index bb0fb9fc13..0ed590e93b 100644 --- a/resources/Documentation/Examples/Bogart.txt +++ b/resources/Documentation/Examples/Bogart.txt @@ -6,6 +6,7 @@ Description: Clothing for the player that layers, so that items cannot be taken For: Z-Machine ^^{clothing: layering and regions of the body} +^^{relations: for clothing} We have two things to keep track of with our layering clothing: what currently is covering something else; and what *can* cover something else. This implementation goes for a fairly simple treatment, assuming that each item of clothing will completely conceal those beneath it, and that we are not implementing entire sets of shirts, jackets, etc. But it will do for a demonstration. diff --git a/resources/Documentation/Examples/FelineBehavior.txt b/resources/Documentation/Examples/FelineBehavior.txt index f3a1d1641e..f89f29a5ea 100644 --- a/resources/Documentation/Examples/FelineBehavior.txt +++ b/resources/Documentation/Examples/FelineBehavior.txt @@ -5,7 +5,7 @@ Index: Results of a rule Description: A cat which reacts to whatever items it has handy, returning the result of a rulebook for further processing. For: Z-Machine -^^{Results of a rule} +^^{rulebooks: outcomes} ^^{values: produced by rulebooks} Suppose we have a cat which is supposed to react to (and destroy) the most interesting thing in its environment. There are several ways we could approach this problem, but for the sake of demonstration, let's have it follow a rulebook to figure out which thing it most wants to interact with. We will then return the chosen object as `the object produced by the cat behaviour rules`. diff --git a/resources/Documentation/Examples/Kyoto.txt b/resources/Documentation/Examples/Kyoto.txt index ea42df7cc6..a907835444 100644 --- a/resources/Documentation/Examples/Kyoto.txt +++ b/resources/Documentation/Examples/Kyoto.txt @@ -5,7 +5,7 @@ Index: THROW [something] AT [something] command enhanced Description: Expanding the effects of the ``THROW SOMETHING AT`` something command so that objects do make contact with one another. For: Z-Machine -^^{THROW [something] AT [something] command enhanced} +^^{actions: modifying rules for} ^^{rules: replacing} Suppose we want to expand the function of the existing ``THROW SOMETHING AT`` command so that a thrown object actually does make contact most of the time. A glance at the Actions index tells us that the Throwing it at rulebook currently looks like this: diff --git a/resources/Documentation/Examples/ModelShop.txt b/resources/Documentation/Examples/ModelShop.txt index 733513ee83..f3c5f3a460 100644 --- a/resources/Documentation/Examples/ModelShop.txt +++ b/resources/Documentation/Examples/ModelShop.txt @@ -5,7 +5,8 @@ Index: On/off button for devices Description: An "on/off button" which controls whatever device it is part of. For: Z-Machine -^^{On/off button for devices} +^^{assemblies} ^^{things+kind+: parts of} ^^{names: for things created in assemblies} +^^{devices+kind+: with on/off buttons} Suppose we're particularly mechanically-minded and would like a game in which all of our mechanical devices have buttons to turn them on and off. diff --git a/resources/Documentation/Examples/SwerveLeftSwerveRightOrThinkAboutItAndDie.txt b/resources/Documentation/Examples/SwerveLeftSwerveRightOrThinkAboutItAndDie.txt index 7f457d8d1d..10b78f3e81 100644 --- a/resources/Documentation/Examples/SwerveLeftSwerveRightOrThinkAboutItAndDie.txt +++ b/resources/Documentation/Examples/SwerveLeftSwerveRightOrThinkAboutItAndDie.txt @@ -5,7 +5,7 @@ Index: Marble chute toy Description: Building a marble chute track in which a dropped marble will automatically roll downhill. For: Z-Machine -^^{Marble chute toy} +^^{prepositions, for sentence verbs} ^^{defining: prepositions for relations} ^^{sentence verbs: defining for relations with prepositions} Suppose we have marbles that roll downhill across our map, in a life-size version of one of those marble-chute toys. We might now want to keep track of both compass relationships and which-room-slopes-into-which, so we make a new relation: diff --git a/resources/Documentation/Examples/TheAbolitionOfLove.txt b/resources/Documentation/Examples/TheAbolitionOfLove.txt index 3e95ae7e6a..ff25684209 100644 --- a/resources/Documentation/Examples/TheAbolitionOfLove.txt +++ b/resources/Documentation/Examples/TheAbolitionOfLove.txt @@ -5,7 +5,8 @@ Index: Relations syntax explored Description: A thorough exploration of all the kinds of relations established so far, with the syntax to set and unset them. For: Z-Machine -^^{Relations syntax explored} +^^{relations: defining} ^^{defining: relations} +^^{relations: setting and unsetting} Suppose we are modeling a complex society seething with interpersonal relations of every kind. diff --git a/resources/Documentation/Examples/TheNightBefore.txt b/resources/Documentation/Examples/TheNightBefore.txt index 9366ff8bca..dc98eb42c1 100644 --- a/resources/Documentation/Examples/TheNightBefore.txt +++ b/resources/Documentation/Examples/TheNightBefore.txt @@ -5,7 +5,9 @@ Index: Disambiguating body parts Description: Instructing Inform to prefer different interpretations of ``EXAMINE NOSE``, depending on whether the player is alone, in company, or with Rudolph the Red-nosed Reindeer. For: Z-Machine -^^{Disambiguating body parts} +^^{names: for things created in assemblies} +^^{body parts} +^^{does the player mean+rb+} Suppose that we're going to give every person in the game a nose, but we want references to a nose always to mean the nose of someone *else*, if the player is with one other person. Moreover, on some occasions we're going to be in sight of Rudolph, so actions directed at an unspecified nose should always prefer his. diff --git a/resources/Documentation/Examples/TodayTomorrow.txt b/resources/Documentation/Examples/TodayTomorrow.txt index 37f2a3831a..7119aad0db 100644 --- a/resources/Documentation/Examples/TodayTomorrow.txt +++ b/resources/Documentation/Examples/TodayTomorrow.txt @@ -5,7 +5,8 @@ Index: Concealed pet who would yip at you if it could see you Description: A few notes on "In the presence of" and how it interacts with concealed objects. For: Z-Machine -^^{concealed possessions: pet who would yip at you if it could see you} +^^{concealed possessions: are not in the presence of the player} +^^{|in the presence of: concealed possessions} ^^{|presence of: concealed possessions} Rules about concealment will affect `in the presence of`, too. For instance, suppose we have a man with a pocket pet: diff --git a/resources/Documentation/Examples/UStorIt.txt b/resources/Documentation/Examples/UStorIt.txt index 766bef019f..0a5a6900c5 100644 --- a/resources/Documentation/Examples/UStorIt.txt +++ b/resources/Documentation/Examples/UStorIt.txt @@ -5,7 +5,8 @@ Index: Chest with a supporting lid Description: A "chest" kind which consists of a container which has a lid as a supporter. For: Z-Machine -^^{Chest with a supporting lid} +^^{assemblies} ^^{things+kind+: parts of} +^^{containers+kind+: which can also support things} ^^{supporters+kind+: which can also contain things} Suppose we want to write a game in which there are a number of chests. Each of these chests will be a `container`, but have a lid which is a `supporter`. diff --git a/resources/Documentation/The Recipe Book.md b/resources/Documentation/The Recipe Book.md index 669f694794..1194d2b2cf 100644 --- a/resources/Documentation/The Recipe Book.md +++ b/resources/Documentation/The Recipe Book.md @@ -911,7 +911,7 @@ If that's not enough, we can get a comprehensive view of everything that happens ## Modifying Existing Commands -^^{actions: processing sequence}^^{actions: rules for actions found in rulebooks}^^{rules: for actions found in rulebooks}^^{rulebooks: for actions}^^{before (action)+rb+: in action processing sequence} ^^{rules: before rules}^^{instead of (action)+rb+: in action processing sequence} ^^{rules: instead rules}^^{after (action)+rb+: in action processing sequence} ^^{rules: after rules}^^{check (action)+rb+}^^{carry out (action)+rb+}^^{report (action)+rb+}^^{(instead), to stop the action+sourcepart+}^^{rules: removing}^^{rules: replacing}^^{extensions: Inform 6 template layer}^^{Inform 6 inclusions: Inform 6 template layer}^^{templates, Inform 6 template layer} +^^{actions: processing sequence}^^{actions: rules for actions found in rulebooks}^^{rules: for actions found in rulebooks}^^{rulebooks: for actions}^^{before (action)+rb+: in action processing sequence} ^^{rules: before rules}^^{instead of (action)+rb+: in action processing sequence} ^^{rules: instead rules}^^{after (action)+rb+: in action processing sequence} ^^{rules: after rules}^^{check (action)+rb+}^^{carry out (action)+rb+}^^{report (action)+rb+}^^{(instead), to stop the action+sourcepart+}^^{rules: removing}^^{rules: replacing}^^{extensions: Inform 6 template layer}^^{Inform 6 inclusions: Inform 6 template layer}^^{templates: Inform 6 template layer} Much of the rest of this chapter discusses the behaviour of specific commands in Inform's command library, and how we might change and build on these. This section is instead an overview of the general principles: where and how can one intervene? Whenever we are dealing with actions, the Actions Index is likely to be useful: it lists all the actions currently implemented, whether in our own source or in extensions or the Standard Rules, and lists the rules pertaining to each. @@ -2346,7 +2346,9 @@ Old-school adventures expected their adventurers to die early and die often. [La ## Typography -^^{proportional-spaced text}^^{monospaced text}^^{fonts: fixed-width / variable-width}^^{fonts: italic / bold / roman <-- italics}^^{characters (letters): Unicode (arbitrary symbols)}^^{+to+say "[bold type]"} ^^{+tosay+"[bold type]"}^^{+to+say "[italic type]"} ^^{+tosay+"[italic type]"}^^{+to+say "[roman type]"} ^^{+tosay+"[roman type]"}^^{+to+say "[fixed letter spacing]"} ^^{+tosay+"[fixed letter spacing]"}^^{+to+say "[variable letter spacing]"} ^^{+tosay+"[variable letter spacing]"} +^^{proportional-spaced text}^^{monospaced text}^^{fonts: fixed-width / variable-width}^^{fonts: italic / bold / roman}^^{characters (letters): Unicode (arbitrary symbols)} +^^{+tosay+"[bold type]" --> bold} ^^{+tosay+"[italic type]" --> italic} ^^{+tosay+"[roman type]" --> roman} ^^{+tosay+"[fixed letter spacing]" --> fixed} ^^{+tosay+"[variable letter spacing]" --> variable} + Story files produced by Inform tend not to contain elaborate typographical effects. They would only distract. Like a novel, a classic work of IF is best presented in an elegant but unobtrusive font. Inform does, however, provide for italic and bold-face, and also for a typewriter-style fixed pitch of lettering: "This is an [italic type]italicised[roman type] word." diff --git a/resources/Documentation/Writing with Inform.md b/resources/Documentation/Writing with Inform.md index 3723cdfa6e..56a007b06d 100644 --- a/resources/Documentation/Writing with Inform.md +++ b/resources/Documentation/Writing with Inform.md @@ -3,6 +3,8 @@ ## Preface ^^{Inform 6} +^^{inform-fiction.org+web+} +^^{borogove.app+web+} Welcome to Inform, a design system for interactive fiction based on natural language. @@ -524,6 +526,7 @@ brings about both of these changes. ## Limits and the Settings panel {PM_BadICLIdentifier} {STORYFILES} ^^{limits: of Inform 6 compiler} ^^{limits: of story file} ^^{memory limits} ^^{memory economy+useopt+} ^^{Inform 6} ^^{Z-machine} ^^{Glulx} ^^{virtual machine} ^^{Z-machine: memory limits} ^^{Glulx: memory limits} ^^{virtual machine: memory limits} ^^{use options: catalogue: |memory economy} ^^{use options: catalogue: Inform 6 memory limits} +^^{PunyInform} ^^{Inform 6: PunyInform} No computer has unlimited capacity, and a large, complex project may eventually bump its head against the ceiling. @@ -1962,6 +1965,7 @@ Now we're telling Inform that every time a `colour` is made, a new `person` is a ## Names made in assembly ^^{|called: in creating assemblies} ^^{|every: creating assemblies} ^^{defining: things: using relations} ^^{things+kind+: creating: using relations} ^^{relations: creating things in relation to} +^^{names: for things created in assemblies} ^^{assemblies: names in} Something skated over in the previous section is the question of how Inform gives names to objects (or other values) it creates in an assembly. The standard thing naming combines the names of what's being assembled. For example: @@ -2111,7 +2115,13 @@ And this is because `[river sound]` was substituted with the value of the `river ## How Inform reads quoted text -^^{text substitutions: punctuation} ^^{punctuation: square brackets: text substitutions} ^^{|[ ]: text substitutions} ^^{punctuation: quotation marks: defining texts} ^^{|": defining texts} ^^{punctuation: apostrophe: meaning quotation mark} ^^{|': meaning (")+sourcepart+} ^^{punctuation: full stop: ending sentences with line breaks} ^^{|.: ending sentences with line breaks} ^^{punctuation: exclamation mark, ending sentences} ^^{(!), ending sentences+sourcepart+} ^^{punctuation: question mark, ending sentences} ^^{(?), ending sentences+sourcepart+} ^^{line breaks: produced by sentence-ending punctuation} ^^{+to+say "[']"} ^^{+tosay+"[']"} +^^{text substitutions: punctuation} ^^{punctuation: square brackets: text substitutions} ^^{|[ ]: text substitutions} +^^{punctuation: quotation marks: defining texts} ^^{|": defining texts} ^^{punctuation: apostrophe: meaning quotation mark} ^^{|': meaning (")+sourcepart+} +^^{punctuation: full stop: ending sentences with line breaks} ^^{|.: ending sentences with line breaks} ^^{punctuation: exclamation mark, ending sentences} ^^{(!), ending sentences+sourcepart+} ^^{punctuation: question mark, ending sentences} ^^{(?), ending sentences+sourcepart+} ^^{line breaks: produced by sentence-ending punctuation} +^^{+to+say "[']"} ^^{+tosay+"[']" --> '} +^^{source text: quoted text} +^^{comparisons: of text} ^^{text: comparing} +^^{empty / non-empty+adj+: for texts} ^^{non-empty / empty+adj+: for texts} ^^{text: empty / non-empty+adj+} Text is so fundamental to Inform that the basics had to be covered back in the [The Source Text] chapter, so let's begin this new chapter with a recap. @@ -2691,7 +2701,8 @@ Finally, there are two special sorts of paragraph break for special circumstance ## Text with type styles -^^{proportional-spaced text} ^^{monospaced text} ^^{fonts: fixed-width / variable-width} ^^{fonts: italic / bold / roman} +^^{proportional-spaced text} ^^{monospaced text} ^^{fonts: fixed-width / variable-width <-- variable-width <-- fixed-width} +^^{fonts: italic / bold / roman <-- italics <-- bold <-- roman} Inform does not go in for the use of fonts: a work of IF will be rendered with different fonts on different machines anyway, from tiny personal organisers up to huge workstations. However, it does allow for a modest amount of styling. @@ -2920,7 +2931,7 @@ It is because descriptions are so widely useful that they deserve a chapter of t ## Adjectives and nouns -^^{descriptions (references to things): syntax} ^^{nouns, in descriptions} ^^{adjectives: in descriptions} ^^{quantifiers: existential} ^^{existence: descriptions of any such thing} ^^{pronouns: |something, anything...} ^^{|someone: in descriptions} ^^{|something: in descriptions} ^^{(somewhere), in descriptions+sourcepart+} ^^{(anyone), in descriptions+sourcepart+} ^^{(anything), in descriptions+sourcepart+} ^^{(anywhere), in descriptions+sourcepart+} ^^{(somebody), in descriptions+sourcepart+} ^^{(anybody), in descriptions+sourcepart+} +^^{descriptions (references to things): syntax} ^^{nouns: in descriptions} ^^{adjectives: in descriptions} ^^{quantifiers: existential} ^^{existence: descriptions of any such thing} ^^{pronouns: |something, anything...} ^^{|someone: in descriptions} ^^{|something: in descriptions} ^^{(somewhere), in descriptions+sourcepart+} ^^{(anyone), in descriptions+sourcepart+} ^^{(anything), in descriptions+sourcepart+} ^^{(anywhere), in descriptions+sourcepart+} ^^{(somebody), in descriptions+sourcepart+} ^^{(anybody), in descriptions+sourcepart+} Descriptions can contain a noun, but need not, and can contain any number of adjectives. There can also be so-called determiners, but those tend to say which things matching the description are meant, rather than what it means to match. For example: @@ -5549,7 +5560,7 @@ If this section has a moral (other than the inadvisability of killing a king in ^^{dialogue lines: speaker of} ^^{speaker (- thing)+actvar+} ^^{dialogue lines: narration} ^^{narration (dialogue lines)} ^^{dialogue choices} -^^{|--: for dialogue choices+sourcepart+} +^^{|--: for dialogue choices} ^^{punctuation: double-dash: for dialogue choices} To recap, then, all dialogue material must appear in special _dialogue sections_ in the source text. A section is a dialogue section if its titling line ends with `(dialogue)`. For example: @@ -6683,7 +6694,7 @@ Until the actual moment of performing this, we can't know who exactly will speak ^^{dialogue beats: branches} ^^{dialogue beats: player choices} -^^{|--: for dialogue choices+sourcepart+} +^^{|--: for dialogue choices} ^^{punctuation: double-dash: for dialogue choices} ^^{dialogue choices} ^^{dialogue choices: based on actions} ^^{dialogue choices: automatic} @@ -6693,7 +6704,7 @@ Until the actual moment of performing this, we can't know who exactly will speak ^^{(instead of), in dialogue choices+sourcepart+} ^^{(otherwise), in dialogue choices+sourcepart+} ^^{flow markers} ^^{dialogue beats: flow markers <-- dialogue: sections: flow markers} -^^{(<-), flow marker+sourcepart+} +^^{|<-: flow marker} ^^{(step through), automatic dialogue choice+sourcepart+} ^^{(step through and stop), automatic dialogue choice+sourcepart+} ^^{(cycle through), automatic dialogue choice+sourcepart+} ^^{(shuffle through), automatic dialogue choice+sourcepart+} ^^{(choose randomly), automatic dialogue choice+sourcepart+} A _decision point_ is reached when the director is performing a beat and comes to a run of _choices_. The idea is that the player selects one of these choices, and then dialogue continues down whichever branch is called for. @@ -6863,7 +6874,7 @@ permutation when that completes, and so on ## Dialogue choices -^^{|--: for dialogue choices+sourcepart+} +^^{|--: for dialogue choices} ^^{punctuation: double-dash: for dialogue choices} ^^{dialogue choices} ^^{dialogue choices: as values} ^^{values: dialogue choices as values} ^^{dialogue choices: conditional} @@ -6941,7 +6952,7 @@ than once in the same play-through? ## Flow markers ^^{flow markers} ^^{dialogue beats: flow markers} -^^{(<-), flow marker+sourcepart+} ^^{(->), flow marker+sourcepart+} +^^{|<-: flow marker} ^^{|->: flow marker} ^^{dialogue beats: stopping} ^^{(-> stop), flow marker+sourcepart+ --> stop} ^^{(-> end the story), flow marker+sourcepart+ --> end the story} @@ -7205,7 +7216,9 @@ In the next section we'll see how to give more complicated definitions which, li ## Pattern matching {PM_TokenWithoutOpenBracket} {PM_TokenWithoutCloseBracket} {PM_TokenWithEmptyBrackets} {PM_TokenWithNestedBrackets} {PM_BadTypeIndication} {PM_TokenMisunderstood} {PM_PhraseTooLong} {PM_AdjacentTokens} {PM_SaySlashed} -^^{phrases: phrase parameters} ^^{parameters: of phrases}^^^{parameters <-- arguments} ^^{Inform 6 equivalent: functions with parameters} ^^{pattern matching: phrase definitions} ^^{type-checking: in phrase definitions} ^^{kinds: in phrase parameters} ^^{punctuation: slash: separating synonymous words in phrase definitions} ^^{|/: separating synonymous words in phrase definitions}^^^{punctuation: slash <-- slash} ^^{punctuation: double-dash: optional words in phrase definitions} ^^{|--: optional words in phrase definitions}^^^{punctuation: double-dash <-- double-dash} ^^{punctuation: brackets: for phrase parameters} ^^{|( ): for phrase parameters} +^^{phrases: phrase parameters} ^^{parameters: of phrases}^^^{parameters <-- arguments} ^^{Inform 6 equivalent: functions with parameters} ^^{pattern matching: phrase definitions} ^^{type-checking: in phrase definitions} ^^{kinds: in phrase parameters} ^^{punctuation: slash: separating synonymous words in phrase definitions} ^^{|/: separating synonymous words in phrase definitions}^^^{punctuation: slash <-- slash} +^^{punctuation: double-dash: optional words in phrase definitions} ^^{|--: optional words in phrase definitions}^^^{punctuation: double-dash <-- double-dash} +^^{punctuation: brackets: for phrase parameters} ^^{|( ): for phrase parameters} In this section, let's make the following new phrase: @@ -7475,7 +7488,7 @@ While this syntax is still allowed for the time being, to keep old source text w ## Otherwise {PM_NonCaseInIf} {PM_MisalignedOtherwise} {PM_MisalignedCase} {PM_MisarrangedOtherwise} {PM_DoubleOtherwise} {PM_OtherwiseIfAfterOtherwise} {PM_CaseValueNonConstant} {PM_CaseValueMismatch} {PM_OtherwiseWithoutIf} {PM_OtherwiseInNonIf} -^^{conditions: with (otherwise/else)+sourcepart+} ^^{+to+if (a condition): with (otherwise/else)+sourcepart+} ^^{Inform 6 equivalent: |switch/case} ^^{|--: separating cases+sourcepart+} ^^{abbreviations: chains of equality tests} +^^{conditions: with (otherwise/else)+sourcepart+} ^^{+to+if (a condition): with (otherwise/else)+sourcepart+} ^^{Inform 6 equivalent: |switch/case} ^^{|--: separating cases} ^^{punctuation: double-dash: separating cases} ^^{abbreviations: chains of equality tests} We often need code which does one thing in one circumstance, and another the rest of the time. We could do this like so: @@ -12007,7 +12020,7 @@ These definitions mentioned blankness several times, and that's the topic to cov ## Blank entries -^^{tables: blank entries <-- blank entries in tables} ^^{|--: as a blank table entry+sourcepart+} +^^{tables: blank entries <-- blank entries in tables} ^^{|--: as a blank table entry} ^^{punctuation: double-dash: as a blank table entry} We are allowed to leave certain entries blank (perhaps to be filled in later, perhaps not) by writing `--` instead of the relevant value: @@ -12648,7 +12661,7 @@ The first is actually allowed by Inform, even though it supplies no things at al ## New commands for old grammar {PM_ThreeValuedLine} {PM_TooManyAliases} {PM_TooManyGrammarLines} {PM_GrammarIllFounded} -^^{understand (verb) as (action)+assert+} ^^{understanding: verbs} ^^{understand the command (verb) as (verb)+assert+} ^^{understanding: adding synonyms for verbs} ^^{something+token+} ^^{|with nouns reversed} ^^{reversed nouns, in understanding actions} ^^{nouns, reversed, in understanding actions} ^^{grammar tokens: for kinds of thing} ^^{Actions page of Index panel+ui+} ^^{user interface: Index panel: Actions page} ^^{Index panel+ui+: Actions page} +^^{understand (verb) as (action)+assert+} ^^{understanding: verbs} ^^{understand the command (verb) as (verb)+assert+} ^^{understanding: adding synonyms for verbs} ^^{something+token+} ^^{|with nouns reversed} ^^{reversed nouns, in understanding actions} ^^{nouns: reversed, in understanding actions} ^^{grammar tokens: for kinds of thing} ^^{Actions page of Index panel+ui+} ^^{user interface: Index panel: Actions page} ^^{Index panel+ui+: Actions page} In the photography example, we are providing entirely new grammar for an action not ordinarily built in to Inform. But we often want simply to provide alternative grammar for existing actions, or even to put new interpretations on commands that Inform already recognises. For instance: @@ -15300,7 +15313,8 @@ A rulebook can have any number of variables like this. They behave much like `le ## Success and failure {PM_DefaultOutcomeTwice} {PM_BadDefaultOutcome} -^^{rules: success of rules} ^^{rules: failure of rules} ^^{rulebooks: outcomes} ^^{rulebooks: stopping execution} ^^{success: for rules} ^^{failure: for rules} ^^{+to+stop the action} ^^{+to+continue the action} ^^{(instead), to stop the action+sourcepart+} ^^{default outcome of a rulebook} +^^{rules: success of rules} ^^{rules: failure of rules} ^^{rulebooks: outcomes} ^^{rulebooks: stopping execution} ^^{success: for rules} ^^{failure: for rules} ^^{|no outcome} +^^{+to+stop the action} ^^{+to+continue the action} ^^{(instead), to stop the action+sourcepart+} ^^{default outcome of a rulebook} Though we have blurred over this point so far, each rule must ordinarily end with one of three outcomes: success, failure and neither ("no outcome"). @@ -15378,7 +15392,7 @@ We can test the latest outcome like so: ## Named outcomes {PM_MisplacedRulebookOutcome} {PM_WrongEndToPhrase} {PM_BadOutcomeClarification} {PM_DefaultNamedOutcomeTwice} {PM_DefaultOutcomeAlready} {PM_DuplicateOutcome} {PM_NonOutcomeProperty} -^^{rulebooks: outcomes} ^^{default outcome of a rulebook} +^^{rulebooks: outcomes} ^^{default outcome of a rulebook} ^^{|no outcome} We have seen that the terms "success" and "failure" can be misleading – after all, it might be a good thing for a particular rulebook to "fail". At any rate, these are vague terms, and we don't want to have to remember the conventions used by every rulebook. This is why certain rulebooks have explicitly named outcomes instead. For instance, the `visibility` rules are allowed to have the outcomes: @@ -15415,7 +15429,8 @@ Each named outcome is a value if followed by the word `outcome`, which is how `a ## Rulebooks producing values -^^{rulebooks: outcomes} ^^{values: produced by rulebooks} ^^{rules: success of rules} ^^{success: for rules}^^^{+to+(name of kind) produced by (rule producing values) --> produced by}^^^{+to+(name of kind) produced by (values based rule producing values) for (value) --> produced by} +^^{rulebooks: outcomes} ^^{values: produced by rulebooks} ^^{rules: success of rules} ^^{success: for rules} ^^{|no outcome} +^^^{+to+(name of kind) produced by (rule producing values) --> produced by}^^^{+to+(name of kind) produced by (values based rule producing values) for (value) --> produced by} We have now seen two ways to write the outcome of a rule: as simple success or failure, with more or less explicit phrases like: @@ -17430,7 +17445,8 @@ Finally, it's sometimes useful in an abstract situation to test ## Phrases as values -^^{values: phrases as values} ^^{phrases: as values} ^^{kinds: of phrase} ^^{(->), in phrase kinds+sourcepart+} ^^{phrases: named phrases} ^^{names: of phrases} ^^{(this is), in naming phrases+sourcepart+}^^^{+to+(phrase nothing -> value) applied --> applied}^^^{+to+(phrase value -> value) applied to (value) --> applied to}^^^{+to+(phrase (value, value) -> value) applied to (value) and (value) --> applied to}^^^{+to+(phrase (value, value) -> value) reduction of (list of values) --> applied to}^^^{+to+(phrase (value, value, value) -> value) applied to (value) and (value) and (value) --> applied to} +^^{values: phrases as values} ^^{phrases: as values} ^^{kinds: of phrase} ^^{|->: in phrase kinds} ^^{phrases: named phrases} ^^{names: of phrases} ^^{(this is), in naming phrases+sourcepart+} +^^^{+to+(phrase nothing -> value) applied --> applied}^^^{+to+(phrase value -> value) applied to (value) --> applied to}^^^{+to+(phrase (value, value) -> value) applied to (value) and (value) --> applied to}^^^{+to+(phrase (value, value) -> value) reduction of (list of values) --> applied to}^^^{+to+(phrase (value, value, value) -> value) applied to (value) and (value) and (value) --> applied to} Given any two kinds `K` and `L`, the kind `phrase K -> L` is now a kind. (This is meant to look like a mathematical function arrow.) For example, the phrase defined by @@ -18970,7 +18986,7 @@ Vorple has seen rapid development. In its early days it was included as part of ## Website templates -^^{materials folder: web pages for the story: templates} ^^{templates, for web pages for the story} +^^{materials folder: web pages for the story: templates} ^^{templates: for web pages for the story} Web pages are very idiosyncratic things and Inform will almost certainly not produce exactly what we want. What it actually does is to take an existing "template" web page, and paste in the relevant information to make the final product. So by starting with a different template, we can end up with an entirely different-looking web page: like this one, for instance – @@ -19020,7 +19036,7 @@ This is not the place to describe how CSS works. CSS is a more or less universal ## Advanced website templates -^^{materials folder: web pages for the story: templates} ^^{templates, for web pages for the story} +^^{materials folder: web pages for the story: templates} ^^{templates: for web pages for the story} The following describes how Inform uses the extras file and the two HTML pages in a template, and will only be needed if a new template has to make changes so radical that altering the CSS alone won't be enough. @@ -20383,7 +20399,9 @@ Note that this is in a subdirectory of ```Figures```, with the same name as that ## Use options for extensions -^^{use options: defining in extensions} ^^{use options: active / inactive+adj+} ^^{active / inactive (use option)+adj+} ^^{inactive / active (use option)+adj+} +^^{use options: defining in extensions} +^^{use options: active / inactive+adj+} ^^{active / inactive (use option)+adj+} ^^{inactive / active (use option)+adj+} +^^{numerical value of (U - use option) ... number+phr+} Extensions should ideally cater for a range of possible uses, and one way to do that is to provide use options. We have seen many of these already, such as: @@ -20933,6 +20951,7 @@ A small technical caveat: Inform-flavoured Markdown does not allow level 1 (Chap ^^{bold: in extension documentation} ^^{strikethrough: in extension documentation} ^^{backticks: in extension documentation} +^^{fonts: in extension documentation} Three textual effects are available: @@ -21682,7 +21701,7 @@ The full list of legal options is given below, though users will rarely if ever The documentation for an extension can have an index much like the alphabetical index to _Writing with Inform_. This will really only be needed if the extension is a large one with a great deal of documentation to cover, of course. But by using the special marking-up features below, an extension's author can make Inform automatically generate an index page as part of its documentation set. -Standard Markdown notation does not provide indexing features, so the conventions below are an extension to regular Markdown. (They are actually borrowed from notations originally devised by Donald Knuth for indexing TeX's manual, _The TeXBook_.) For example: +Standard Markdown notation does not provide indexing features, so the conventions below are an extension to regular Markdown. (They are actually borrowed from notations originally devised by ^{@Donald Knuth} for indexing TeX's manual, _The TeXBook_.) For example: ``` code The ^{catalogue} of ^{@Roger S. Brody} lists three variants.^^{misprints} @@ -21933,7 +21952,10 @@ This is only likely to be helpful for the main Inform documentation, not for ext ## The architecture of Inform -^^{architecture of Inform} ^^{Inter code} ^^{I6: syntax} ^^{I6: not quite the same as Inform 6} ^^{Inform 6: not quite the same as I6} ^^{extensions: Inform 6 code in extensions} +^^{architecture of Inform} ^^{Inter code} +^^{I6: syntax} ^^{I6: not quite the same as Inform 6} ^^{Inform 6: not quite the same as I6} ^^{inform-fiction.org+web+} +^^{extensions: Inform 6 code in extensions} +^^{I6 <-- Inform 6} ^^^{Inform 6 <-- I6} Inside the Inform applications is a _compiler_, which turns source text which describes a story into a computer program which runs that story — or else, of course, refuses and issues Problem messages. @@ -21995,7 +22017,8 @@ This is the first of two chapters about how to use I6 within Inform. In this cha ## Defining To phrases with I6 {PM_UnendingI6} {PM_InlineTooLong} {PM_InlineRule} {PM_BadInlineExpansion} {PM_BadInlineTag} -^^{I6: syntax: phrases} ^^{phrases: defining in I6} ^^{((- -)), for writing I6 in source text+sourcepart+} ^^{punctuation: curly braces: used in I6 definitions of phrases+sourcepart+} ^^{|{ \}: used in I6 definitions of phrases} +^^{I6: syntax: phrases} ^^{phrases: defining in I6} +^^{((- -)), for writing I6 in source text+sourcepart+ --> (} ^^{punctuation: curly braces: used in I6 definitions of phrases+sourcepart+} ^^{|{ \}: used in I6 definitions of phrases} The phrases described in this book all have definitions given in the extensions automatically included with all projects — `Basic Inform`, the `Standard Rules` or, in a few cases, `English Language`. Those phrases are mostly, though not universally, defined using I6 notation, using the feature described below. @@ -22493,7 +22516,8 @@ The escape `*1` is expanded to the value on which the adjective is being tested. ## Inform values from I6 {PM_TranslatesNonAction} {PM_TranslatesActionAlready} {PM_TranslatedTwice} {PM_TranslatedUnknownCategory} {PM_TranslatedToNonIdentifier} {PM_NonPropertyTranslated} {PM_NonQuantityTranslated} {PM_QuantityTranslatedAlready} -^^{accessible to Inter as...+assert+} ^^{Inter code: accessible to Inter as...+assert+} ^^{properties: making accessible to I6} ^^{actions: making accessible to I6} ^^{objects: making accessible to I6} ^^{kinds: making accessible to I6} ^^{activities: making accessible to I6} ^^{((+ +)), for including Inform 7 code in I6+sourcepart+} +^^{accessible to Inter as...+assert+} ^^{Inter code: accessible to Inter as...+assert+} ^^{properties: making accessible to I6} ^^{actions: making accessible to I6} ^^{objects: making accessible to I6} ^^{kinds: making accessible to I6} ^^{activities: making accessible to I6} +^^{((+ +)), for including Inform 7 code in I6+sourcepart+ --> (} What if an I6-written definition needs to access something defined in the source text? For suppose, if the source text says: