mirror of
https://github.com/ganelson/inform.git
synced 2024-07-16 22:14:23 +03:00
847 lines
50 KiB
HTML
847 lines
50 KiB
HTML
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||
|
<html>
|
||
|
<head>
|
||
|
<title>S/ct2</title>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
|
<meta http-equiv="Content-Language" content="en-gb">
|
||
|
<link href="inweb.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
||
|
</head>
|
||
|
<body>
|
||
|
|
||
|
<!--Weave of 'S/dt' generated by 7-->
|
||
|
<ul class="crumbs"><li><a href="../webs.html">★</a></li><li><a href="index.html">basic_inform Template Library</a></li><li><b>Definitions Template</b></li></ul><p class="purpose">Miscellaneous constant definitions, usually providing symbolic names for otherwise inscrutable numbers, which are used throughout the template layer.</p>
|
||
|
|
||
|
<ul class="toc"><li><a href="#SP1">§1. Z-Machine Definitions</a></li><li><a href="#SP2">§2. Glulx Definitions</a></li><li><a href="#SP3">§3. Powers of Two</a></li><li><a href="#SP4">§4. Text Styles</a></li><li><a href="#SP5">§5. Colour Numbers</a></li><li><a href="#SP6">§6. Window Numbers</a></li><li><a href="#SP7">§7. Paragraphing Flags</a></li><li><a href="#SP8">§8. Descriptors in the Language of Play</a></li><li><a href="#SP9">§9. Run-Time Problem Numbers</a></li><li><a href="#SP10">§10. Template Activities</a></li><li><a href="#SP11">§11. Template Rulebooks</a></li><li><a href="#SP12">§12. Kind IDs</a></li><li><a href="#SP13">§13. Parser Error Numbers</a></li><li><a href="#SP14">§14. Scope Searching Reasons</a></li><li><a href="#SP15">§15. Token Types</a></li><li><a href="#SP16">§16. GPR Return Values</a></li><li><a href="#SP17">§17. List Styles</a></li><li><a href="#SP18">§18. Lengths Of Time</a></li><li><a href="#SP19">§19. Empty Text</a></li><li><a href="#SP20">§20. Empty Table</a></li><li><a href="#SP21">§21. Empty Set</a></li><li><a href="#SP22">§22. Template Attributes</a></li><li><a href="#SP23">§23. Template Properties</a></li><li><a href="#SP24">§24. Action Count</a></li><li><a href="#SP25">§25. Fake Actions</a></li><li><a href="#SP26">§26. Formal Parameters</a></li><li><a href="#SP27">§27. Template Configuration</a></li></ul><hr class="tocbar">
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP1"></a><b>§1. Z-Machine Definitions. </b>The Z-machine contains certain special constants and variables at fixed
|
||
|
position in its "header"; the addresses of these are given below. See
|
||
|
The Z-Machine Standards Document, version 1.0, for details.
|
||
|
</p>
|
||
|
|
||
|
<p class="inwebparagraph"><code class="display"><span class="extract">INDIV_PROP_START</span></code> is the lowest number of any "individual property",
|
||
|
an I6 internal quantity defined by the compiler when the target is Glulx
|
||
|
but not for Z.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">#Ifdef TARGET_ZCODE;</span>
|
||
|
|
||
|
<span class="plain">Global max_z_object;</span>
|
||
|
|
||
|
<span class="plain">Constant INDIV_PROP_START 64;</span>
|
||
|
|
||
|
<span class="plain">! Offsets into Z-machine header:</span>
|
||
|
|
||
|
<span class="plain">Constant HDR_ZCODEVERSION = $00; ! byte</span>
|
||
|
<span class="plain">Constant HDR_TERPFLAGS = $01; ! byte</span>
|
||
|
<span class="plain">Constant HDR_GAMERELEASE = $02; ! word</span>
|
||
|
<span class="plain">Constant HDR_HIGHMEMORY = $04; ! word</span>
|
||
|
<span class="plain">Constant HDR_INITIALPC = $06; ! word</span>
|
||
|
<span class="plain">Constant HDR_DICTIONARY = $08; ! word</span>
|
||
|
<span class="plain">Constant HDR_OBJECTS = $0A; ! word</span>
|
||
|
<span class="plain">Constant HDR_GLOBALS = $0C; ! word</span>
|
||
|
<span class="plain">Constant HDR_STATICMEMORY = $0E; ! word</span>
|
||
|
<span class="plain">Constant HDR_GAMEFLAGS = $10; ! word</span>
|
||
|
<span class="plain">Constant HDR_GAMESERIAL = $12; ! six ASCII characters</span>
|
||
|
<span class="plain">Constant HDR_ABBREVIATIONS = $18; ! word</span>
|
||
|
<span class="plain">Constant HDR_FILELENGTH = $1A; ! word</span>
|
||
|
<span class="plain">Constant HDR_CHECKSUM = $1C; ! word</span>
|
||
|
<span class="plain">Constant HDR_TERPNUMBER = $1E; ! byte</span>
|
||
|
<span class="plain">Constant HDR_TERPVERSION = $1F; ! byte</span>
|
||
|
<span class="plain">Constant HDR_SCREENHLINES = $20; ! byte</span>
|
||
|
<span class="plain">Constant HDR_SCREENWCHARS = $21; ! byte</span>
|
||
|
<span class="plain">Constant HDR_SCREENWUNITS = $22; ! word</span>
|
||
|
<span class="plain">Constant HDR_SCREENHUNITS = $24; ! word</span>
|
||
|
<span class="plain">Constant HDR_FONTWUNITS = $26; ! byte</span>
|
||
|
<span class="plain">Constant HDR_FONTHUNITS = $27; ! byte</span>
|
||
|
<span class="plain">Constant HDR_ROUTINEOFFSET = $28; ! word</span>
|
||
|
<span class="plain">Constant HDR_STRINGOFFSET = $2A; ! word</span>
|
||
|
<span class="plain">Constant HDR_BGCOLOUR = $2C; ! byte</span>
|
||
|
<span class="plain">Constant HDR_FGCOLOUR = $2D; ! byte</span>
|
||
|
<span class="plain">Constant HDR_TERMCHARS = $2E; ! word</span>
|
||
|
<span class="plain">Constant HDR_PIXELSTO3 = $30; ! word</span>
|
||
|
<span class="plain">Constant HDR_TERPSTANDARD = $32; ! two bytes</span>
|
||
|
<span class="plain">Constant HDR_ALPHABET = $34; ! word</span>
|
||
|
<span class="plain">Constant HDR_EXTENSION = $36; ! word</span>
|
||
|
<span class="plain">Constant HDR_UNUSED = $38; ! two words</span>
|
||
|
<span class="plain">Constant HDR_INFORMVERSION = $3C; ! four ASCII characters</span>
|
||
|
|
||
|
<span class="plain">#Endif;</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP2"></a><b>§2. Glulx Definitions. </b>We make similar header definitions for Glulx. Extensive further
|
||
|
definitions, of constants needed to handle the Glk I/O layer, can be found
|
||
|
in the "Infglk" section of "Glulx.i6t"; they are not used in the rest
|
||
|
of the template layer, and would only get in the way here.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">#IFDEF TARGET_GLULX;</span>
|
||
|
|
||
|
<span class="plain">Global unicode_gestalt_ok; ! Set if interpreter supports Unicode</span>
|
||
|
|
||
|
<span class="plain">! Offsets into Glulx header and start of ROM:</span>
|
||
|
|
||
|
<span class="plain">Constant HDR_MAGICNUMBER = $00; ! long word</span>
|
||
|
<span class="plain">Constant HDR_GLULXVERSION = $04; ! long word</span>
|
||
|
<span class="plain">Constant HDR_RAMSTART = $08; ! long word</span>
|
||
|
<span class="plain">Constant HDR_EXTSTART = $0C; ! long word</span>
|
||
|
<span class="plain">Constant HDR_ENDMEM = $10; ! long word</span>
|
||
|
<span class="plain">Constant HDR_STACKSIZE = $14; ! long word</span>
|
||
|
<span class="plain">Constant HDR_STARTFUNC = $18; ! long word</span>
|
||
|
<span class="plain">Constant HDR_DECODINGTBL = $1C; ! long word</span>
|
||
|
<span class="plain">Constant HDR_CHECKSUM = $20; ! long word</span>
|
||
|
<span class="plain">Constant ROM_INFO = $24; ! four ASCII characters</span>
|
||
|
<span class="plain">Constant ROM_MEMORYLAYOUT = $28; ! long word</span>
|
||
|
<span class="plain">Constant ROM_INFORMVERSION = $2C; ! four ASCII characters</span>
|
||
|
<span class="plain">Constant ROM_COMPVERSION = $30; ! four ASCII characters</span>
|
||
|
<span class="plain">Constant ROM_GAMERELEASE = $34; ! short word</span>
|
||
|
<span class="plain">Constant ROM_GAMESERIAL = $36; ! six ASCII characters</span>
|
||
|
|
||
|
<span class="plain">#Endif;</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP3"></a><b>§3. Powers of Two. </b>I6 lacks support for logical shifts, and the Z-machine opcodes which bear
|
||
|
on this are not always well supported, so the I6 library has traditionally
|
||
|
used a lookup table for the values of 2^{15-n} where 0<= n <= 11.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Array PowersOfTwo_TB</span>
|
||
|
<span class="plain">--> $$100000000000</span>
|
||
|
<span class="plain">$$010000000000</span>
|
||
|
<span class="plain">$$001000000000</span>
|
||
|
<span class="plain">$$000100000000</span>
|
||
|
<span class="plain">$$000010000000</span>
|
||
|
<span class="plain">$$000001000000</span>
|
||
|
<span class="plain">$$000000100000</span>
|
||
|
<span class="plain">$$000000010000</span>
|
||
|
<span class="plain">$$000000001000</span>
|
||
|
<span class="plain">$$000000000100</span>
|
||
|
<span class="plain">$$000000000010</span>
|
||
|
<span class="plain">$$000000000001;</span>
|
||
|
|
||
|
<span class="plain">Array IncreasingPowersOfTwo_TB</span>
|
||
|
<span class="plain">--> $$0000000000000001</span>
|
||
|
<span class="plain">$$0000000000000010</span>
|
||
|
<span class="plain">$$0000000000000100</span>
|
||
|
<span class="plain">$$0000000000001000</span>
|
||
|
<span class="plain">$$0000000000010000</span>
|
||
|
<span class="plain">$$0000000000100000</span>
|
||
|
<span class="plain">$$0000000001000000</span>
|
||
|
<span class="plain">$$0000000010000000</span>
|
||
|
<span class="plain">$$0000000100000000</span>
|
||
|
<span class="plain">$$0000001000000000</span>
|
||
|
<span class="plain">$$0000010000000000</span>
|
||
|
<span class="plain">$$0000100000000000</span>
|
||
|
<span class="plain">$$0001000000000000</span>
|
||
|
<span class="plain">$$0010000000000000</span>
|
||
|
<span class="plain">$$0100000000000000</span>
|
||
|
<span class="plain">$$1000000000000000;</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP4"></a><b>§4. Text Styles. </b>These are the styles of text distinguished by the template layer, though
|
||
|
they are not required to look different from each other on any given VM.
|
||
|
The codes are independent of the VM targetted, though in fact they are
|
||
|
equal to Glulx style numbers as conventionally used. (The Z-machine renders
|
||
|
some as roman, some as bold, but for instance makes <code class="display"><span class="extract">HEADER_VMSTY</span></code> and
|
||
|
<code class="display"><span class="extract">SUBHEADER_VMSTY</span></code> indistinguishable to the eye.) Glulx's system of styles
|
||
|
is one of its weakest points from an IF author's perspective, since it is
|
||
|
all but impossible to achieve the text effects one might want — boldface,
|
||
|
for instance, or red text — and text rendering is almost the only area
|
||
|
in which it is clearly inferior to the Z-machine, which it was designed
|
||
|
to replace. Still, using these styles when we can will get the most out of
|
||
|
it, and for unornamental works Glulx is fine in practice.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Constant NORMAL_VMSTY = 0;</span>
|
||
|
<span class="plain">Constant HEADER_VMSTY = 3;</span>
|
||
|
<span class="plain">Constant SUBHEADER_VMSTY = 4;</span>
|
||
|
<span class="plain">Constant ALERT_VMSTY = 5;</span>
|
||
|
<span class="plain">Constant NOTE_VMSTY = 6;</span>
|
||
|
<span class="plain">Constant BLOCKQUOTE_VMSTY = 7;</span>
|
||
|
<span class="plain">Constant INPUT_VMSTY = 8;</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP5"></a><b>§5. Colour Numbers. </b>These are traditional colour names: quite who it was who thought that azure
|
||
|
was the same colour as cyan is now unclear. Colour is, again, not easy to
|
||
|
arrange on Glulx, but there is some workaround code.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Constant CLR_DEFAULT = 1;</span>
|
||
|
<span class="plain">Constant CLR_BLACK = 2;</span>
|
||
|
<span class="plain">Constant CLR_RED = 3;</span>
|
||
|
<span class="plain">Constant CLR_GREEN = 4;</span>
|
||
|
<span class="plain">Constant CLR_YELLOW = 5;</span>
|
||
|
<span class="plain">Constant CLR_BLUE = 6;</span>
|
||
|
<span class="plain">Constant CLR_MAGENTA = 7; Constant CLR_PURPLE = 7;</span>
|
||
|
<span class="plain">Constant CLR_CYAN = 8; Constant CLR_AZURE = 8;</span>
|
||
|
<span class="plain">Constant CLR_WHITE = 9;</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP6"></a><b>§6. Window Numbers. </b>Although Glulx can support elaborate tessalations of windows on screen (if
|
||
|
the complexity of handling this can be mastered), the Z-machine has much
|
||
|
more limited resources in general, so the template layer assumes a simple
|
||
|
screen model: there are just two screen areas, the scrolling main window
|
||
|
in which commands are typed and responses printed, and the fixed status
|
||
|
line bar at the top of the screen.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Constant WIN_ALL = 0; ! Both windows at once</span>
|
||
|
<span class="plain">Constant WIN_STATUS = 1;</span>
|
||
|
<span class="plain">Constant WIN_MAIN = 2;</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP7"></a><b>§7. Paragraphing Flags. </b>I am not sure many dictionaries would countenance "to paragraph" as a
|
||
|
verb, but never mind: the reference here is to the algorithm used to place
|
||
|
paragraph breaks within text, which uses bitmaps composed of the following.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Constant PARA_COMPLETED = 1;</span>
|
||
|
<span class="plain">Constant PARA_PROMPTSKIP = 2;</span>
|
||
|
<span class="plain">Constant PARA_SUPPRESSPROMPTSKIP = 4;</span>
|
||
|
<span class="plain">Constant PARA_NORULEBOOKBREAKS = 8;</span>
|
||
|
<span class="plain">Constant PARA_CONTENTEXPECTED = 16;</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP8"></a><b>§8. Descriptors in the Language of Play. </b>The following constants, which must be different in value from the number
|
||
|
of any I6 attribute, are used in the <code class="display"><span class="extract">LanguageDescriptors</span></code> table found
|
||
|
in the definition of the language of play.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Constant POSSESS_PK = $100;</span>
|
||
|
<span class="plain">Constant DEFART_PK = $101;</span>
|
||
|
<span class="plain">Constant INDEFART_PK = $102;</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP9"></a><b>§9. Run-Time Problem Numbers. </b>The enumeration sequence here must correspond to that in the file of RTP
|
||
|
texts, which is used to generate the HTML pages displayed by the Inform
|
||
|
user interface when a run-time problem has occurred. (For instance, the
|
||
|
file of RTP texts includes the heading "P17 - Can't divide by zero",
|
||
|
equivalent to <code class="display"><span class="extract">RTP_DIVZERO</span></code> being 17 below.) There is no significance to
|
||
|
the sequence, which is simply the historical order in which they were added
|
||
|
to I7.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Constant RTP_BACKDROP = 1;</span>
|
||
|
<span class="plain">Constant RTP_EXITDOOR = 2;</span>
|
||
|
<span class="plain">Constant RTP_NOEXIT = 3;</span>
|
||
|
<span class="plain">Constant RTP_CANTCHANGE = 4;</span>
|
||
|
<span class="plain">Constant RTP_IMPREL = 5;</span>
|
||
|
<span class="plain">Constant RTP_RULESTACK = 6; ! Now out of use</span>
|
||
|
<span class="plain">Constant RTP_TOOMANYRULEBOOKS = 7;</span>
|
||
|
<span class="plain">Constant RTP_TOOMANYEVENTS = 8;</span>
|
||
|
<span class="plain">Constant RTP_BADPROPERTY = 9;</span>
|
||
|
<span class="plain">Constant RTP_UNPROVIDED = 10;</span>
|
||
|
<span class="plain">Constant RTP_UNSET = 11;</span>
|
||
|
<span class="plain">Constant RTP_TOOMANYACTS = 12;</span>
|
||
|
<span class="plain">Constant RTP_CANTABANDON = 13;</span>
|
||
|
<span class="plain">Constant RTP_CANTEND = 14;</span>
|
||
|
<span class="plain">Constant RTP_CANTMOVENOTHING = 15;</span>
|
||
|
<span class="plain">Constant RTP_CANTREMOVENOTHING = 16;</span>
|
||
|
<span class="plain">Constant RTP_DIVZERO = 17;</span>
|
||
|
<span class="plain">Constant RTP_BADVALUEPROPERTY = 18;</span>
|
||
|
<span class="plain">Constant RTP_NOTBACKDROP = 19;</span>
|
||
|
<span class="plain">Constant RTP_TABLE_NOCOL = 20;</span>
|
||
|
<span class="plain">Constant RTP_TABLE_NOCORR = 21;</span>
|
||
|
<span class="plain">Constant RTP_TABLE_NOROW = 22;</span>
|
||
|
<span class="plain">Constant RTP_TABLE_NOENTRY = 23;</span>
|
||
|
<span class="plain">Constant RTP_TABLE_NOTABLE = 24;</span>
|
||
|
<span class="plain">Constant RTP_TABLE_NOMOREBLANKS = 25;</span>
|
||
|
<span class="plain">Constant RTP_TABLE_NOROWS = 26;</span>
|
||
|
<span class="plain">Constant RTP_TABLE_CANTSORT = 27;</span>
|
||
|
<span class="plain">Constant RTP_NOTINAROOM = 28;</span>
|
||
|
<span class="plain">Constant RTP_BADTOPIC = 29;</span>
|
||
|
<span class="plain">Constant RTP_ROUTELESS = 30;</span>
|
||
|
<span class="plain">Constant RTP_PROPOFNOTHING = 31;</span>
|
||
|
<span class="plain">Constant RTP_DECIDEONWRONGKIND = 32;</span>
|
||
|
<span class="plain">Constant RTP_DECIDEONNOTHING = 33;</span>
|
||
|
<span class="plain">Constant RTP_TABLE_CANTSAVE = 34;</span>
|
||
|
<span class="plain">Constant RTP_TABLE_WONTFIT = 35;</span>
|
||
|
<span class="plain">Constant RTP_TABLE_BADFILE = 36;</span>
|
||
|
<span class="plain">Constant RTP_LOWLEVELERROR = 37;</span>
|
||
|
<span class="plain">Constant RTP_DONTIGNORETURNSEQUENCE = 38;</span>
|
||
|
<span class="plain">Constant RTP_SAYINVALIDSNIPPET = 39;</span>
|
||
|
<span class="plain">Constant RTP_SPLICEINVALIDSNIPPET = 40;</span>
|
||
|
<span class="plain">Constant RTP_INCLUDEINVALIDSNIPPET = 41;</span>
|
||
|
<span class="plain">Constant RTP_LISTWRITERMEMORY = 42;</span>
|
||
|
<span class="plain">Constant RTP_CANTREMOVEPLAYER = 43;</span>
|
||
|
<span class="plain">Constant RTP_CANTREMOVEDOORS = 44;</span>
|
||
|
<span class="plain">Constant RTP_CANTCHANGEOFFSTAGE = 45;</span>
|
||
|
<span class="plain">Constant RTP_MSTACKMEMORY = 46;</span>
|
||
|
<span class="plain">Constant RTP_TYPECHECK = 47;</span>
|
||
|
<span class="plain">Constant RTP_FILEIOERROR = 48;</span>
|
||
|
<span class="plain">Constant RTP_HEAPERROR = 49;</span>
|
||
|
<span class="plain">Constant RTP_LISTRANGEERROR = 50;</span>
|
||
|
<span class="plain">Constant RTP_REGEXPSYNTAXERROR = 51;</span>
|
||
|
<span class="plain">Constant RTP_NOGLULXUNICODE = 52;</span>
|
||
|
<span class="plain">Constant RTP_BACKDROPONLY = 53;</span>
|
||
|
<span class="plain">Constant RTP_NOTTHING = 54;</span>
|
||
|
<span class="plain">Constant RTP_SCENEHASNTSTARTED = 55;</span>
|
||
|
<span class="plain">Constant RTP_SCENEHASNTENDED = 56;</span>
|
||
|
<span class="plain">Constant RTP_NEGATIVEROOT = 57;</span>
|
||
|
<span class="plain">Constant RTP_TABLE_CANTRUNTHROUGH = 58;</span>
|
||
|
<span class="plain">Constant RTP_CANTITERATE = 59;</span>
|
||
|
<span class="plain">Constant RTP_WRONGASSIGNEDKIND = 60;</span>
|
||
|
<span class="plain">Constant RTP_CANTBEOFFSTAGE = 61;</span>
|
||
|
<span class="plain">Constant RTP_RELKINDVIOLATION = 62;</span>
|
||
|
<span class="plain">Constant RTP_CANTMAKEPART = 63;</span>
|
||
|
<span class="plain">Constant RTP_TEXTTOKENTOOHARD = 64;</span>
|
||
|
<span class="plain">Constant RTP_TABLE_NOTABLE2 = 65;</span>
|
||
|
<span class="plain">Constant RTP_RELATIONCHANGEIMPOSSIBLE = 66;</span>
|
||
|
<span class="plain">Constant RTP_RELMINIMAL = 67;</span>
|
||
|
<span class="plain">Constant RTP_LISTSIZENEGATIVE = 68;</span>
|
||
|
<span class="plain">Constant RTP_REGIONSNOTADJACENT = 69;</span>
|
||
|
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP10"></a><b>§10. Template Activities. </b>These are the activities defined in the Standard Rules. Most, though not
|
||
|
all, are carried out by explicit function calls in the template layer,
|
||
|
which is why we need their ID numbers: note that NI assigns each activity a
|
||
|
unique ID number on creation, counting upwards from 0, and that it
|
||
|
processes the Standard Rules before any other source text. (These numbers
|
||
|
must correspond both to those in the source of NI, and to the
|
||
|
creation sequence in the Standard Rules.)
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Constant STARTING_VIRTUAL_MACHINE_ACT = 0;</span>
|
||
|
<span class="plain">Constant PRINTING_RESPONSE_ACT = 1;</span>
|
||
|
|
||
|
<span class="plain">Constant PRINTING_THE_NAME_ACT = 2;</span>
|
||
|
<span class="plain">Constant PRINTING_THE_PLURAL_NAME_ACT = 3;</span>
|
||
|
<span class="plain">Constant PRINTING_A_NUMBER_OF_ACT = 4;</span>
|
||
|
<span class="plain">Constant PRINTING_ROOM_DESC_DETAILS_ACT = 5;</span>
|
||
|
<span class="plain">Constant PRINTING_INVENTORY_DETAILS_ACT = 6;</span>
|
||
|
<span class="plain">Constant LISTING_CONTENTS_ACT = 7;</span>
|
||
|
<span class="plain">Constant GROUPING_TOGETHER_ACT = 8;</span>
|
||
|
<span class="plain">Constant WRITING_A_PARAGRAPH_ABOUT_ACT = 9;</span>
|
||
|
<span class="plain">Constant LISTING_NONDESCRIPT_ITEMS_ACT = 10;</span>
|
||
|
|
||
|
<span class="plain">Constant PRINTING_NAME_OF_DARK_ROOM_ACT = 11;</span>
|
||
|
<span class="plain">Constant PRINTING_DESC_OF_DARK_ROOM_ACT = 12;</span>
|
||
|
<span class="plain">Constant PRINTING_NEWS_OF_DARKNESS_ACT = 13;</span>
|
||
|
<span class="plain">Constant PRINTING_NEWS_OF_LIGHT_ACT = 14;</span>
|
||
|
<span class="plain">Constant REFUSAL_TO_ACT_IN_DARK_ACT = 15;</span>
|
||
|
|
||
|
<span class="plain">Constant CONSTRUCTING_STATUS_LINE_ACT = 16;</span>
|
||
|
<span class="plain">Constant PRINTING_BANNER_TEXT_ACT = 17;</span>
|
||
|
|
||
|
<span class="plain">Constant READING_A_COMMAND_ACT = 18;</span>
|
||
|
<span class="plain">Constant DECIDING_SCOPE_ACT = 19;</span>
|
||
|
<span class="plain">Constant DECIDING_CONCEALED_POSSESS_ACT = 20;</span>
|
||
|
<span class="plain">Constant DECIDING_WHETHER_ALL_INC_ACT = 21;</span>
|
||
|
<span class="plain">Constant CLARIFYING_PARSERS_CHOICE_ACT = 22;</span>
|
||
|
<span class="plain">Constant ASKING_WHICH_DO_YOU_MEAN_ACT = 23;</span>
|
||
|
<span class="plain">Constant PRINTING_A_PARSER_ERROR_ACT = 24;</span>
|
||
|
<span class="plain">Constant SUPPLYING_A_MISSING_NOUN_ACT = 25;</span>
|
||
|
<span class="plain">Constant SUPPLYING_A_MISSING_SECOND_ACT = 26;</span>
|
||
|
<span class="plain">Constant IMPLICITLY_TAKING_ACT = 27;</span>
|
||
|
|
||
|
<span class="plain">Constant AMUSING_A_VICTORIOUS_PLAYER_ACT = 28;</span>
|
||
|
<span class="plain">Constant PRINTING_PLAYERS_OBITUARY_ACT = 29;</span>
|
||
|
<span class="plain">Constant DEALING_WITH_FINAL_QUESTION_ACT = 30;</span>
|
||
|
|
||
|
<span class="plain">Constant PRINTING_LOCALE_DESCRIPTION_ACT = 31;</span>
|
||
|
<span class="plain">Constant CHOOSING_NOTABLE_LOCALE_OBJ_ACT = 32;</span>
|
||
|
<span class="plain">Constant PRINTING_LOCALE_PARAGRAPH_ACT = 33;</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP11"></a><b>§11. Template Rulebooks. </b>Rulebooks are created in a similar way, and again are numbered upwards from
|
||
|
0 in order of creation. These are the ones used in the template layer.
|
||
|
(These numbers must correspond both to those in the source of NI,
|
||
|
and to the creation sequence in the Standard Rules.)
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Constant STARTUP_RB = 0;</span>
|
||
|
<span class="plain">Constant SHUTDOWN_RB = 1;</span>
|
||
|
|
||
|
<span class="plain">Constant TURN_SEQUENCE_RB = 2;</span>
|
||
|
|
||
|
<span class="plain">Constant WHEN_PLAY_BEGINS_RB = 4;</span>
|
||
|
<span class="plain">Constant WHEN_PLAY_ENDS_RB = 5;</span>
|
||
|
<span class="plain">Constant WHEN_SCENE_BEGINS_RB = 6;</span>
|
||
|
<span class="plain">Constant WHEN_SCENE_ENDS_RB = 7;</span>
|
||
|
|
||
|
<span class="plain">Constant ACTION_PROCESSING_RB = 9;</span>
|
||
|
<span class="plain">Constant SETTING_ACTION_VARIABLES_RB = 10;</span>
|
||
|
<span class="plain">Constant SPECIFIC_ACTION_PROCESSING_RB = 11;</span>
|
||
|
|
||
|
<span class="plain">Constant ACCESSIBILITY_RB = 13;</span>
|
||
|
<span class="plain">Constant REACHING_INSIDE_RB = 14;</span>
|
||
|
<span class="plain">Constant REACHING_OUTSIDE_RB = 15;</span>
|
||
|
<span class="plain">Constant VISIBLE_RB = 16;</span>
|
||
|
|
||
|
<span class="plain">Constant PERSUADE_RB = 17;</span>
|
||
|
<span class="plain">Constant UNSUCCESSFUL_ATTEMPT_RB = 18;</span>
|
||
|
|
||
|
<span class="plain">Constant AFTER_RB = 23;</span>
|
||
|
<span class="plain">Constant REPORT_RB = 24;</span>
|
||
|
|
||
|
<span class="plain">Constant MULTIPLE_ACTION_PROCESSING_RB = 26;</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP12"></a><b>§12. Kind IDs. </b>These are filled in automatically by NI, and have the same names as are used
|
||
|
in the NI source (and in the Load-.i6t sections): for instance <code class="display"><span class="extract">NUMBER_TY</span></code>.
|
||
|
</p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP13"></a><b>§13. Parser Error Numbers. </b>The traditional ways in which the I6 library's parser, which we adopt here
|
||
|
more or less intact, can give up on a player's command. See the Inform
|
||
|
Designer's Manual}, 4th edition, for details.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Constant STUCK_PE = 1;</span>
|
||
|
<span class="plain">Constant UPTO_PE = 2;</span>
|
||
|
<span class="plain">Constant NUMBER_PE = 3;</span>
|
||
|
<span class="plain">Constant ANIMA_PE = 4;</span>
|
||
|
<span class="plain">Constant CANTSEE_PE = 5;</span>
|
||
|
<span class="plain">Constant TOOLIT_PE = 6;</span>
|
||
|
<span class="plain">Constant NOTHELD_PE = 7;</span>
|
||
|
<span class="plain">Constant MULTI_PE = 8;</span>
|
||
|
<span class="plain">Constant MMULTI_PE = 9;</span>
|
||
|
<span class="plain">Constant VAGUE_PE = 10;</span>
|
||
|
<span class="plain">Constant EXCEPT_PE = 11;</span>
|
||
|
<span class="plain">Constant VERB_PE = 12;</span>
|
||
|
<span class="plain">Constant SCENERY_PE = 13;</span>
|
||
|
<span class="plain">Constant ITGONE_PE = 14;</span>
|
||
|
<span class="plain">Constant JUNKAFTER_PE = 15;</span>
|
||
|
<span class="plain">Constant TOOFEW_PE = 16;</span>
|
||
|
<span class="plain">Constant NOTHING_PE = 17;</span>
|
||
|
<span class="plain">Constant ASKSCOPE_PE = 18;</span>
|
||
|
<span class="plain">Constant NOTINCONTEXT_PE = 19;</span>
|
||
|
<span class="plain">Constant BLANKLINE_PE = 20; ! Not formally a parser error, but used by I7 as if</span>
|
||
|
<span class="plain">Constant ANIMAAGAIN_PE = 21;</span>
|
||
|
<span class="plain">Constant COMMABEGIN_PE = 22;</span>
|
||
|
<span class="plain">Constant MISSINGPERSON_PE = 23;</span>
|
||
|
<span class="plain">Constant ANIMALISTEN_PE = 24;</span>
|
||
|
<span class="plain">Constant TOTALK_PE = 25;</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP14"></a><b>§14. Scope Searching Reasons. </b>The parser makes use of a mechanism for searching through the objects currently
|
||
|
"in scope", which basically means visible to the actor who would perform the
|
||
|
action envisaged by the command being parsed. It is sometimes useful to
|
||
|
behave differently depending on why this scope searching is being done, so
|
||
|
the following constants enumerate the possibilities.
|
||
|
</p>
|
||
|
|
||
|
<p class="inwebparagraph">I6's <code class="display"><span class="extract">EACH_TURN_REASON</span></code>, <code class="display"><span class="extract">REACT_BEFORE_REASON</span></code> and <code class="display"><span class="extract">REACT_AFTER_REASON</span></code>
|
||
|
have been removed from this list as no longer meaningful; hence the lacuna
|
||
|
in numbering.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Constant PARSING_REASON = 0;</span>
|
||
|
<span class="plain">Constant TALKING_REASON = 1;</span>
|
||
|
<span class="plain">Constant EACH_TURN_REASON = 2;</span>
|
||
|
<span class="plain">Constant LOOPOVERSCOPE_REASON = 5;</span>
|
||
|
<span class="plain">Constant TESTSCOPE_REASON = 6;</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP15"></a><b>§15. Token Types. </b>Tokens are the indecomposable pieces of a grammar line making up a possible
|
||
|
reading of a command; some are literal words, others stand for "any named
|
||
|
object in scope", and so on. The following codes identify the possibilities.
|
||
|
The <code class="display"><span class="extract">*_TOKEN</span></code> constants must not be altered without modifying the I6 compiler
|
||
|
to match (so, basically, they must not be altered at all).
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Constant ILLEGAL_TT = 0; ! Types of grammar token: illegal</span>
|
||
|
<span class="plain">Constant ELEMENTARY_TT = 1; ! (one of those below)</span>
|
||
|
<span class="plain">Constant PREPOSITION_TT = 2; ! e.g. 'into'</span>
|
||
|
<span class="plain">Constant ROUTINE_FILTER_TT = 3; ! e.g. noun=CagedCreature</span>
|
||
|
<span class="plain">Constant ATTR_FILTER_TT = 4; ! e.g. edible</span>
|
||
|
<span class="plain">Constant SCOPE_TT = 5; ! e.g. scope=Spells</span>
|
||
|
<span class="plain">Constant GPR_TT = 6; ! a general parsing routine</span>
|
||
|
|
||
|
<span class="plain">Constant NOUN_TOKEN = 0; ! The elementary grammar tokens, and</span>
|
||
|
<span class="plain">Constant HELD_TOKEN = 1; ! the numbers compiled by I6 to</span>
|
||
|
<span class="plain">Constant MULTI_TOKEN = 2; ! encode them</span>
|
||
|
<span class="plain">Constant MULTIHELD_TOKEN = 3;</span>
|
||
|
<span class="plain">Constant MULTIEXCEPT_TOKEN = 4;</span>
|
||
|
<span class="plain">Constant MULTIINSIDE_TOKEN = 5;</span>
|
||
|
<span class="plain">Constant CREATURE_TOKEN = 6;</span>
|
||
|
<span class="plain">Constant SPECIAL_TOKEN = 7;</span>
|
||
|
<span class="plain">Constant NUMBER_TOKEN = 8;</span>
|
||
|
<span class="plain">Constant TOPIC_TOKEN = 9;</span>
|
||
|
<span class="plain">Constant ENDIT_TOKEN = 15; ! Value used to mean "end of grammar line"</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP16"></a><b>§16. GPR Return Values. </b>GRP stands for "General Parsing Routine", an I6 routine which acts as a
|
||
|
grammar token: again, see the Inform Designer's Manual, 4th edition,
|
||
|
for details.
|
||
|
</p>
|
||
|
|
||
|
<p class="inwebparagraph">In Library 6/11, <code class="display"><span class="extract">GPR_NOUN</span></code> is defined as <code class="display"><span class="extract">$ff00</span></code>, but this would fail on
|
||
|
Glulx: it needs to be <code class="display"><span class="extract">$ffffff00</span></code> on 32-bit virtual machines. It appears that
|
||
|
<code class="display"><span class="extract">GPR_NOUN</span></code> to <code class="display"><span class="extract">GPR_CREATURE</span></code>, though documented in the old Inform
|
||
|
Translator's Manual}, were omitted when this was consolidated into the DM4,
|
||
|
so that they effectively disappeared from view. But they might still be
|
||
|
useful for implementing inflected forms of nouns, so we have retained them
|
||
|
here regardless.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Constant GPR_FAIL = -1; ! Return values from General Parsing</span>
|
||
|
<span class="plain">Constant GPR_PREPOSITION = 0; ! Routines</span>
|
||
|
<span class="plain">Constant GPR_NUMBER = 1;</span>
|
||
|
<span class="plain">Constant GPR_MULTIPLE = 2;</span>
|
||
|
<span class="plain">Constant GPR_REPARSE = REPARSE_CODE;</span>
|
||
|
<span class="plain">Constant GPR_NOUN = -256; ! Reparse, but as |NOUN_TOKEN| this time</span>
|
||
|
<span class="plain">Constant GPR_HELD = GPR_NOUN + 1; ! And so on</span>
|
||
|
<span class="plain">Constant GPR_MULTI = GPR_NOUN + 2;</span>
|
||
|
<span class="plain">Constant GPR_MULTIHELD = GPR_NOUN + 3;</span>
|
||
|
<span class="plain">Constant GPR_MULTIEXCEPT = GPR_NOUN + 4;</span>
|
||
|
<span class="plain">Constant GPR_MULTIINSIDE = GPR_NOUN + 5;</span>
|
||
|
<span class="plain">Constant GPR_CREATURE = GPR_NOUN + 6;</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP17"></a><b>§17. List Styles. </b>These constants make up bitmaps of the options in use when listing objects.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Constant NEWLINE_BIT = $$0000000000000001; ! New-line after each entry</span>
|
||
|
<span class="plain">Constant INDENT_BIT = $$0000000000000010; ! Indent each entry by depth</span>
|
||
|
<span class="plain">Constant FULLINV_BIT = $$0000000000000100; ! Full inventory information after entry</span>
|
||
|
<span class="plain">Constant ENGLISH_BIT = $$0000000000001000; ! English sentence style, with commas and and</span>
|
||
|
<span class="plain">Constant RECURSE_BIT = $$0000000000010000; ! Recurse downwards with usual rules</span>
|
||
|
<span class="plain">Constant ALWAYS_BIT = $$0000000000100000; ! Always recurse downwards</span>
|
||
|
<span class="plain">Constant TERSE_BIT = $$0000000001000000; ! More terse English style</span>
|
||
|
<span class="plain">Constant PARTINV_BIT = $$0000000010000000; ! Only brief inventory information after entry</span>
|
||
|
<span class="plain">Constant DEFART_BIT = $$0000000100000000; ! Use the definite article in list</span>
|
||
|
<span class="plain">Constant WORKFLAG_BIT = $$0000001000000000; ! At top level (only), only list objects</span>
|
||
|
<span class="plain">! which have the "workflag" attribute</span>
|
||
|
<span class="plain">Constant ISARE_BIT = $$0000010000000000; ! Print " is" or " are" before list</span>
|
||
|
<span class="plain">Constant CONCEAL_BIT = $$0000100000000000; ! Omit objects with "concealed" or "scenery":</span>
|
||
|
<span class="plain">! if WORKFLAG_BIT also set, then does not</span>
|
||
|
<span class="plain">! apply at top level, but does lower down</span>
|
||
|
<span class="plain">Constant NOARTICLE_BIT = $$0001000000000000; ! Print no articles, definite or not</span>
|
||
|
<span class="plain">Constant EXTRAINDENT_BIT = $$0010000000000000; ! New in I7: extra indentation of 1 level</span>
|
||
|
<span class="plain">Constant CFIRSTART_BIT = $$0100000000000000; ! Capitalise first article in list</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP18"></a><b>§18. Lengths Of Time. </b>Inform measures time in minutes.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Constant QUARTER_HOUR = 15;</span>
|
||
|
<span class="plain">Constant HALF_HOUR = 30;</span>
|
||
|
<span class="plain">Constant ONE_HOUR = 60;</span>
|
||
|
<span class="plain">Constant TWELVE_HOURS = 720;</span>
|
||
|
<span class="plain">Constant TWENTY_FOUR_HOURS = 1440;</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP19"></a><b>§19. Empty Text. </b>The I6 compiler does not optimise string compilation: if it needs to compile
|
||
|
the (packed, read-only) string <code class="display"><span class="extract">"exemplum"</span></code> twice, it will compile two copies.
|
||
|
This is slightly wasteful on memory, though in practice the loss is not
|
||
|
enough for us to care. But we do want to avoid this in I7 because, to make
|
||
|
string-sorting algorithms more efficient, we want direct numerical comparison
|
||
|
of packed addresses to be equivalent to string comparison: and that means
|
||
|
the text "exemplum" has to be compiled once and once only. There's a
|
||
|
general mechanism for this in NI, but the single case most often needed
|
||
|
is the empty text, since this is the default value for text variables
|
||
|
and properties: we give it a name as follows.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Constant EMPTY_TEXT_PACKED "";</span>
|
||
|
<span class="plain">Array EMPTY_TEXT_VALUE --> CONSTANT_PACKED_TEXT_STORAGE EMPTY_TEXT_PACKED;</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP20"></a><b>§20. Empty Table. </b>Similarly: the default value for the "table" kind of value, a Table
|
||
|
containing no rows and no columns.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Array TheEmptyTable --> 0 0;</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP21"></a><b>§21. Empty Set. </b>The falsity proposition describes the empty set of objects, and is the
|
||
|
zero value for the "description" kind of value.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">[ Prop_Falsity reason obj; return 0; ];</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP22"></a><b>§22. Template Attributes. </b>An I6 attribute is equivalent to an I7 "either/or property", though the
|
||
|
latter are not always translated into I6 attributes because the Z-machine
|
||
|
has only a limited number of attributes to use. Here, we define attributes
|
||
|
used by the template.
|
||
|
</p>
|
||
|
|
||
|
<p class="inwebparagraph">Many concepts in I6 correspond directly to their successors in I7, even if
|
||
|
details may vary. (Value properties are a case in point.) Attributes are
|
||
|
the opposite of this: indeed, no I6 concept is more fragmented in its I7
|
||
|
equivalents. All but one of the old I6 library attributes are still used
|
||
|
(the <code class="display"><span class="extract">general</span></code> attribute, for miscellaneous use, has been removed: it more
|
||
|
often invited abuse than use); and a few new attributes have been added.
|
||
|
But they are used for a variety of purposes. Some do correspond exactly to
|
||
|
either/or properties in I7, but others are a sort of signature for I7
|
||
|
kinds. (So that for I7 use they are read-only.) Others still are used by
|
||
|
the template layer as part of the implementation of services for I7, but
|
||
|
are not visible to I7 source text as storage.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Attribute absent; ! Used to mark objects removed from play</span>
|
||
|
<span class="plain">Attribute animate; ! I6-level marker for I7 kind "person"</span>
|
||
|
<span class="plain">Attribute clothing; ! = I7 "wearable"</span>
|
||
|
<span class="plain">Attribute concealed; ! = I7 "undescribed"</span>
|
||
|
<span class="plain">Attribute container; ! I6-level marker for I7 kind "container"</span>
|
||
|
<span class="plain">Attribute door; ! I6-level marker for I7 kind "door"</span>
|
||
|
<span class="plain">Attribute edible; ! = I7 "edible" vs "inedible"</span>
|
||
|
<span class="plain">Attribute enterable; ! = I7 "enterable"</span>
|
||
|
<span class="plain">Attribute light; ! = I7 "lighted" vs "dark"</span>
|
||
|
<span class="plain">Attribute lockable; ! = I7 "lockable"</span>
|
||
|
<span class="plain">Attribute locked; ! = I7 "locked"</span>
|
||
|
<span class="plain">Attribute moved; ! = I7 "handled"</span>
|
||
|
<span class="plain">Attribute on; ! = I7 "switched on" vs "switched off"</span>
|
||
|
<span class="plain">Attribute open; ! = I7 "open" vs "closed"</span>
|
||
|
<span class="plain">Attribute openable; ! = I7 "openable"</span>
|
||
|
<span class="plain">Attribute scenery; ! = I7 "scenery"</span>
|
||
|
<span class="plain">Attribute static; ! = I7 "fixed in place" vs "portable"</span>
|
||
|
<span class="plain">Attribute supporter; ! I6-level marker for I7 kind "supporter"</span>
|
||
|
<span class="plain">Attribute switchable; ! I6-level marker for I7 kind "device"</span>
|
||
|
<span class="plain">Attribute talkable; ! Not currently used by I7, but retained for possible future use</span>
|
||
|
<span class="plain">Attribute transparent; ! = I7 "transparent" vs "opaque"</span>
|
||
|
<span class="plain">Attribute visited; ! = I7 "visited"</span>
|
||
|
<span class="plain">Attribute worn; ! marks that an object tree edge represents wearing</span>
|
||
|
|
||
|
<span class="plain">Attribute male; ! not directly used by I7, but available for languages with genders</span>
|
||
|
<span class="plain">Attribute female; ! = I7 "female" vs "male"</span>
|
||
|
<span class="plain">Attribute neuter; ! = I7 "neuter"</span>
|
||
|
<span class="plain">Attribute pluralname; ! = I7 "plural-named"</span>
|
||
|
<span class="plain">Attribute ambigpluralname; ! = I7 "ambiguously plural"</span>
|
||
|
<span class="plain">Attribute proper; ! = I7 "proper-named"</span>
|
||
|
<span class="plain">Attribute remove_proper; ! remember to remove proper again when using ChangePlayer next</span>
|
||
|
|
||
|
<span class="plain">Attribute privately_named; ! New in I7</span>
|
||
|
<span class="plain">Attribute mentioned; ! New in I7</span>
|
||
|
<span class="plain">Attribute pushable; ! New in I7</span>
|
||
|
|
||
|
<span class="plain">Attribute mark_as_room; ! Used in I7 to speed up testing "ofclass K1_room"</span>
|
||
|
<span class="plain">Attribute mark_as_thing; ! Used in I7 to speed up testing "ofclass K2_thing"</span>
|
||
|
|
||
|
<span class="plain">Attribute workflag; ! = I7 "marked for listing", but basically temporary workspace</span>
|
||
|
<span class="plain">Attribute workflag2; ! new in I7 and also temporary workspace</span>
|
||
|
<span class="plain">Constant list_filter_permits = privately_named; ! another I7 listwriter convenience</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP23"></a><b>§23. Template Properties. </b>As remarked above, these more often correspond to value properties in I7.
|
||
|
To an experienced I6 user, though, the death toll of abolished I6
|
||
|
properties in I7 is breathtaking: in alphabetical order, <code class="display"><span class="extract">after</span></code>,
|
||
|
<code class="display"><span class="extract">cant_go</span></code>, <code class="display"><span class="extract">daemon</span></code>, <code class="display"><span class="extract">each_turn</span></code>, <code class="display"><span class="extract">invent</span></code>, <code class="display"><span class="extract">life</span></code>, <code class="display"><span class="extract">number</span></code>, <code class="display"><span class="extract">orders</span></code>,
|
||
|
<code class="display"><span class="extract">react_after</span></code>, <code class="display"><span class="extract">react_before</span></code>, <code class="display"><span class="extract">time_left</span></code>, <code class="display"><span class="extract">time_out</span></code>, <code class="display"><span class="extract">when_closed</span></code>,
|
||
|
<code class="display"><span class="extract">when_off</span></code>, <code class="display"><span class="extract">when_on</span></code>, <code class="display"><span class="extract">when_open</span></code>. In May 2008, the direction properties
|
||
|
<code class="display"><span class="extract">n_to</span></code>, <code class="display"><span class="extract">s_to</span></code>, <code class="display"><span class="extract">e_to</span></code>, ..., <code class="display"><span class="extract">out_to</span></code> joined the list of the missing.
|
||
|
</p>
|
||
|
|
||
|
<p class="inwebparagraph">The losses are numerous because of the shift from I6's object orientation
|
||
|
to I7's rule orientation: information about the behaviour of objects is no
|
||
|
longer thought of as data attached to them. At that, it could have been
|
||
|
worse: a few unused I6 library properties have been retained for possible
|
||
|
future use.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Property add_to_scope; ! used as in I6 to place component parts in scope</span>
|
||
|
<span class="plain">Property article "a"; ! used as in I6 to implement articles</span>
|
||
|
<span class="plain">Property capacity 100; ! = I7 "carrying capacity"</span>
|
||
|
<span class="plain">Property component_child; ! new in I7: forest structure holding "part of" relation</span>
|
||
|
<span class="plain">Property component_parent; ! new in I7</span>
|
||
|
<span class="plain">Property component_sibling; ! new in I7</span>
|
||
|
<span class="plain">Property description; ! = I7 "description"</span>
|
||
|
<span class="plain">Property door_dir; ! used to implement two-sided doors, but holds direction object, not a property</span>
|
||
|
<span class="plain">Property door_to; ! used as in I6 to implement two-sided doors</span>
|
||
|
<span class="plain">Property found_in; ! used as in I6 to implement two-sided doors and backdrops</span>
|
||
|
<span class="plain">Property initial; ! = I7 "initial description"</span>
|
||
|
<span class="plain">Property list_together; ! used as in I6 to implement "grouping together" activity</span>
|
||
|
<span class="plain">Property map_region; ! new in I7</span>
|
||
|
<span class="plain">Property parse_name 0; ! used as in I6 to implement "Understand... as..." grammars</span>
|
||
|
<span class="plain">Property plural; ! used as in I6 to implement plural names for duplicate objects</span>
|
||
|
<span class="plain">Property regional_found_in; ! new in I7</span>
|
||
|
<span class="plain">Property room_index; ! new in I7: storage for route-finding</span>
|
||
|
<span class="plain">Property short_name 0; ! = I7 "printed name"</span>
|
||
|
<span class="plain">Property vector; ! new in I7: storage for route-finding</span>
|
||
|
<span class="plain">Property with_key; ! = I7 "matching key"</span>
|
||
|
|
||
|
<span class="plain">Property KD_Count; ! Instance count of the kind of the current object</span>
|
||
|
<span class="plain">Property IK1_Count; ! These are instance counts within kinds K1, K2, ...</span>
|
||
|
<span class="plain">Property IK2_Count; ! and it is efficient to declare the common ones with Property</span>
|
||
|
<span class="plain">Property IK4_Count; ! since this results in a slightly smaller story file</span>
|
||
|
<span class="plain">Property IK5_Count;</span>
|
||
|
<span class="plain">Property IK6_Count;</span>
|
||
|
<span class="plain">Property IK8_Count;</span>
|
||
|
<span class="plain">Property IK3_Count;</span>
|
||
|
|
||
|
<span class="plain">Property IK1_link; ! These are for linked lists used to make searches faster</span>
|
||
|
<span class="plain">Property IK2_link; ! and again it's memory-efficient to declare the common ones</span>
|
||
|
<span class="plain">Property IK5_link; !</span>
|
||
|
<span class="plain">Property IK6_link; !</span>
|
||
|
<span class="plain">Property IK8_link; !</span>
|
||
|
|
||
|
<span class="plain">Property articles; ! not used by I7, but an interesting hook in the parser</span>
|
||
|
<span class="plain">Property grammar; ! not used by I7, but an interesting hook in the parser</span>
|
||
|
<span class="plain">Property inside_description; ! not used by I7, but an interesting hook in the locale code</span>
|
||
|
<span class="plain">Property short_name_indef 0; ! not used by I7, but an interesting hook in the listmaker</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP24"></a><b>§24. Action Count. </b>The number of valid I7 actions in existence.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Constant ActionCount = CCOUNT_ACTION_NAME;</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP25"></a><b>§25. Fake Actions. </b>Though sometimes useful for I6 coding tricks, fake actions — action numbers
|
||
|
not corresponding to any action, but different from those of valid actions,
|
||
|
and useable with a number of action syntaxes — are not conceptually present
|
||
|
in I7 source text. They can only really exist at the I6 level because I6 is
|
||
|
typeless; in I7 terms, there is no convenient kind of value which could
|
||
|
represent both actions and fake actions while protecting each from confusion
|
||
|
with the other.
|
||
|
</p>
|
||
|
|
||
|
<p class="inwebparagraph">See the Inform Designer's Manual, 4th edition, for what these are
|
||
|
used for.
|
||
|
</p>
|
||
|
|
||
|
<p class="inwebparagraph">The following fake actions from the I6 library have been dropped here:
|
||
|
<code class="display"><span class="extract">##LetGo</span></code>, <code class="display"><span class="extract">##Receive</span></code>, <code class="display"><span class="extract">##ThrownAt</span></code>, <code class="display"><span class="extract">##Prompt</span></code>, <code class="display"><span class="extract">##Places</span></code>, <code class="display"><span class="extract">##Objects</span></code>,
|
||
|
<code class="display"><span class="extract">##Order</span></code>, <code class="display"><span class="extract">##NotUnderstood</span></code>.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Fake_Action ListMiscellany;</span>
|
||
|
<span class="plain">Fake_Action Miscellany;</span>
|
||
|
<span class="plain">Fake_Action PluralFound;</span>
|
||
|
<span class="plain">Fake_Action TheSame;</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP26"></a><b>§26. Formal Parameters. </b>These are needed for efficient run-time ambiguity resolution.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Global formal_rv;</span>
|
||
|
<span class="plain">Global formal_par0;</span>
|
||
|
<span class="plain">Global formal_par1;</span>
|
||
|
<span class="plain">Global formal_par2;</span>
|
||
|
<span class="plain">Global formal_par3;</span>
|
||
|
<span class="plain">Global formal_par4;</span>
|
||
|
<span class="plain">Global formal_par5;</span>
|
||
|
<span class="plain">Global formal_par6;</span>
|
||
|
<span class="plain">Global formal_par7;</span>
|
||
|
<span class="plain">Global unicode_temp;</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<p class="inwebparagraph"><a id="SP27"></a><b>§27. Template Configuration. </b>To minimise the need for conditional compilation in the template, the
|
||
|
constant <code class="display"><span class="extract">TEMPLATE_CONFIGURATION_BITMAP</span></code> must be generated by the user
|
||
|
(i.e., by I7). It's made up of these bits:
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<pre class="display">
|
||
|
<span class="plain">Constant USE_SCORING_TCBIT = 1;</span>
|
||
|
<span class="plain">Constant PREVENT_UNDO_TCBIT = 2;</span>
|
||
|
<span class="plain">Constant SERIAL_COMMA_TCBIT = 4;</span>
|
||
|
<span class="plain">Constant PROGRAMMING_EXPONENTS_TCBIT = 8;</span>
|
||
|
<span class="plain">Constant FIX_RNG_TCBIT = 16;</span>
|
||
|
<span class="plain">Constant ECHO_COMMANDS_TCBIT = 32;</span>
|
||
|
<span class="plain">Constant NO_VERB_VERB_DEFINED_TCBIT = 64;</span>
|
||
|
<span class="plain">Constant DIALECT_US_TCBIT = 128;</span>
|
||
|
<span class="plain">Constant STORY_AUTHOR_TCBIT = 256;</span>
|
||
|
<span class="plain">Constant RANKING_TABLE_TCBIT = 512;</span>
|
||
|
</pre>
|
||
|
|
||
|
<p class="inwebparagraph"></p>
|
||
|
|
||
|
<hr class="tocbar">
|
||
|
<ul class="toc"><li><a href="S-ct2.html">Back to 'Combinations Template'</a></li><li><a href="S-ft.html">Continue with 'FileIO Template'</a></li></ul><hr class="tocbar">
|
||
|
<!--End of weave-->
|
||
|
</body>
|
||
|
</html>
|
||
|
|