Inform - Support - Inform63

About Inform 6.3  
What's new?  

Compiler bugs  
Library bugs  

Enhancement ideas  

New features in Inform 6.3

Release 4/2 of the Inform Designer's Manual, which appeared in July 2001, describes the capabilities of the Inform compiler 6.21 with library 6/9 (and 6/10). Since that time, several new versions of the software have been released:

  • Feb 2004: compiler 6.30, library 6/11
  • XXX 2005: compiler 6.31, library 6/12

As well as fixing problems, these releases have introduced a range of new features into the Inform system; full details are provided in the associated Release Notes. Here is a brief summary, intended to supplement the DM4.


Changes to the compiler

Compiler constants
TARGET_ZCODE is defined when targetting the Z-machine.
TARGET_GLULX is defined when targetting Glulx.
WORDSIZE is set to 2 when targetting the Z-machine, 4 when targetting Glulx.
 
Statements
<...> and <<...>> now accept an optional initial parameter: the actor who is to perform the command.
 <action noun second>;            ! action is performed by the player
<<action noun second>>;          ! (this is the current syntax)

<actor, action noun second>;     ! action is performed by the specified actor
<<actor, action noun second>>;   ! (this is the optional new format)
objectloop (x : expresssion) is applied to every object x for which the expression is true.
(A) print rule is similar to the existing (The) -– prints an object's indefinite article with its first letter capitalised. The printed article is "A", "An" or "Some" by default, or else taken from the object's 'article' property.
 
Directives
Array...buffer is similar to Array...string and Array...table.
 Array array buffer N;
Array array buffer expr1 expr2 ... exprN;
Array array buffer "string";

This creates a hybrid array of the form used by string.print_to_array and the new library routine PrintToBuffer( ), in which the first word array-->0 contains N and the following N bytes contain the specified expression values or string characters.

A directive such as Array myArray buffer 100; initialises the first word myArray-->0 to 100 and the following 100 bytes myArray->WORDSIZE through myArray->(WORDSIZE+99) to zero. This behaviour is consistent with the handling of string and table arrays, as defined in the DM4.

Note that Strict mode generates a warning if you use "->" to address an array of words, or "-->" to address an array of bytes. No such warnings are generated when addressing a buffer array, making this a useful declaration for any data structure which mixes byte and word values.

End can be used in an Included file to immediately exit from that file, and the compilation continues normally. An End directive at the highest level terminates the compilation, as previously.
Include is enhanced in two ways. A prefix of "?" means that the compilation should not fail if the specified file cannot be found. Second, the file to be included can be specified as a string constant.
If... The directives which support conditional compilation --– #Ifdef, #Iftrue and so on -- can be used within Class and Object definitions. Additionally, these directives now support the logical operators &&, || and ~~.

Coding errors are ignored within a block of code which has been conditionally excluded from compilation -- for example, #Ifdef NOT_DEFINED; ... #Endif; or #Iftrue false; ... #Endif;
Replace has an extended syntax:
 Replace library_routine new_name;

This provides the same functionality as before; in addition, the existing library_routine is internally renamed to new_name, which means that the new version of library_routine which is provided as part of your game file can still invoke the original version which it is replacing.

Undef this new directive causes its argument -- anything that can be tested with #Ifdef -- to become undefined from that point onwards. Previous references to the argument remain valid.
 
Assembly language
@check_unicode and @print_unicode are now supported.
 
Switches
-I (upper case I for 'Incompatible') treat obsolete usages as errors, not warnings.
-l (lower case l for 'list') list Included filenames.
-On optimise objectloops -- 0 = no optimisation, 1 = optimise for size, 2 = optimise for speed (default).
-v9 compile to Version 9.
-Wn is the minimum size in words of the Z-machine header extension table (default of 3).
-X Infix is supported for Glulx targets.
-S, -D Strict mode (which compiles run-time integrity checks) has been decoupled from Debug mode (which defines debugging verbs like TRACE and SHOWOBJ). By default, Strict mode is enabled (turn it off with -~S) and Debug mode is disabled (turn it on with -D).
 
Compilation control
!% is a special comment occurring on the very first line or lines of the source file, specifying Inform Command Language (ICL) commands to control the compilation.
+charset_map=file to map proprietary code pages to ISO 8859 standards.
$DICT_WORD_SIZE=n (default of 9).
$MAX_INCLUSION_DEPTH=n (default of 5).
$MAX_SOURCE_FILES=n (default of 256).


Changes to the library

Library objects
LibraryExtensions is used by extensions for initialisation and message interception.
n_obj, s_obj, etc The word "wall" has been removed from the CompassDirection objects defined in English.h, whose names are now simply "north", "south", etc.
selfobj includes an empty add_to_scope property.
 
Library constants
LIBRARY_ENGLISH is defined at the end of English.h. Alternatively, LIBRARY_FRENCH, LIBRARY_SWEDISH, etc.
LIBRARY_VERSION is set to 612.
LIBRARY_STATE is defined at the start of Parser.h as BEFORE_PARSER, and redefined at the end of Parser.h, VerbLib.h and Grammar.h as AFTER_PARSER, AFTER_VERBLIB and AFTER_GRAMMAR respectively.
MASTER_INCLUDE defines the name of a Master Include File which itself Includes library extensions. The MIF is automatically included at the four values of LIBRARY_STATE.
 
User-defined constants
CLR_ON=true define as true to enable coloured output.
COMMENT_CHARACTER='char' (default of '*'). The parser treats input lines beginning with this character as a comment, without attempting any further parsing.
NO_IMPLICIT_ACTIONS define to disable implicit actions.
NO_SCORE define to disable reporting of scores.
NO_TAKE_ALL define to disable TAKE ALL command.
SERIAL_COMMAS define to include 'serial' (aka 'Oxford') commas in lists.
SHORTNAMEBUF_LEN='n' (default of 160). Specify the buffer size used for printing an object's short name.
START_MOVE=n specify the initial value of turns counter.
TRADITIONAL_TAKE_ALL define to disable TAKE of objects on supporters and in open containers, and to enable TAKE of animate, scenery and static objects.
 
Variables
asking_player is true when parser is asking player a disambiguation question.
before_first_turn is true before first prompt is displayed.
keep_silent set to 1 to suppress success messages, 2 to suppress all messages.
lookmode defaults to 2 (VERBOSE).
sys_statusline_flag set to 0 for statusline score, or to 1 by statusline time.
turns is initialised to 0 rather than 1.
 
Library routines
CapitRule(string) prints the string with the first letter in upper case. Can also be used as a print rule.
Centre(string) prints a single-line string approximately centrally between the left and right borders of the screen by preceding it with an appropriate number of spaces.
ClearScreen(selector) if selector is 0, both statusline and main window are cleared; if selector is 1 only the statusline is cleared; if selector is 2 only the main window is cleared.
DecimalNumber(num) prints num as a decimal number.
GameEpilogue( ) runs before main 'play' loop.
GamePrologue( ) runs after main 'play' loop/
GetKeyBufLength(keybuffer) returns the number of characters in the keybuffer (default is buffer).
KeyCharPrimitive waits for a single key, and returns the character from 1-255 (or, for Glulx, one of the Glk special key codes).
KeyDelay(time) waits time tenths of a second for a single key. If no key is pressed within that period it returns zero; otherwise it returns the character from 1-255.
LowerCase(char) returns char in lower case (if it was alphabetic), or unchanged (otherwise).
MainWindow( ) selects the main (buffered) text window for output.
MoveCursor(line, column) selects the status line for output and moves the cursor to the given line and column within the status area, where line 1 is the top line and column 1 is the far left.
NumberWords(parsebuffer) returns the number of parsed words in the parsebuffer (default is parse).
PrintCapitalised(arg1, arg2, no_break, no_caps, centred) prints its arguments -- a string, an object's name, the value of an object's property, or a routine with up to one argument -- with the first letter in upper case.
PrintOrRunVar(arg, no_break) if arg is an object, prints that object's name; if arg is a routine, runs that routine; if arg is a string, prints that string.
PrintToBuffer(array, arraylen, arg1, arg2, arg3) prints its arguments -- a string, an object's name, the value of an object's property, or a routine with up to two arguments -- to the buffer array.
ScreenHeight( ) returns the height in lines of the main window.
ScreenWidth( ) returns the number of characters that can be printed in a monospaced font between the left and right borders of the currently selected window.
SetColour(fg, bg, selector) sets the current foreground and background text colours, using the same codes as the @set_colour opcode in the Z-machine (1=default, 2=black, 3=red, 4=green etc.).
SetKeyBufLength(num, keybuffer) resets the number of characters in the keybuffer (default is buffer).
StatusLineHeight(lines) sets the height of the statusline in lines.
StringSize(string) returns the number of characters in the string.
TaskScore(i) returns the byte-value score associated with task i.
UpperCase(char) returns char in upper case (if it was alphabetic), or unchanged (otherwise).
WordAddress(wordnum, parsebuffer, keybuffer) returns the absolute address of parsed word wordnum in the keyboard buffer, now optionally accepts the address of the parsebuffer (default is parse) and the keybuffer (default is buffer).
WordLength(wordnum, parsebuffer) returns the number of characters in parsed word wordnum in the input buffer, now optionally accepts the address of the parsebuffer (default is parse).
WordValue(wordnum, parsebuffer) returns the dictionary value of parsed word wordnum in the input buffer; it optionally accepts the address of the parsebuffer (default is parse).
YesOrNo(flag) if flag is true, status line is not refreshed.
 
Object properties
before_implicit is a local property invoked before various implicit actions. The property’s value should be a constant or a routine which returns: 0 to report "(first ...)" and then attempt to perform the action (this is what currently happens); 1 to attempt the action without first issuing the message, 2 to proceed with the requested action without first attempting the implied one.
compass_look is a local property applicable to rooms, used with LOOK compass_direction.
description can return 2 to suppress "The object is currently switched on|off" messages.
found_in can be followed by a list of classes as well as objects.
invent is invoked when building room descriptions as well as player inventories.
narrative_voice is a local property applicable to the 'player' object; can be 1, 2 or 3.
 
Object attributes
non_floating is an alias for absent.
 
Optional entry points
ObjectDoesNotFit(obj1,obj2) should print a suitable message and return true if obj1 is too large or heavy to be placed in or on obj2; it should return false for the action to continue normally.
 
Actions
ASK npc TO command and TELL npc TO command are both synomymous with npc, command.
PRY, PRISE, PRIZE and LEVER have been added.
RECORDING [ON|OFF] and REPLAY are always available, irrespective of the DEBUG state.
 
Fake actions
GoneFrom is offered to the departure room's after property (after a successful movement, but before any arrival message is printed).


Last updated 26 November 2004. This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation. Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by C Knight.