I6 Entry Points, Translated

Inform 7 has a different style from Inform 6, and the natural way to arrange something or solve some problem may be different. Translating I6 code literally, or writing I7 while thinking in I6 terms, will probably not get the best out of I7. But the following list is a sort of translation of the appendices of the DM4 into more I7ish form, in case it is useful to I6 users who have trouble finding a well-known feature in Inform 7.

(Last updated Sept. 24, 2007.)


LIBRARY ATTRIBUTES

absent: no direct equivalent; to remove a backdrop from play, say “remove (backdrop) from play.” See “Removing things from play” in the “Change” chapter.

animate: see the person kind, documented in the “Things” chapter and in the Kinds index.

clothing: “wearable”. See the “Things” chapter and the lexicon.

concealed: severely deprecated.

container: see the container kind, documented in “Kinds” in the “Things” chapter and in other ways throughout, and in the Kinds index.

door: now a kind. See the “Things” chapter, especially the chapter on doors, and the Kinds chapter of the index.

edible: still called “edible”. See the “Things” chapter and the lexicon.

enterable: still called “enterable”. See the “Things” chapter and the lexicon.

female: still called “female”. See the “Things” chapter and the lexicon. See also the “woman” kind, in the “Things” chapter and Kinds index.

general: no equivalent. Arbitrary conditions can be defined for objects in order to keep track of their game states, though; see the “Kinds” chapter, especially “New value properties” and “Conditions of things”.

light: rooms may be “lighted”; objects may be “lit”. See “Light and darkness” in the “Things” chapter. By default, all rooms are now lighted unless defined to be dark.

lockable: still called “lockable”. See the “Things” chapter and the lexicon.

locked: still called “locked”. See the “Things” chapter and the lexicon.

male: still called “male”. See the “Things” chapter and the lexicon. See also the “man” kind, in the “Things” chapter and Kinds index.

moved: now called “handled”. See the “Things” chapter and the lexicon.

neuter: still called “neuter”. See the “Things” chapter and the lexicon. See also the “animal” kind, in the “Things” chapter and Kinds index.

open: still called “open”. See the “Things” chapter and the lexicon.

openable: still called “openable”. See the “Things” chapter and the lexicon.

pluralname: plurals can be set for kinds with such phrases as “The plural of ox is oxen”, and plurals for individual objects are automatically concocted by I7. Individual things can be “plural-named” or “singular-named”.

proper: called “proper-named”; the opposite is “improper-named”. See the “Things” chapter and the lexicon.

scenery: still called “scenery”. See the “Things” chapter and the lexicon.

scored: no equivalent. It would be possible to add such a scored property to things and then increase the score with a carry out taking… rule, however. (Note that items that have been taken once already are “handled”.)

static: now called “fixed in place”. See the “Things” chapter and the lexicon.

supporter: see the supporter kind, documented in “Kinds” in the “Things” chapter and in other ways throughout, and in the Kinds index.

switchable: see the “device” kind, documented in “Devices” in the “Things” chapter.

talkable: no direct equivalent.

transparent: still called “transparent”. See the “Things” chapter and the lexicon.

visited: still called “visited”. See the “Things” chapter and the lexicon.

workflag: equivalent to “marked for listing”, but use this very cautiously.

worn: now represented by the “wears” relation. See the “Things” chapter.


LIBRARY PROPERTIES

n_to, s_to, e_to, w_to, …: now established with assertions such as “The Red Room is east of the Blue Room”. See “Rooms and the Map” and “One-way Connections” in “Things”; for pathfinding routines, see “Adjacent rooms and routes through the map” in “Descriptions”.

add_to_scope: for objects intended to be part of, but not within, other objects, use the new “part of” relation: see “Parts of things” in the “Things” chapter, and “Assemblies and Body Parts” in the “Kinds” chapter. For other modifications of scope, see “Deciding the scope of something” in the “Activities” chapter.

after: see After rules, throughout; in particular, throughout the “Basic Actions” and “Advanced Actions” chapters.

article: now called “indefinite article”. See “Articles and proper names” in the “Things” chapter.

articles: no direct equivalent.

before: see Before and Instead of rules, throughout; in particular, throughout the “Basic Actions” and “Advanced Actions” chapters.

cant_go: see “Instead of going nowhere” and associated rules in “Going from, going to” in the “Basic actions” chapter.

capacity: now called carrying capacity. See “Carrying capacity” in the chapter on “Things”.

daemon: irrelevant, since daemons have been abolished. For automated activities, use an every turn rule; see the chapter on “Time” for more information.

describe: no direct equivalent, but for ways to flexibly affect the way things are listed in room descriptions, see the “Writing a paragraph about” activity in the “Activities” chapter.

description: still called “description”. See “Descriptions” in the chapter on “Things”.

door_dir: no direct equivalent; for ways to construct doors, see the “Doors” section of the chapter on “Things”. For ways to check the direction of doors leading to one another, see “Adjacent rooms and routes through the map” in the “Descriptions” chapter, and some shortcuts in the “Facing” extension. (Not included.)

door_to: no direct equivalent; for ways to construct doors, see the “Doors” section of the chapter on “Things”. For ways to check the direction of doors leading to one another, see “Adjacent rooms and routes through the map” in the “Descriptions” chapter, and some shortcuts in the “Facing” extension. (Not included.)

each_turn: no longer associated with objects, but the Every turn rules are consulted every turn when time passes. See “Every turn” in the “Time” chapter.

found_in: see the backdrop kind, in the “Backdrops” section of the “Things” chapter.

grammar: no direct equivalent, but some related effects could be accomplished through judicious use of an after reading a command rule. See “Reading a command” in the “Activities” chapter.

initial: now called “initial appearance”, this is set automatically if we include a phrase in quotation marks after a non-scenery object, as here:

The cardboard box is in the Warehouse. “A tatty cardboard box lies on its side on the floor.”

inside_description: no direct equivalent.

invent: there is a property called “inventory listing” (see “Three descriptions of things” in the “Things” chapter); for more subtle effects that might have required a routine before, see now the “Printing the name of something” activity in the “Activities” chapter.

life: no equivalent; we now write rules about what happens before, instead of, or after doing actions to people, and the separate life category is omitted. If there’s a need for a category of actions relevant to characters, see “Kinds of action” in the “Basic Actions” chapter for a way to define one.

list_together: no direct equivalent, but see the activity for grouping things together. That is, “Grouping together something” in the “Activities” chapter.

name: the name by which something is defined in the source is automatically included in its name property, barring other interference; we may add more with such syntax as “Understand “fish” as the trout”. There are mentions throughout, but see in particular “Understanding values” in the “Understand” chapter, and the following sections.

number: this was always a general-purpose property and now has no equivalent.

orders: no direct equivalent; NPCs now have basic rules by which to carry out actions, just as player characters do. See the “Advanced Actions” chapter, especially those sections about “other people”.

parse_name: replaced by extensive other options for controlling the name of an object; see the chapter on “Understanding”, especially “Context: understanding when”.

plural: no direct equivalent, but see the activity for grouping things together. That is, “Grouping together something” in the “Activities” chapter.

react_after: no direct equivalent, but we may now write rules Before, Instead of, or After doing something “in the presence of” another person or thing. See “In the presence of, and when” in the “Basic Actions” chapter.

react_before: no direct equivalent, but we may now write rules Before, Instead of, or After doing something “in the presence of” another person or thing. See “In the presence of, and when” in the “Basic Actions” chapter.

short_name: it is now possible to set the printed name of something (as in, “the printed name of the box is “the purple box”); more flexibly, the printing the name activity allows for extensive rewriting. See “Printing the name of something” in the “Activities” chapter.

short_name_indef: no equivalent.

time_left: no equivalent; events are no longer tied to objects. See “Future events” in the Time chapter.

time_out: no equivalent; events are no longer tied to objects. See “Future events” in the Time chapter.

when_closed: no equivalent. We recommend using variable text in an object’s initial appearance if something like this is desired. See the “Devices and descriptions” section in the “Things” chapter.

when_open: no equivalent. We recommend using variable text in an object’s initial appearance if something like this is desired. See the “Devices and descriptions” section in the “Things” chapter.

when_on: no equivalent. We recommend using variable text in an object’s initial appearance if something like this is desired. See the “Devices and descriptions” section in the “Things” chapter.

when_off: no equivalent. We recommend using variable text in an object’s initial appearance if something like this is desired. See the “Devices and descriptions” section in the “Things” chapter.

with_key: this is now handled with the unlocking relation, so that we say, for instance, “the blue key unlocks the narrow door”. See “Locks and keys” in the “Things” chapter.


LIBRARY ROUTINES

Quite a few of the parsing routines have no equivalents: some of the same things can now be done more elegantly with Understanding, topics, and After reading a command…. Other parser effects, especially those requiring direct modification of the parse buffer, do not lend themselves very well to natural language handling and may still be done through Inform 6. (Some extensions, Punctuation Removal, Snippetage, and String Buffers, exist to handle the things one most commonly needs to do with the parse buffer.)

Achieved(tasknum): No exact equivalent, but see the achievements scoring example in “Another scoring example” in the Tables chapter.

AfterRoutines(): No need for a call like this.

AllowPushDir(): Make an object “pushable between rooms”; see “Vehicles and pushable things” in the Things chapter.

Banner(): Now an activity called “printing the banner text”; see “Printing the banner text” in the Activities chapter.

ChangePlayer(obj,flag): Can be accomplished simply with “change player to…”;

CommonAncestor(obj1,obj2): no current equivalent.

DictionaryLookup(word,length): no direct equivalent. This kind of work still requires a drop to Inform 6.

GetGNAOfObject(obj): no direct equivalent. This kind of work still requires a drop to Inform 6.

HasLightSource(obj): no direct equivalent.

IndirectlyContains(obj1,obj2): now expressed by the enclosure relation, as in “if the large sack encloses the apple” or “if the apple is enclosed by the large sack”. See “The location of something” in “Things”.

IsSeeThrough(obj): no direct equivalent.

Locale(obj,tx1,tx2): “describe locale for [some object]” (where the object can be a room or an object that contains things).

LoopOverScope(R,actor): no direct equivalent. However, one can repeat running through visible things, for instance.

LTI_Insert(position,character): no direct equivalent, but for mild changes to the parsing buffer, act after reading a command; see “Reading a command” in the “Activities” chapter. For more advanced modification, a drop to I6 is necessary.

MoveFloatingObjects(): this behavior is now carried out by the “move floating objects rule”, which is part of the carry out going rulebook. See the actions index; for more on overriding rules or calling them under new circumstances, see the “Rulebooks” chapter.

NextWord(): no direct equivalent.

NextWordStopped(): no direct equivalent.

NounDomain(o1,o2,type): no direct equivalent, but much that used to require NounDomain can now be accomplished with modified tokens in understand lines. See the entire “Understanding” chapter, but especially “Understanding any, understanding rooms”, where it is possible to change the scope used for parsing specific commands.

ObjectIsUntouchable(obj,flag): now handled by “if (actor) can touch (the item)”, with the rules for determining touchability subject to the reaching inside and reaching outside rulebooks. See “Changing reachability” in the “Advanced Actions” chapter.

OffersLight(obj): no direct equivalent.

ParseToken(tokentype,tokendata): no direct equivalent, but much of this can now be accomplished with modified tokens in understand lines. See the entire “Understanding” chapter.

PlaceInScope(obj): see the activity “deciding the scope of something” in the section “Deciding the scope of something” in the “Activities” chapter.

PlayerTo(obj,flag): can now safely be handled with “move the player to…”.

PronounNotice(obj): no direct equivalent, but see the Plurality extension built into Inform for additional control over the way pronouns are handled, and an I7 wrapper of this function.

PronounValue(pronoun): no direct equivalent.

ScopeWithin(obj): see the activity “deciding the scope of something” in the section “Deciding the scope of something” in the “Activities” chapter.

SetPronoun(pronoun,obj): no direct equivalent, but see the Plurality extension built into Inform for additional control over the way pronouns are handled, and an I7 wrapper of this function.

SetTime(time,rate): can be handled with “change the time of day to…”. See the chapter on “Time” for more information.

StartDaemon(obj): irrelevant, since daemons have been abolished. For automated activities, use an every turn rule; see the chapter on “Time” for more information.

StartTimer(obj,period): irrelevant, though we can now set events to occur in a certain number of turns; see the chapter on “Time”, especially “”, for more information.

StopDaemon(obj): irrelevant, since daemons have been abolished. For automated activities, use an every turn rule; see the chapter on “Time” for more information.

StopTimer(obj): irrelevant, though we can now set events to occur in a certain number of turns; see the chapter on “Time”, especially “”, for more information.

TestScope(obj,actor): now handled by “if (actor) can see (the item)”, with the rules for determining visibility subject to the visibility rulebook. See “Changing visibility” in the “Advanced Actions” chapter.

TryNumber(wordnum): no direct equivalent, but see the explanation of [number] tokens in the “Actions applying to kinds of value” section of the “Understanding” chapter.

UnsignedCompare(a,b): no exact equivalent.

WordAddress(wordnum): no exact equivalent.

WordInProperty(word,obj,prop): no exact equivalent.

WordLength(wordnum): no exact equivalent.

WriteListFrom(obj,st): now called “list the contents of”, with all the original phrase options translated to I7 forms. See in particular “Phrase options” in the chapter on “Phrases”, and the example “Equipment List” attached, which covers all the possibilities more rigorously.

YesOrNo(): now called “if the player consents…”; see the “Conditions and questions” section of the “Phrases” chapter.


LIBRARY MESSAGES

Library messages are not reprinted here; they’re mostly unchanged from what they were in Inform 6. It is possible to override many of them by changing the behavior of actions or various activities; if more is required, see the library message extensions by David Fisher.


ENTRY POINT ROUTINES

AfterLife(): for ways to let the player resume play after a ‘death’, see “When play ends” in the “Time” chapter; for other modifications to post-death events, see the “Printing the player’s obituary” activity in the “Activities” chapter.

AfterPrompt(): see “Reading a command” in the “Activities” chapter.

Amusing(): see “Amusing a victorious player” in the “Activities” chapter.

BeforeParsing(): no direct equivalent, but some similar access is provided in the “Reading a command” activity, documented in the “Activities” chapter.

ChooseObjects(obj,c): this used to do two things: one, determine what would be included in “all”; and second, mess with parser preferences where ambiguities arise. For adjustments to ALL, see “Deciding whether all includes” in the “Activities” chapter. For changes to preferences, see “Does the player mean…” in the “Understanding” chapter.

DarkToDark(): no direct equivalent. (One approach might be to define a new activity and attach it to the I6 entry point; however, this is not built in.)

DeathMessage(): now it is possible to say, for instance, “end the game saying “You have missed the point entirely””. See “When play ends” in the “Time” chapter.

GamePostRoutine(): no exact equivalent, but similar late access can be achieved with the turn sequence rules. See the “Rulebooks” chapter and the Rules index.

GamePreRoutine(): no exact equivalent.

Initialise(): Initialise is no longer required to set the player’s location; now the location will by default be the first room defined in the source, or, if we prefer, a location determined when we say something in the source such as “The player is in the Billiards Room”. Other activities that we might once have done in Initialise can now be added to When play begins: … rules. See “When play begins” in the “Time” chapter.

InScope(): see “Deciding the scope of something” in the “Activities” chapter.

LookRoutine(): no direct equivalent, but it is possible to hook into the carry out looking rulebook as needed. See the actions index for a list of the rules in this rulebook, and the “Rulebooks” chapter for ways to change these rules and add to them.

NewRoom(): no direct equivalent, but it is possible to hook into the carry out looking rulebook as needed. See the actions index for a list of the rules in this rulebook, and the “Rulebooks” chapter for ways to change these rules and add to them.

ParseNoun(obj): no direct equivalent.

ParseNumber(text,n): no direct equivalent.

ParserError(pe): see “Printing a parser error” in the “Activities” chapter and “Understand as a mistake…” in the “Understanding” chapter.

PrintRank(): now handled with a Rankings table, if the author defines one. See “Introducing tables: rankings” in the “Time” chapter.

PrintTaskName(n): no exact equivalent, since FULL SCORE has been removed from the library. But see the achievements scoring example in “Another scoring example” in the Tables chapter.

PrintVerb(v): no direct equivalent, but something similar is possible with the Snippetage extension (not built in).

TimePasses(): now handled by the turn sequence rules. See “Two rulebooks used internally” in the “Rulebooks” chapter, and the Rules index.

UnknownVerb(word): no direct equivalent, but see “Reading a command” in the “Activities” chapter.