You are on page 1of 6

InfoLib

•• User-defined constants •••••••••••••• •• Library variables •••••••••••••••••••
Some constants control features rather than represent values. action
AMUSING_PROVIDED The current action.
at your fingertips Activates the Amusing entry_point. actor
A quick reference to the DEATH_MENTION_UNDO The target of an instruction: the player, or an NPC.
Inform Library
Offers “UNDO the last move” when the game is over. deadflag
Inform is copyright © 2002 by Graham Nelson Normally 0: 1 indicates a regular death, 2 indicates that
http://www.gnelson.demon.co.uk/ DEBUG
Activates the debug commands. the player has won, 3 or more denotes a user-defined end.
This guide is copyright © 2002 by Roger Firth
http://www.firthworks.com/roger/ Headline = "string " inventory_stage

Version 1.5 (March 2002) Mandatory: the game style, copyright information, etc. Used by invent and list_together properties.
MANUAL_PRONOUNS keep_silent
Pronouns reflect only objects mentioned by the player. Normally false; true makes most group 2 actions silent.
The road to brevity is via solecism and through imprecision
– refer to the Inform Designer’s Manual for the definitive story. MAX_CARRIED = expr location
Maximum number of direct possessions that the player The player’s current room; unless that’s dark, when it
•• Library objects ••••••••••••••••••••• can carry (default 100). contains thedark, real_location contains the room.
compass MAX_SCORE = expr notify_mode
A container object holding the twelve direction objects Maximum game score (default 0). Normally true: false remains silent when score changes.
d_obj e_obj in_obj n_obj ne_obj nw_obj out_obj MAX_TIMERS = expr noun
s_obj se_obj sw_obj u_obj w_obj. The primary focus object for the current action.
Maximum number of active timers/daemons (default 32).
LibraryMessages player
NO_PLACES
If defined (between Includes of Parser and VerbLib), The object acting on behalf of the human player.
The “OBJECTS” and “PLACES” verbs are not allowed.
changes standard library messages: real_location
NUMBER_TASKS = expr
Object LibraryMessages The player’s current room when in the dark.
with before [; Number of scored tasks to be performed (default 1).
action : "string "; OBJECT_SCORE = expr score
action : "string "; For taking a scored object for the first time (default 4). The current score.
action : switch (lm_n) { second
value : "string "; ROOM_SCORE = expr
value : "string ",(a) lm_o,"."; For visiting a scored room for the first time (default 5). The secondary focus object for the current action.
... SACK_OBJECT = object self
} The object which received a message .
... A container object where the game places held objects.
];
(Note: a run-time variable, not a compile-time constant.)
Story = "string "
sender
selfobj Mandatory: the name of the story.
The default player object. Avoid: use instead the player The object which sent a message (or nothing).
TASKS_PROVIDED
variable, which usually refers to selfobj. task_scores
Activates the task scoring system.
thedark A byte array holding scores for the task scoring system.
USE_MODULES
A pseudo-room which becomes the location when there the_time
Activates linking with pre-compiled library modules.
is no light (although the player object is not moved there). The game’s clock, in minutes 0..1439 since midnight.
WITHOUT_DIRECTIONS
turns
De-activates standard compass directions (bar “IN” and
•• Library constants ••••••••••••••••••• The game’s turn counter.
“OUT”). Place alternative directions in the compass.
In addition to the standard constants true (1), false (0) and wn
nothing (0), the Library defines NULL (–1) for an action, The input stream word number, counting from 1.
property or pronoun whose current value is undefined.
1 1

ScopeWithin(object ) CONCEAL_BIT. Returns the object to which 'it' (or 'him'. IsSeeThrough(object ) PronounValue('pronoun ') WriteListFrom(object. room descriptions include “(as object)”. newline unless optional flag is true). that defines the scope. initialising its time_left to A scored task has been achieved. controls output of ‘after’ messages. Returns the type of its arg : 3 for a string address."string1 ". that defines the scope. or nothing.flag ) StopTimer(object ) Banner() Tests if there is a barrier – a container object which is not Stops the object’s timer.. PlayerTo(object. or -1000 if the parse fails. 2 for a Adjusts positions of game’s found_in objects.property is a string.value ) recognising decimals. Returns true if object is currently a child or grand-child PronounNotice(object ) WordLength(expr ) or great-grand-child.expr ) Achieved(expr ) Returns the next dictionary word in the input stream. incrementing wn by one. FULLINV_BIT. SetTime(expr1. 'her'... PlaceInScope(object ) UnsignedCompare(expr1. number. DEFART_BIT. or 0 if not found. running at expr2 (+ve: expr2 minutes pass each turn. Returns false if the word is not Starts the object’s daemon. false for “NO”. ISARE_BIT. open – between player and object. output it (followed by a WordInProperty(word. Returns false if the word is not expr. Player assumes the persona of the object. see also ParseToken(). If the Defines the object to which a given pronoun refers. StartDaemon(object ) incrementing wn by one. NextWord() –ve: -expr2 turns take one minute.property ) Returns true if the object has light. an expr formed by adding any of: ALWAYS_BIT. see also NounDomain(). If Returns true is a barrier is found. otherwise false. property values for the object. Associates an appropriate pronoun with the object. Prints its description unless WordAddress(expr ) GetGNAOfObject(object ) optional flag is 1 (no description) or 2 (as if walked in).property.expr2 ) ZRegion(arg ) MoveFloatingObjects() Sets the_time to expr1 (in mins 0.object2. 0 if expr1 equals Returns address of word in dictionary. Describes the contents of object. Returns the length of word expr in the input stream.type ) StopDaemon(object ) AllowPushDir() Performs object parsing. PARTINV_BIT. Locale(object. in the dictionary. routine address. in the given style. Returns a byte array contains the raw text of word expr in Returns gender-number-animation 0. CommonAncestor(object1. and returns their Used in an add_to_scope property or scope= token to INDENT_BIT. Stops the object’s daemon.. flag is true. TryNumber(expr ) Returns true if the object offers light. put the contents of the object in scope for the parser.object ) it’s a routine. both objects. NounDomain(object1.. Returns the number 1. PrintOrRun(object. optional actor is supplied.1439 since midnight)."string2 ") 'them') currently refers. HasLightSource(object ) If object.length ) Used in an add_to_scope property or scope= token to Returns –1 if expr1 is less than expr2. Returns the next dictionary word in the input stream. TERSE_BIT. 1 for an object number.11 of the object.65535. or 0 otherwise.expr ) Returns true if light can pass through the object. Returns true if the player types “YES”. otherwise false. put the object into scope for the parser.flag ) the input stream. ChangePlayer(object. In a group 2 action.object ) YesOrNo() Calls routine(object) for each object in scope.actor ) Prints the game banner.object2 ) ParseToken(type.. and return true. outputs “You can't because . of the parent_object. is in the way”.twenty. •• Library routines •••••••••••••••••••• NextWordStopped() StartTimer(object. 2 2 . Both DrawStatusLine() expressions are unsigned. WORKFLAG_BIT. also English words one. expr2. If Returns true if the dictionary word is listed in the IndirectlyContains(parent_object. run it and return what the routine returns. After objects with own paragraphs. ENGLISH_BIT.. Starts the object’s timer. the optional actor is supplied. that number of turns have elapsed. If the optional OffersLight(object ) flag is true. or if the input stream is exhausted.. Parses word expr in the input stream as a number.. ObjectIsUntouchable(object. LoopOverScope(routine.flag ) Returns true if the object is in scope. Outputs a list of object and its siblings. Unless the optional TestScope(object. zero: time stands still). or nothing. in the range 0.object.expr2 ) DictionaryLookup(byte_array. Moves the player to object. listed preceded by string1 or string2. the rest are RECURSE_BIT. The object’s time_out property will be called after AfterRoutines() in the dictionary.flag ) Refreshes the status line. and 1 if expr1 is greater than expr2. –1 if the input stream is exhausted.10000. An object can be pushed from one location to another. NEWLINE_BIT. Returns the nearest object which a parental relationship to Performs general parsing.actor ) SetPronoun('pronoun '.

] selfobj has an initial capacity of MAX_CARRIED. StartDaemon(object ) and which then runs once each grammar For a room: receives every action which occurs here. having cases for the appropriate actions (and For an object: called before the object’s description is being addressed. property [. The value can be: a For an object: its description (output by Examine). See d_to. outputting the usual description.. “an” or “some”. . player what has happened. • a string: output to explain why door leads nowhere. For a room: receives every action which occurs here. or a routine which outputs a The value is a routine invoked before the action has or a routine which returns such a property. standalone “]” returns true. e_to property routine The value can be: a number. routine (). For a container or supporter object: the number of • a routine which should return: false. •• Object properties ••••••••••••••••••• cant_go door_to Where the value of a property can be a routine. a string. The value can be: a string. otherwise false. For a door object: the direction in which this door leads. a string. For an object: additional objects which follow it in and out • a door object: the exit leads through this door. unless it has the absent attribute. The value is an array of strings. property [. or true to signify ‘leads nowhere’ without producing For the player: the number which can be carried – any output. after ⊕ daemon • a routine which should return: true if this object can be For an object: receives every action and fake_action The value is a routine which can be activated by found in the current location. For an object: the object’s indefinite article – the default is description initial automatically “a”. door_dir string. the room description when the player is inside the object. or true to signify ‘not an exit’ and produce found) or objects (whose locations are tracked by this no further output. e_obj. continue. The an optional default as well). telling the The value is a routine which should return: false to dictionary word ('word ' or –'word '). a • a space-separated list of rooms (where this object can be ScopeWithin() to specify objects. or a routine which returns a See d_to. found_in add_to_scope • a room: the exit leads to this room. or a routine which outputs a room. The value can be: a string. ] capacity • a room: the door leads to this room. first). several For a room: the message when the player attempts an For a door object: where it leads. The value can be: a directional property (d_to. For an object: its description before being picked up. For an animate or talkable object: the value is a The value is a routine of structure similar to a switch describe ⊕ routine called when the parser knows that this object is statement. true to indicate description is output.. statement . the For a room: a possible exit. for which this is the noun. door object. The same properties in a Class definition (and are dealt with • false (the default): not an exit. For a room: its description when the player enters the articles The value can be: a string. happened. a room. but before the player has been informed. For an enterable object: its description. For a non-English object: its definite and indefinite string. that the routine has parsed the entire command. value can be: a string. or true to stop in_to article processing and produce no further output.. The value can be: of scope. string. The value can be: a string. statement . number. ] objects which can be placed in or on it – the default is 100. but has yet to test the grammar. For a room: called before the room’s (long) routine should return: false to continue. or a routine which outputs a articles. or a routine. it is invoked after the action has happened. before ⊕ For a compass object (d_obj.): the direction in inside_description For an object: receives every action and fake_action which an attempt to move to this object actually leads.). or a routine which invokes PlaceInScope() or • a routine which should return: false. each_turn ⊕ “⊕” marks an additive property: such properties in an d_to Invoked at the end of each turn (after all appropriate Object definition supplement. property [. The value can be: a space-separated list of objects. a room. return routine (). string.. or true to stop processing the action and produce no further output. . output as part of for which this is the noun. The value can be: formats are possible (but remember: embedded “]” returns impossible exit. e_to. • a string: output to explain why this is not an exit.. For an object: the rooms where this object can be found. turn until deactivated by StopDaemon(object ). ): which outputs a string. or a routine • false (the default): leads nowhere. object). output.. rather than supersede. For a room: its long description (output by Look). or a The routine should return: false to continue. false. . See after. 3 3 . The value can be: daemons and timers) whenever the object is in scope. or a routine which outputs a string.

For a switchable object: used when including this object has been output. and in a room’s long description.". The value is a routine second call the list has been output. For an object: detects nearby actions – those which take • a string: all objects having this value are grouped as a place when this object is in scope. or nothing if no key fits. The routine number of turns left until this object’s timer – activated processing and produce no further output. or true to or a routine which outputs a string. For a lockable object: the ‘key’ object needed to lock has the value 2. when in the presence of list_together others like it. having cases for the appropriate actions (and object’s name.. For a timer object: the value is a routine which is run Tell ThrowAt WakeOther) for which this is the noun. and not in the meantime cancelled statement. when_closed For an object: its plural form. The value can be: react_after object in a room’s long description. s_to n_to se_to See d_to. and the For an animate or talkable object: the value is a For a timer object: the value is a variable to hold the routine should return: false to continue or true to stop routine called to carry out the player’s orders.. Each word can be supplied in value can be: a string. and the routine should return: false to continue nw_to sw_to or true to stop processing and produce no further output. See after. or true to stop processing the action For a room: outputs “does not need to be referred to”. but not any subsidiary orders time_left information. or a call nothing has been output. outputting the object’s ‘real’ short name (from the head of For an object: identifies this object. telling the player what has happened. positive number of words matched. or a routine which outputs a string.. and unlock the object.. On the first variable freely available for use by the program. the object definition). The routine should return: makes no sense. On the second call the object’s indefinite article and short name have been output. See after. See d_to. name ⊕ short_name Defines a space-separated list of words which are added to For an object: an alternative or extended short name. The parse_name when the object’s time_left value – initialised by value is a routine of structure similar to a switch For an object: the value is a routine called to parse an StartTimer(object ). The value can be: a string. For an animate object: receives person-to-person out_to time_out actions (Answer Ask Attack Give Kiss Order Show See d_to. The routine should return: zero if the text by StopTimer(object ) – counts down to zero. which is called twice. routine which outputs a string. an optional default as well). react_before the routine should return: false to continue. The value can be: a string. The value is a routine when_off count of the string. See d_to. For a container or door object: used when including this inventory or room contents list. string. ne_to See d_to. For an object: detects nearby actions – those which take stop processing and produce no further output. inventory_stage has the object must provide (but not use) this variable. should return: false to continue.' or quotes ". inventory_stage has the value 1. The value can be: a • a number: all objects having this value are grouped. zero and invokes the object’s time_out property. A player by an indefinite object. further output. or the u_to false to continue. and produce no further output. when_on invoked after the action has happened. The the Inform dictionary. in all other cases only The routine should return: false to continue by words in apostrophes update the dictionary. but before the • a routine which is called twice. The value can be: a string. 4 4 . See d_to. inventory_stage invoked before the action has happened. apostrophes '. or true to stop and initialised by StartTimer(object ) – counts down to life ⊕ processing the action and produce no further output. and there is no test on the return value. or a routine which outputs a string. invent number short_name_indef For an object: the value is a routine for outputting the For an object or room: the value is a general-purpose For a non_English object: the short name when preceded object’s inventory listing. –1 to cause the parser to resume. value 1. w_to or true to stop processing the action and produce no plural See d_to. or a routine when_open For an object: groups related objects when outputting an which outputs a string. On the first call nothing player has been informed. inventory_stage has the value 2. On the with_key place when this object is in scope.

For a container object: objects inside it are visible. ParserError(number ) male •• Optional entry points •••••••••••••••• Called to handle an error. The player has died. or which can appear in many rooms): is no longer there. if you supply them. PrintTaskName(number ) neuter Prints the name of the task. For an object or room: is giving off light. AfterLife() For an object: is being. and initialised wn to 1. For an object: is a door or bridge between rooms. Parser has found “ALL” or an ambiguous noun phrase and For a ‘floating’ object (one with a found_in property. NewRoom() visited light Called when room changes. before description is output. and the routine should For an object: is a living creature. 5 5 .. are called when shown. also available to the program. For an object or room: a general-purpose flag. The “>” prompt has been output. For a clothing object: is being worn. or 2 to force exclusion. For an object: can be eaten. see the with_key property. proper decided that object should be excluded (flag is 0). ParseNoun(object ) workflag lockable Called to parse the object’s name. Amusing() For a switchable object: is switched on. do this” style. scenery return an appropriate score 0. set up the buffer and parse UnknownVerb() openable tables. For an object: can’t be opened. LookRoutine() transparent general Called at the end of every Look description. the parser is undecided. supporter edible Initialise() For an object: other objects can be put on (but not in) it.length ) worn locked Called to parse a number. For an object: awards OBJECT_SCORE points when taken for the first time. taken by the player. BeforeParsing() For a container or door object: is open. The parser has input some text. •• Object attributes ••••••••••••••••••• pluralname ChooseObjects(object. or has been. For an animate object: is male. Must switchable enterable set location. For a container or door object: can be opened. clothing For an object: can’t be taken. InScope() talkable female Called during parsing.flag ) absent For an object: is plural. For an object: can be addressed in “object. Temporary internal flag. For an object: the short name is a proper noun. PrintRank() moved Completes the output of the score. The routine should return: 0 to let animate not to be preceded by “The” or “the”. description. For an object: other objects can be put in (but not on) it. concealed scored DeathMessage() For an object: is present but hidden from view. ParseNumber(byte_array. Called after all actions. The player has moved from one dark room to another. but done nothing else. TimePasses() open Called after every turn. therefore included (flag is 1). static door GamePreRoutine() For an object: can’t be taken. or has been. For an animate object: is female. is not listed in a room DarkToDark() For an object: can be worn.9. For an object: can be locked. visited by the player. If flag is 2. PrintVerb(addr ) on Called when an unusual verb is printed. Called before all actions. can return 2 to suppress game banner. note British spelling: called at start. For an object: can be switched off or on. this stand. 1 to force inclusion. The player has won and AMUSING_PROVIDED is defined. Setting deadflag to 0 resurrects her. For an object: can be entered. For a room: awards ROOM_SCORE points The player has died and deadflag is 3 or more. AfterPrompt() For an animate object: is neither male nor female. container GamePostRoutine() when visited for the first time. For a room: is being. Called when an unusual verb is encountered. These routines. Mandatory.

“SWIM” VagueGo “GO”. Yes “Y[ES]” Climb “CLIMB [OVER|UP]”. “SMASH”. “IN[SIDE]” NotUnderstood Generated when the parser fails to Fill “FILL” Insert “DISCARD IN|INTO”. “TAKE” Sorry “SORRY” Transfer “CLEAR TO”. “FASTEN [TO]”. “SPEAK TO” “TIE [TO]” “GO IN|INSIDE|INTO|THROUGH”. “SCREW”. “SCREW OFF”. “GET IN|INTO|ON|ONTO”. “WRECK” “STAND ON”. TheSame Generated when the parser can’t Look “L[OOK]” No “NO” distinguish between two objects. GetOff “GET OFF” •• Fake actions •••••••••••••••••••••• “READ ABOUT IN”. Swing “SWING [ON]” Wear “DON”. “DESTROY”. “LIGHT [WITH]” “READ”. EmptyT “EMPTY IN|INTO|ON|ONTO|TO” Enter “CROSS”. Ask “ASK ABOUT” Touch “FEEL. Sing “SING” Group 1 actions support the ‘meta’ verbs and debug tools. “STAND [UP]” Consult “CONSULT ABOUT|ON”. “JUMP”. “RUN”. “SLEEP” Take “CARRY”. “REMOVE”. “WALK IN|INSIDE|INTO|THROUGH” WakeOther “AWAKE[N]”. “PRESS”. “PUSH TO”. •• Group 1 actions •••••••••••••••••••• SwitchOn “SCREW ON”. “SWEEP”. AskFor “ASK FOR” Turn “ROTATE”. “INVENTORY TALL” Listen “HEAR”. Pull “DRAG” “PULL” “PUT ON|ONTO”. “COVER [UP]”. “WATCH”. “DROP DOWN|IN|INTO”. “X” WaveHands “WAVE” Buy “BUY” “PURCHASE” Exit “EXIT”. “GET”. “SAY TO”. “TOUCH” “LEAVE IN|INSIDE|INTO|THROUGH”. “SIT ON TOP OF”. “LISTEN [TO]” Prompt Outputs the prompt. Cut “CHOP. “SEARCH” Rub “CLEAN”. “REMOVE FROM”. “LEAVE”. “WALK” Disrobe “DISROBE”. “DROP”. “MURDER”. Strong Various strong swearwords. Dig “DIG [WITH]” Go “GO”. “FIGHT”. “BREAK”. “HUG”. “WALK” Miscellany Outputs a range of utility messages. “SKIP OVER” PluralFound Tells the parser that parse_name() has Inv “I[NV]”. “SHIFT TO”. “THROW ON|ONTO” Push “CLEAR”. “PUT DOWN”. “CRACK”. “WAKE [UP]” Blow “BLOW” Wave “WAVE” Examine “CHECK. “PUNCH”. “DROP ON|ONTO”. “WIPE” SwitchOff “CLOSE OFF”. “SHOW [TO]” “SHINE”. Smell “SMELL”. “KISS” identified a plural object. “HIT”. “SHOUT TO”. “GET OFF|OUT|UP”. Jump “HOP”. Wake “AWAKE[N]”. LetGo Generated by Remove. “SKIP” Order Receives things not handled by orders. “UNDO”. “SCRUB”. given the right circumstances. “SCALE” “OUT[SIDE]”. “ENTER”. “SWITCH OFF”. Show “DISPLAY [TO]”.” “CUT”. “INVENTORY WIDE” LookUnder “LOOK UNDER” Receive Generated by Insert and PutOn. “PUT IN|INSIDE|INTO”. “EXAMINE”. “SWITCH ON”. “SHIFT” Search “L[OOK] IN|INSIDE|INTO|THROUGH”. “RUN”. “READ IN” Give “FEED [TO]”. normally “>”. “UNDO WITH”. Wait “WAIT” “Z” “RUN IN|INSIDE|INTO|THROUGH”. “WAKE [UP]” “SIT IN|INSIDE|ON”. Tie “ATTACH [TO]”. “LEAVE”. “KILL”. “L[OOK] AT”. “LOOK UP IN”. “SET” “TURN OFF”. “TORTURE”. “RUB”. “SNIFF” •• Group 2 actions •••••••••••••••••••• “PICK UP”. Burn “BURN [WITH]”. “HOLD”. “TURN”. Lock “LOCK WITH” Mild Various mild swearwords. “TURN ON”. “SQUEEZE” Group 2 actions usually work. “THUMP”.” “DESCRIBE”. “SHED”. “SHUT [UP]” Swim “DIVE”. InvWide “I[NV] WIDE”. PutOn “DISCARD ON|ONTO”. “TRANSFER TO” These are the standard actions and their triggering verbs. Drink “DRINK”. Set “ADJUST”. “GROPE”. “THROW DOWN|IN|INTO” JumpOver “HOP OVER”. “TWIST ON” Sleep “NAP”. “PRESS”. “PUT ON”. Attack “ATTACK”. “PRESENT [TO]”. “MOVE”. “SHIFT” Remove “GET FROM”. “UNCOVER”. Squeeze “SQUASH”. Unlock “OPEN WITH”. “SIP”. “WEAR” “TAKE OFF” Taste “TASTE” Drop “DISCARD”. Answer “ANSWER TO”. “PRUNE”. “UNSCREW” “LIE IN|INSIDE|ON”. “MOVE”. “TWIST OFF” SetTo “ADJUST TO”. “SLICE” “PAY [TO]” ListMiscellany Outputs a range of inventory messages. “PRESS TO”. “JUMP OVER”. “TWIST”. “DOFF”. “PUSH”. “FIX [TO]”. “SWALLOW” GoIn “CROSS”. “DUST”. interpret some orders. “UNWRAP” Pray “PRAY” ThrownAt Generated by ThrowAt. “POLISH”.” “FONDLE”. “MOVE TO”. “REMOVE”. “INVENTORY”. “UNLOCK WITH” Close “CLOSE [UP]”. Open “OPEN”. InvTall “I[NV] TALL”. “OFFER [TO]”. “TAKE FROM|OFF” PushDir “CLEAR”. “TAKE INVENTORY” Kiss “EMBRACE”. “GIVE [TO]”. “ENTER”. “SET TO” 6 6 . “LIE ON TOP OF”. “PUSH”. “PEEL [OFF]”. “THROW” Tell “TELL ABOUT” •• Group 3 actions •••••••••••••••••••• Think “THINK” Eat “EAT” Empty “EMPTY [OUT]” Group 3 actions are by default stubs which output a message ThrowAt “THROW AGAINST|AT|ON|ONTO” and stop at the ‘before’ stage (so there is no ‘after’ stage). “INSERT IN|INTO”. “LEAVE”.