mirror of
https://github.com/ganelson/inform.git
synced 2024-07-05 00:24:22 +03:00
1164 lines
57 KiB
HTML
1164 lines
57 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<title>S/cg</title>
|
|
<meta name="viewport" content="width=device-width initial-scale=1">
|
|
<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>
|
|
<nav role="navigation">
|
|
<h1><a href="../webs.html">Sources</a></h1>
|
|
<ul>
|
|
<li><a href="../compiler.html">compiler</a></li>
|
|
<li><a href="../other.html">other tools</a></li>
|
|
<li><a href="../extensions.html"><b>extensions and kits</b></a></li>
|
|
<li><a href="../units.html">unit test tools</a></li>
|
|
/ul>
|
|
<h2>Extensions</h2>
|
|
<ul>
|
|
<li><a href="../basic_inform/index.html">Basic Inform</a></li>
|
|
<li><a href="../standard_rules/index.html">Standard Rules</a></li>
|
|
</ul>
|
|
<h2>Kits</h2>
|
|
<ul>
|
|
<li><a href="../BasicInformKit/index.html">BasicInformKit</a></li>
|
|
<li><a href="../BasicInformExtrasKit/index.html">BasicInformExtrasKit</a></li>
|
|
<li><a href="../CommandParserKit/index.html">CommandParserKit</a></li>
|
|
<li><a href="../EnglishLanguageKit/index.html">EnglishLanguageKit</a></li>
|
|
<li><a href="../WorldModelKit/index.html">WorldModelKit</a></li>
|
|
</ul>
|
|
|
|
|
|
</nav>
|
|
<main role="main">
|
|
|
|
<!--Weave of 'S/pd' generated by 7-->
|
|
<ul class="crumbs"><li><a href="../webs.html">Source</a></li><li><a href="../extensions.html">Extensions</a></li><li><a href="index.html">srules</a></li><li><b>Phrase Definitions</b></li></ul><p class="purpose">Additional phrases to do with interactive fiction, to add to the much larger collection provided by Basic Inform; and the final sign-off of the Standard Rules extension, including its minimal documentation.</p>
|
|
|
|
<ul class="toc"><li><a href="#SP5">§5. Using the list-writer</a></li><li><a href="#SP7">§7. Grouping in the list-writer</a></li><li><a href="#SP8">§8. Filtering in the list-writer</a></li><li><a href="#SP9">§9. Figures and sound effects</a></li><li><a href="#SP10">§10. Actions, activities and rules</a></li><li><a href="#SP14">§14. The model world</a></li><li><a href="#SP26">§26. Understanding</a></li><li><a href="#SP31">§31. Message support</a></li><li><a href="#SP32">§32. Deprecated or private-API-like phrases</a></li></ul><hr class="tocbar">
|
|
|
|
<p class="inwebparagraph"><a id="SP1"></a><b>§1. </b>The following is inevitably a bit of a miscellany. Firstly, there's no
|
|
model of the passage of time in Basic Inform, so:
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Part Seven - Phrasebook</span>
|
|
|
|
<span class="plain">Chapter 1 - Saying</span>
|
|
|
|
<span class="plain">Section 1 - Time Values</span>
|
|
|
|
<span class="plain">To say (something - time) in words</span>
|
|
<span class="plain">(documented at phs_timewords):</span>
|
|
<span class="plain">(- print (PrintTimeOfDayEnglish) {something}; -).</span>
|
|
<span class="plain">To say here</span>
|
|
<span class="plain">(documented at phs_here):</span>
|
|
<span class="plain">say "[if story tense is present tense]here[otherwise]there".</span>
|
|
<span class="plain">To say now</span>
|
|
<span class="plain">(documented at phs_now):</span>
|
|
<span class="plain">say "[if story tense is present tense]now[otherwise]then".</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP2"></a><b>§2. </b>The ability to put up a dinky reverse-video quotation as an epigraph
|
|
has somehow survived for 36 years. The decision to continue to support it
|
|
even in Inform 6 was critiqued as being an unnecessary throwback by Jimmy
|
|
Maher in 2019; he was clearly right; and yet here we are, and it survives
|
|
even the 2020 restructuring of Inform's language design.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 2 - Boxed quotations</span>
|
|
|
|
<span class="plain">To display the boxed quotation (Q - text)</span>
|
|
<span class="plain">(documented at ph_boxed):</span>
|
|
<span class="plain">(- DisplayBoxedQuotation({-box-quotation-text:Q}); -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP3"></a><b>§3. </b>And now some oddball special texts which must sometimes be said.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 3 - Some built-in texts</span>
|
|
|
|
<span class="plain">To say the/-- banner text</span>
|
|
<span class="plain">(documented at phs_banner):</span>
|
|
<span class="plain">(- Banner(); -).</span>
|
|
<span class="plain">To say the/-- list of extension credits</span>
|
|
<span class="plain">(documented at phs_extcredits):</span>
|
|
<span class="plain">(- ShowExtensionVersions(); -).</span>
|
|
<span class="plain">To say the/-- complete list of extension credits</span>
|
|
<span class="plain">(documented at phs_compextcredits):</span>
|
|
<span class="plain">(- ShowFullExtensionVersions(); -).</span>
|
|
<span class="plain">To say the/-- player's surroundings</span>
|
|
<span class="plain">(documented at phs_surroundings):</span>
|
|
<span class="plain">(- SL_Location(true); -).</span>
|
|
<span class="plain">To say run paragraph on with special look spacing -- running on</span>
|
|
<span class="plain">(documented at phs_runparaonsls):</span>
|
|
<span class="plain">(- SpecialLookSpacingBreak(); -).</span>
|
|
<span class="plain">To say command clarification break -- running on</span>
|
|
<span class="plain">(documented at phs_clarifbreak):</span>
|
|
<span class="plain">(- CommandClarificationBreak(); -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP4"></a><b>§4. </b>Recall that this activity exists only in the Standard Rules, and therefore
|
|
this phrase definition must similarly be here, not in Basic Inform.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 4 - Responses</span>
|
|
|
|
<span class="plain">To say text of (R - response)</span>
|
|
<span class="plain">(documented at phs_response):</span>
|
|
<span class="plain">carry out the issuing the response text activity with R.</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP5"></a><b>§5. Using the list-writer. </b>One of the most powerful features of Inform 6 was its list-writer, a lengthy
|
|
piece of I6 code wbich now lives on as Inter code, in the <code class="display"><span class="extract">srules</span></code> template:
|
|
see "ListWriter.i6t". The following phrases control it:
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 5 - Saying lists of things</span>
|
|
|
|
<span class="plain">To list the contents of (O - an object),</span>
|
|
<span class="plain">with newlines,</span>
|
|
<span class="plain">indented,</span>
|
|
<span class="plain">giving inventory information,</span>
|
|
<span class="plain">as a sentence,</span>
|
|
<span class="plain">including contents,</span>
|
|
<span class="plain">including all contents,</span>
|
|
<span class="plain">tersely,</span>
|
|
<span class="plain">giving brief inventory information,</span>
|
|
<span class="plain">using the definite article,</span>
|
|
<span class="plain">listing marked items only,</span>
|
|
<span class="plain">prefacing with is/are,</span>
|
|
<span class="plain">not listing concealed items,</span>
|
|
<span class="plain">suppressing all articles,</span>
|
|
<span class="plain">with extra indentation,</span>
|
|
<span class="plain">and/or capitalized</span>
|
|
<span class="plain">(documented at ph_listcontents):</span>
|
|
<span class="plain">(- WriteListFrom(child({O}), {phrase options}); -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP6"></a><b>§6. </b>These text substitutions all look (and are) repetitive. We want to avoid
|
|
passing a description value to some routine, because that's tricky if the
|
|
description needs to refer to a value local to the current stack frame. (There
|
|
are ways round that, but it minimises nuisance to avoid the need.) So we mark
|
|
out the set of objects matching by giving them, and only them, the <code class="display"><span class="extract">workflag2</span></code>
|
|
attribute.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">To say a list of (OS - description of objects)</span>
|
|
<span class="plain">(documented at phs_alistof): (-</span>
|
|
<span class="plain">objectloop({-my:1} ofclass Object)</span>
|
|
<span class="plain">if ({-matches-description:1:OS})</span>
|
|
<span class="plain">give {-my:1} workflag2;</span>
|
|
<span class="plain">else</span>
|
|
<span class="plain">give {-my:1} ~workflag2;</span>
|
|
<span class="plain">WriteListOfMarkedObjects(ENGLISH_BIT);</span>
|
|
<span class="plain">-).</span>
|
|
<span class="plain">To say A list of (OS - description of objects)</span>
|
|
<span class="plain">(documented at phs_Alistof):</span>
|
|
<span class="plain">(-</span>
|
|
<span class="plain">objectloop({-my:1} ofclass Object)</span>
|
|
<span class="plain">if ({-matches-description:1:OS})</span>
|
|
<span class="plain">give {-my:1} workflag2;</span>
|
|
<span class="plain">else</span>
|
|
<span class="plain">give {-my:1} ~workflag2;</span>
|
|
<span class="plain">TEXT_TY_Say_Capitalised((+ "[list-writer list of marked objects]" +));</span>
|
|
<span class="plain">-).</span>
|
|
|
|
<span class="plain">To say list of (OS - description of objects)</span>
|
|
<span class="plain">(documented at phs_listof): (-</span>
|
|
<span class="plain">objectloop({-my:1} ofclass Object)</span>
|
|
<span class="plain">if ({-matches-description:1:OS})</span>
|
|
<span class="plain">give {-my:1} workflag2;</span>
|
|
<span class="plain">else</span>
|
|
<span class="plain">give {-my:1} ~workflag2;</span>
|
|
<span class="plain">WriteListOfMarkedObjects(ENGLISH_BIT+NOARTICLE_BIT);</span>
|
|
<span class="plain">-).</span>
|
|
<span class="plain">To say the list of (OS - description of objects)</span>
|
|
<span class="plain">(documented at phs_thelistof): (-</span>
|
|
<span class="plain">objectloop({-my:1} ofclass Object)</span>
|
|
<span class="plain">if ({-matches-description:1:OS})</span>
|
|
<span class="plain">give {-my:1} workflag2;</span>
|
|
<span class="plain">else</span>
|
|
<span class="plain">give {-my:1} ~workflag2;</span>
|
|
<span class="plain">WriteListOfMarkedObjects(ENGLISH_BIT+DEFART_BIT);</span>
|
|
<span class="plain">-).</span>
|
|
<span class="plain">To say The list of (OS - description of objects)</span>
|
|
<span class="plain">(documented at phs_Thelistof):</span>
|
|
<span class="plain">(-</span>
|
|
<span class="plain">objectloop({-my:1} ofclass Object)</span>
|
|
<span class="plain">if ({-matches-description:1:OS})</span>
|
|
<span class="plain">give {-my:1} workflag2;</span>
|
|
<span class="plain">else</span>
|
|
<span class="plain">give {-my:1} ~workflag2;</span>
|
|
<span class="plain">TEXT_TY_Say_Capitalised((+ "[list-writer articled list of marked objects]" +));</span>
|
|
<span class="plain">-).</span>
|
|
<span class="plain">To say is-are a list of (OS - description of objects)</span>
|
|
<span class="plain">(documented at phs_isalistof): (-</span>
|
|
<span class="plain">objectloop({-my:1} ofclass Object)</span>
|
|
<span class="plain">if ({-matches-description:1:OS})</span>
|
|
<span class="plain">give {-my:1} workflag2;</span>
|
|
<span class="plain">else</span>
|
|
<span class="plain">give {-my:1} ~workflag2;</span>
|
|
<span class="plain">WriteListOfMarkedObjects(ENGLISH_BIT+ISARE_BIT);</span>
|
|
<span class="plain">-).</span>
|
|
<span class="plain">To say is-are list of (OS - description of objects)</span>
|
|
<span class="plain">(documented at phs_islistof): (-</span>
|
|
<span class="plain">objectloop({-my:1} ofclass Object)</span>
|
|
<span class="plain">if ({-matches-description:1:OS})</span>
|
|
<span class="plain">give {-my:1} workflag2;</span>
|
|
<span class="plain">else</span>
|
|
<span class="plain">give {-my:1} ~workflag2;</span>
|
|
<span class="plain">WriteListOfMarkedObjects(ENGLISH_BIT+ISARE_BIT+NOARTICLE_BIT);</span>
|
|
<span class="plain">-).</span>
|
|
<span class="plain">To say is-are the list of (OS - description of objects)</span>
|
|
<span class="plain">(documented at phs_isthelistof): (-</span>
|
|
<span class="plain">objectloop({-my:1} ofclass Object)</span>
|
|
<span class="plain">if ({-matches-description:1:OS})</span>
|
|
<span class="plain">give {-my:1} workflag2;</span>
|
|
<span class="plain">else</span>
|
|
<span class="plain">give {-my:1} ~workflag2;</span>
|
|
<span class="plain">WriteListOfMarkedObjects(ENGLISH_BIT+DEFART_BIT+ISARE_BIT);</span>
|
|
<span class="plain">-).</span>
|
|
<span class="plain">To say a list of (OS - description of objects) including contents</span>
|
|
<span class="plain">(documented at phs_alistofconts): (-</span>
|
|
<span class="plain">objectloop({-my:1} ofclass Object)</span>
|
|
<span class="plain">if ({-matches-description:1:OS})</span>
|
|
<span class="plain">give {-my:1} workflag2;</span>
|
|
<span class="plain">else</span>
|
|
<span class="plain">give {-my:1} ~workflag2;</span>
|
|
<span class="plain">WriteListOfMarkedObjects(ENGLISH_BIT+RECURSE_BIT+PARTINV_BIT+</span>
|
|
<span class="plain">TERSE_BIT+CONCEAL_BIT);</span>
|
|
<span class="plain">-).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP7"></a><b>§7. Grouping in the list-writer. </b>See the specifications of <code class="display"><span class="extract">list_together</span></code> and <code class="display"><span class="extract">c_style</span></code> in the DM4, which are
|
|
still broadly accurate.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 6 - Group in and omit from lists</span>
|
|
|
|
<span class="plain">To group (OS - description of objects) together</span>
|
|
<span class="plain">(documented at ph_group): (-</span>
|
|
<span class="plain">objectloop({-my:1} provides list_together)</span>
|
|
<span class="plain">if ({-matches-description:1:OS})</span>
|
|
<span class="plain">BlkValueCopy({-my:1}.list_together, {-list-together:unarticled});</span>
|
|
<span class="plain">-).</span>
|
|
<span class="plain">To group (OS - description of objects) together giving articles</span>
|
|
<span class="plain">(documented at ph_groupart): (-</span>
|
|
<span class="plain">objectloop({-my:1} provides list_together)</span>
|
|
<span class="plain">if ({-matches-description:1:OS})</span>
|
|
<span class="plain">BlkValueCopy({-my:1}.list_together, {-list-together:articled});</span>
|
|
<span class="plain">-).</span>
|
|
<span class="plain">To group (OS - description of objects) together as (T - text)</span>
|
|
<span class="plain">(documented at ph_grouptext): (-</span>
|
|
<span class="plain">{-my:2} = BlkValueCreate(TEXT_TY);</span>
|
|
<span class="plain">{-my:2} = TEXT_TY_SubstitutedForm({-my:2}, {-by-reference:T});</span>
|
|
<span class="plain">objectloop({-my:1} provides list_together)</span>
|
|
<span class="plain">if ({-matches-description:1:OS})</span>
|
|
<span class="plain">BlkValueCopy({-my:1}.list_together, {-my:2});</span>
|
|
<span class="plain">BlkValueFree({-my:2});</span>
|
|
<span class="plain">-).</span>
|
|
<span class="plain">To omit contents in listing</span>
|
|
<span class="plain">(documented at ph_omit):</span>
|
|
<span class="plain">(- c_style = c_style &~ (RECURSE_BIT+FULLINV_BIT+PARTINV_BIT); -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP8"></a><b>§8. Filtering in the list-writer. </b>Something of a last resort, which is intentionally not documented.
|
|
It's needed by the Standard Rules to tidy up an implementation and
|
|
avoid I6, but is not an ideal trick and may be dropped in later
|
|
builds. Recursion occurs when the list-writer descends to the contents
|
|
of, or items supported by, something it lists. Here we can restrict to
|
|
just those contents, or supportees, matching a description <code class="display"><span class="extract">D</span></code>.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 7 - Filtering contents of lists - Unindexed</span>
|
|
|
|
<span class="plain">To filter list recursion to (D - description of objects):</span>
|
|
<span class="plain">(- list_filter_routine = {D}; -).</span>
|
|
<span class="plain">To unfilter list recursion:</span>
|
|
<span class="plain">(- list_filter_routine = 0; -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP9"></a><b>§9. Figures and sound effects. </b></p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Chapter 2 - Multimedia</span>
|
|
|
|
<span class="plain">Section 1 - Figures (for figures language element only)</span>
|
|
|
|
<span class="plain">To display (F - figure name), one time only</span>
|
|
<span class="plain">(documented at ph_displayfigure):</span>
|
|
<span class="plain">(- DisplayFigure(ResourceIDsOfFigures-->{F}, {phrase options}); -).</span>
|
|
<span class="plain">To decide which number is the Glulx resource ID of (F - figure name)</span>
|
|
<span class="plain">(documented at ph_figureid):</span>
|
|
<span class="plain">(- ResourceIDsOfFigures-->{F} -).</span>
|
|
|
|
<span class="plain">Section 2 - Sound effects (for sounds language element only)</span>
|
|
|
|
<span class="plain">To play (SFX - sound name), one time only</span>
|
|
<span class="plain">(documented at ph_playsf):</span>
|
|
<span class="plain">(- PlaySound(ResourceIDsOfSounds-->{SFX}, {phrase options}); -).</span>
|
|
<span class="plain">To decide which number is the Glulx resource ID of (SFX - sound name)</span>
|
|
<span class="plain">(documented at ph_soundid):</span>
|
|
<span class="plain">(- ResourceIDsOfSounds-->{SFX} -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP10"></a><b>§10. Actions, activities and rules. </b>We begin with the firing off of new actions. The current action runs silently
|
|
if the I6 global variable <code class="display"><span class="extract">keep_silent</span></code> is set, so the result of the
|
|
definitions below is that one can go into silence mode, using "try silently",
|
|
but not climb out of it again. This is done because many actions try other
|
|
actions as part of their normal workings: if we want action X to be tried
|
|
silently, then any action X itself tries should also be tried silently.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Chapter 3 - Actions, activities and rules</span>
|
|
|
|
<span class="plain">Section 1 - Trying actions</span>
|
|
|
|
<span class="plain">To try (S - action)</span>
|
|
<span class="plain">(documented at ph_try):</span>
|
|
<span class="plain">(- {-try-action:S} -).</span>
|
|
<span class="plain">To silently try (S - action)</span>
|
|
<span class="plain">(documented at ph_trysilently):</span>
|
|
<span class="plain">(- {-try-action-silently:S} -).</span>
|
|
<span class="plain">To try silently (S - action)</span>
|
|
<span class="plain">(documented at ph_trysilently):</span>
|
|
<span class="plain">(- {-try-action-silently:S} -).</span>
|
|
<span class="plain">To decide whether the action is not silent:</span>
|
|
<span class="plain">(- (keep_silent == false) -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP11"></a><b>§11. </b>The requirements of the current action can be tested. The following
|
|
may be reimplemented using a verb "to require" at some future point.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 2 - Action requirements</span>
|
|
|
|
<span class="plain">To decide whether the action requires a touchable noun</span>
|
|
<span class="plain">(documented at ph_requirestouch):</span>
|
|
<span class="plain">(- (NeedToTouchNoun()) -).</span>
|
|
<span class="plain">To decide whether the action requires a touchable second noun</span>
|
|
<span class="plain">(documented at ph_requirestouch2):</span>
|
|
<span class="plain">(- (NeedToTouchSecondNoun()) -).</span>
|
|
<span class="plain">To decide whether the action requires a carried noun</span>
|
|
<span class="plain">(documented at ph_requirescarried):</span>
|
|
<span class="plain">(- (NeedToCarryNoun()) -).</span>
|
|
<span class="plain">To decide whether the action requires a carried second noun</span>
|
|
<span class="plain">(documented at ph_requirescarried2):</span>
|
|
<span class="plain">(- (NeedToCarrySecondNoun()) -).</span>
|
|
<span class="plain">To decide whether the action requires light</span>
|
|
<span class="plain">(documented at ph_requireslight):</span>
|
|
<span class="plain">(- (NeedLightForAction()) -).</span>
|
|
|
|
<span class="plain">To anonymously abide by (RL - a rule)</span>
|
|
<span class="plain">(documented at ph_abideanon):</span>
|
|
<span class="plain">(- if (temporary_value = FollowRulebook({RL})) {</span>
|
|
<span class="plain">if (RulebookSucceeded()) ActRulebookSucceeds(temporary_value);</span>
|
|
<span class="plain">else ActRulebookFails(temporary_value);</span>
|
|
<span class="plain">return 2;</span>
|
|
<span class="plain">} -) - in to only.</span>
|
|
<span class="plain">To anonymously abide by (RL - value of kind K based rule producing a value) for (V - K)</span>
|
|
<span class="plain">(documented at ph_abideanon):</span>
|
|
<span class="plain">(- if (temporary_value = FollowRulebook({RL}, {V}, true)) {</span>
|
|
<span class="plain">if (RulebookSucceeded()) ActRulebookSucceeds(temporary_value);</span>
|
|
<span class="plain">else ActRulebookFails(temporary_value);</span>
|
|
<span class="plain">return 2;</span>
|
|
<span class="plain">} -) - in to only.</span>
|
|
<span class="plain">To anonymously abide by (RL - a nothing based rule)</span>
|
|
<span class="plain">(documented at ph_abideanon):</span>
|
|
<span class="plain">(- if (temporary_value = FollowRulebook({RL})) {</span>
|
|
<span class="plain">if (RulebookSucceeded()) ActRulebookSucceeds(temporary_value);</span>
|
|
<span class="plain">else ActRulebookFails(temporary_value);</span>
|
|
<span class="plain">return 2;</span>
|
|
<span class="plain">} -) - in to only.</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP12"></a><b>§12. </b>Within the rulebooks to do with an action, returning <code class="display"><span class="extract">true</span></code> from a rule
|
|
is sufficient to stop the rulebook early: there is no need to specify
|
|
success or failure because that is determined by the rulebook itself. (For
|
|
instance, if the check taking rules stop for any reason, the action failed;
|
|
if the after rules stop, it succeeded.) In some rulebooks, notably "instead"
|
|
and "after", the default is to stop, so that execution reaching the end of
|
|
the I6 routine for a rule will run into an <code class="display"><span class="extract">rtrue</span></code>. "Continue the action"
|
|
prevents this.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 3 - Stop or continue</span>
|
|
|
|
<span class="plain">To stop the action</span>
|
|
<span class="plain">(documented at ph_stopaction):</span>
|
|
<span class="plain">(- rtrue; -) - in to only.</span>
|
|
<span class="plain">To continue the action</span>
|
|
<span class="plain">(documented at ph_continueaction):</span>
|
|
<span class="plain">(- rfalse; -) - in to only.</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP13"></a><b>§13. </b></p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 4 - Actions as values</span>
|
|
|
|
<span class="plain">To decide what action is the current action</span>
|
|
<span class="plain">(documented at ph_currentaction):</span>
|
|
<span class="plain">(- STORED_ACTION_TY_Current({-new:action}) -).</span>
|
|
<span class="plain">To decide what action is the action of (A - action)</span>
|
|
<span class="plain">(documented at ph_actionof):</span>
|
|
<span class="plain">(- {A} -).</span>
|
|
<span class="plain">To decide if (act - a action) involves (X - an object)</span>
|
|
<span class="plain">(documented at ph_involves):</span>
|
|
<span class="plain">(- (STORED_ACTION_TY_Involves({-by-reference:act}, {X})) -).</span>
|
|
<span class="plain">To decide what action name is the action name part of (act - a action)</span>
|
|
<span class="plain">(documented at ph_actionpart):</span>
|
|
<span class="plain">(- (STORED_ACTION_TY_Part({-by-reference:act}, STORA_ACTION_F)) -).</span>
|
|
<span class="plain">To decide what object is the noun part of (act - a action)</span>
|
|
<span class="plain">(documented at ph_nounpart):</span>
|
|
<span class="plain">(- (STORED_ACTION_TY_Part({-by-reference:act}, STORA_NOUN_F)) -).</span>
|
|
<span class="plain">To decide what object is the second noun part of (act - a action)</span>
|
|
<span class="plain">(documented at ph_secondpart):</span>
|
|
<span class="plain">(- (STORED_ACTION_TY_Part({-by-reference:act}, STORA_SECOND_F)) -).</span>
|
|
<span class="plain">To decide what object is the actor part of (act - a action)</span>
|
|
<span class="plain">(documented at ph_actorpart):</span>
|
|
<span class="plain">(- (STORED_ACTION_TY_Part({-by-reference:act}, STORA_ACTOR_F)) -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP14"></a><b>§14. The model world. </b>Phrase definitions with wordings like "the story has ended" are a
|
|
necessary evil. The "has" here is parsed literally, not as the present
|
|
tense of "to have", so inflected forms like "the story had ended" are
|
|
not available: nor is there any value "the story" for the subject noun
|
|
phrase to hold... and so on. Ideally, we would word all conditional phrases
|
|
so as to avoid the verbs, but natural language just doesn't work that way.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Chapter 4 - The Model World</span>
|
|
|
|
<span class="plain">Section 1 - Ending the story</span>
|
|
|
|
<span class="plain">To end the story</span>
|
|
<span class="plain">(documented at ph_end):</span>
|
|
<span class="plain">(- deadflag=3; story_complete=false; -).</span>
|
|
<span class="plain">To end the story finally</span>
|
|
<span class="plain">(documented at ph_endfinally):</span>
|
|
<span class="plain">(- deadflag=3; story_complete=true; -).</span>
|
|
<span class="plain">To end the story saying (finale - text)</span>
|
|
<span class="plain">(documented at ph_endsaying):</span>
|
|
<span class="plain">(- deadflag={-by-reference:finale}; story_complete=false; -).</span>
|
|
<span class="plain">To end the story finally saying (finale - text)</span>
|
|
<span class="plain">(documented at ph_endfinallysaying):</span>
|
|
<span class="plain">(- deadflag={-by-reference:finale}; story_complete=true; -).</span>
|
|
<span class="plain">To decide whether the story has ended</span>
|
|
<span class="plain">(documented at ph_ended):</span>
|
|
<span class="plain">(- (deadflag~=0) -).</span>
|
|
<span class="plain">To decide whether the story has ended finally</span>
|
|
<span class="plain">(documented at ph_finallyended):</span>
|
|
<span class="plain">(- (story_complete) -).</span>
|
|
<span class="plain">To decide whether the story has not ended</span>
|
|
<span class="plain">(documented at ph_notended):</span>
|
|
<span class="plain">(- (deadflag==0) -).</span>
|
|
<span class="plain">To decide whether the story has not ended finally</span>
|
|
<span class="plain">(documented at ph_notfinallyended):</span>
|
|
<span class="plain">(- (story_complete==false) -).</span>
|
|
<span class="plain">To resume the story</span>
|
|
<span class="plain">(documented at ph_resume):</span>
|
|
<span class="plain">(- resurrect_please = true; -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP15"></a><b>§15. </b>Times of day.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 2 - Times of day</span>
|
|
|
|
<span class="plain">To decide which number is the minutes part of (t - time)</span>
|
|
<span class="plain">(documented at ph_minspart):</span>
|
|
<span class="plain">(- ({t}%ONE_HOUR) -).</span>
|
|
<span class="plain">To decide which number is the hours part of (t - time)</span>
|
|
<span class="plain">(documented at ph_hourspart):</span>
|
|
<span class="plain">(- ({t}/ONE_HOUR) -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP16"></a><b>§16. </b>Comparing times of day is inherently odd, because the day is
|
|
circular. Every 2 PM comes after a 1 PM, but it also comes before
|
|
another 1 PM. Where do we draw the meridian on this circle? The legal
|
|
day divides at midnight but for other purposes (daylight savings time,
|
|
for instance) society often chooses 2 AM as the boundary. Inform uses
|
|
4 AM instead as the least probable time through which play continues.
|
|
(Modulo a 24-hour clock, adding 20 hours is equivalent to subtracting
|
|
4 AM from the current time: hence the use of <code class="display"><span class="extract">20*ONE_HOUR</span></code> below.)
|
|
Thus 3:59 AM is after 4:00 AM, the former being at the very end of a
|
|
day, the latter at the very beginning.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">To decide if (t - time) is before (t2 - time)</span>
|
|
<span class="plain">(documented at ph_timebefore):</span>
|
|
<span class="plain">(- ((({t}+20*ONE_HOUR)%(TWENTY_FOUR_HOURS))<(({t2}+20*ONE_HOUR)%(TWENTY_FOUR_HOURS))) -).</span>
|
|
<span class="plain">To decide if (t - time) is after (t2 - time)</span>
|
|
<span class="plain">(documented at ph_timeafter):</span>
|
|
<span class="plain">(- ((({t}+20*ONE_HOUR)%(TWENTY_FOUR_HOURS))>(({t2}+20*ONE_HOUR)%(TWENTY_FOUR_HOURS))) -).</span>
|
|
<span class="plain">To decide which time is (t - time) before (t2 - time)</span>
|
|
<span class="plain">(documented at ph_shiftbefore):</span>
|
|
<span class="plain">(- (({t2}-{t}+TWENTY_FOUR_HOURS)%(TWENTY_FOUR_HOURS)) -).</span>
|
|
<span class="plain">To decide which time is (t - time) after (t2 - time)</span>
|
|
<span class="plain">(documented at ph_shiftafter):</span>
|
|
<span class="plain">(- (({t2}+{t}+TWENTY_FOUR_HOURS)%(TWENTY_FOUR_HOURS)) -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP17"></a><b>§17. </b>Durations are in effect casts from "number" to "time".
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 3 - Durations</span>
|
|
|
|
<span class="plain">To decide which time is (n - number) minutes</span>
|
|
<span class="plain">(documented at ph_durationmins):</span>
|
|
<span class="plain">(- (({n})%(TWENTY_FOUR_HOURS)) -).</span>
|
|
<span class="plain">To decide which time is (n - number) hours</span>
|
|
<span class="plain">(documented at ph_durationhours):</span>
|
|
<span class="plain">(- (({n}*ONE_HOUR)%(TWENTY_FOUR_HOURS)) -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP18"></a><b>§18. </b>Timed events.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 4 - Timed events</span>
|
|
|
|
<span class="plain">To (R - rule) in (t - number) turn/turns from now</span>
|
|
<span class="plain">(documented at ph_turnsfromnow):</span>
|
|
<span class="plain">(- SetTimedEvent({-mark-event-used:R}, {t}+1, 0); -).</span>
|
|
<span class="plain">To (R - rule) at (t - time)</span>
|
|
<span class="plain">(documented at ph_attime):</span>
|
|
<span class="plain">(- SetTimedEvent({-mark-event-used:R}, {t}, 1); -).</span>
|
|
<span class="plain">To (R - rule) in (t - time) from now</span>
|
|
<span class="plain">(documented at ph_timefromnow):</span>
|
|
<span class="plain">(- SetTimedEvent({-mark-event-used:R}, (the_time+{t})%(TWENTY_FOUR_HOURS), 1); -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP19"></a><b>§19. </b>Scenes.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 5 - Scenes</span>
|
|
|
|
<span class="plain">To decide if (sc - scene) has happened</span>
|
|
<span class="plain">(documented at ph_hashappened):</span>
|
|
<span class="plain">(- (scene_endings-->({sc}-1)) -).</span>
|
|
<span class="plain">To decide if (sc - scene) has not happened</span>
|
|
<span class="plain">(documented at ph_hasnothappened):</span>
|
|
<span class="plain">(- (scene_endings-->({sc}-1) == 0) -).</span>
|
|
<span class="plain">To decide if (sc - scene) has ended</span>
|
|
<span class="plain">(documented at ph_hasended):</span>
|
|
<span class="plain">(- (scene_endings-->({sc}-1) > 1) -).</span>
|
|
<span class="plain">To decide if (sc - scene) has not ended</span>
|
|
<span class="plain">(documented at ph_hasnotended):</span>
|
|
<span class="plain">(- (scene_endings-->({sc}-1) <= 1) -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP20"></a><b>§20. </b>Timing of scenes.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 6 - Timing of scenes</span>
|
|
|
|
<span class="plain">To decide which time is the time since (sc - scene) began</span>
|
|
<span class="plain">(documented at ph_scenetimesincebegan):</span>
|
|
<span class="plain">(- (SceneUtility({sc}, 1)) -).</span>
|
|
<span class="plain">To decide which time is the time when (sc - scene) began</span>
|
|
<span class="plain">(documented at ph_scenetimewhenbegan):</span>
|
|
<span class="plain">(- (SceneUtility({sc}, 2)) -).</span>
|
|
<span class="plain">To decide which time is the time since (sc - scene) ended</span>
|
|
<span class="plain">(documented at ph_scenetimesinceended):</span>
|
|
<span class="plain">(- (SceneUtility({sc}, 3)) -).</span>
|
|
<span class="plain">To decide which time is the time when (sc - scene) ended</span>
|
|
<span class="plain">(documented at ph_scenetimewhenended):</span>
|
|
<span class="plain">(- (SceneUtility({sc}, 4)) -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP21"></a><b>§21. </b>Player's identity and location.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 7 - Player's identity and location</span>
|
|
|
|
<span class="plain">To decide whether in darkness</span>
|
|
<span class="plain">(documented at ph_indarkness):</span>
|
|
<span class="plain">(- (location==thedark) -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP22"></a><b>§22. </b>Moving and removing things.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 8 - Moving and removing things</span>
|
|
|
|
<span class="plain">To move (something - object) to (something else - object),</span>
|
|
<span class="plain">without printing a room description</span>
|
|
<span class="plain">or printing an abbreviated room description</span>
|
|
<span class="plain">(documented at ph_move):</span>
|
|
<span class="plain">(- MoveObject({something}, {something else}, {phrase options}, false); -).</span>
|
|
<span class="plain">To remove (something - object) from play</span>
|
|
<span class="plain">(deprecated)</span>
|
|
<span class="plain">(documented at ph_remove):</span>
|
|
<span class="plain">(- RemoveFromPlay({something}); -).</span>
|
|
<span class="plain">To move (O - object) backdrop to all (D - description of objects)</span>
|
|
<span class="plain">(documented at ph_movebackdrop):</span>
|
|
<span class="plain">(- MoveBackdrop({O}, {D}); -).</span>
|
|
<span class="plain">To update backdrop positions</span>
|
|
<span class="plain">(documented at ph_updatebackdrop):</span>
|
|
<span class="plain">(- MoveFloatingObjects(); -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP23"></a><b>§23. </b>The map.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 9 - The map</span>
|
|
|
|
<span class="plain">To decide which room is location of (O - object)</span>
|
|
<span class="plain">(documented at ph_locationof):</span>
|
|
<span class="plain">(- LocationOf({O}) -).</span>
|
|
<span class="plain">To decide which room is room (D - direction) from/of (R1 - room)</span>
|
|
<span class="plain">(documented at ph_roomdirof):</span>
|
|
<span class="plain">(- MapConnection({R1},{D}) -).</span>
|
|
<span class="plain">To decide which door is door (D - direction) from/of (R1 - room)</span>
|
|
<span class="plain">(documented at ph_doordirof):</span>
|
|
<span class="plain">(- DoorFrom({R1},{D}) -).</span>
|
|
<span class="plain">To decide which object is the other side of (D - door) from (R1 - room)</span>
|
|
<span class="plain">(documented at ph_othersideof):</span>
|
|
<span class="plain">(- OtherSideOfDoor({D},{R1}) -).</span>
|
|
<span class="plain">To decide which object is the direction of (D - door) from (R1 - room)</span>
|
|
<span class="plain">(documented at ph_directionofdoor):</span>
|
|
<span class="plain">(- DirectionDoorLeadsIn({D},{R1}) -).</span>
|
|
<span class="plain">To decide which object is room-or-door (D - direction) from/of (R1 - room)</span>
|
|
<span class="plain">(documented at ph_roomordoor):</span>
|
|
<span class="plain">(- RoomOrDoorFrom({R1},{D}) -).</span>
|
|
<span class="plain">To change (D - direction) exit of (R1 - room) to (R2 - room)</span>
|
|
<span class="plain">(documented at ph_changeexit):</span>
|
|
<span class="plain">(- AssertMapConnection({R1},{D},{R2}); -).</span>
|
|
<span class="plain">To change (D - direction) exit of (R1 - room) to nothing/nowhere</span>
|
|
<span class="plain">(documented at ph_changenoexit):</span>
|
|
<span class="plain">(- AssertMapConnection({R1},{D},nothing); -).</span>
|
|
<span class="plain">To decide which room is the front side of (D - object)</span>
|
|
<span class="plain">(documented at ph_frontside):</span>
|
|
<span class="plain">(- FrontSideOfDoor({D}) -).</span>
|
|
<span class="plain">To decide which room is the back side of (D - object)</span>
|
|
<span class="plain">(documented at ph_backside):</span>
|
|
<span class="plain">(- BackSideOfDoor({D}) -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP24"></a><b>§24. </b>Route-finding.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 10 - Route-finding</span>
|
|
|
|
<span class="plain">To decide which object is best route from (R1 - object) to (R2 - object),</span>
|
|
<span class="plain">using doors or using even locked doors</span>
|
|
<span class="plain">(documented at ph_bestroute):</span>
|
|
<span class="plain">(- MapRouteTo({R1},{R2},0,{phrase options}) -).</span>
|
|
<span class="plain">To decide which number is number of moves from (R1 - object) to (R2 - object),</span>
|
|
<span class="plain">using doors or using even locked doors</span>
|
|
<span class="plain">(documented at ph_bestroutelength):</span>
|
|
<span class="plain">(- MapRouteTo({R1},{R2},0,{phrase options},true) -).</span>
|
|
<span class="plain">To decide which object is best route from (R1 - object) to (R2 - object) through</span>
|
|
<span class="plain">(RS - description of objects),</span>
|
|
<span class="plain">using doors or using even locked doors</span>
|
|
<span class="plain">(documented at ph_bestroutethrough):</span>
|
|
<span class="plain">(- MapRouteTo({R1},{R2},{RS},{phrase options}) -).</span>
|
|
<span class="plain">To decide which number is number of moves from (R1 - object) to (R2 - object) through</span>
|
|
<span class="plain">(RS - description of objects),</span>
|
|
<span class="plain">using doors or using even locked doors</span>
|
|
<span class="plain">(documented at ph_bestroutethroughlength):</span>
|
|
<span class="plain">(- MapRouteTo({R1},{R2},{RS},{phrase options},true) -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP25"></a><b>§25. </b>The object tree.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 11 - The object tree</span>
|
|
|
|
<span class="plain">To decide which object is holder of (something - object)</span>
|
|
<span class="plain">(documented at ph_holder):</span>
|
|
<span class="plain">(- (HolderOf({something})) -).</span>
|
|
<span class="plain">To decide which object is next thing held after (something - object)</span>
|
|
<span class="plain">(documented at ph_nextheld):</span>
|
|
<span class="plain">(- (sibling({something})) -).</span>
|
|
<span class="plain">To decide which object is first thing held by (something - object)</span>
|
|
<span class="plain">(documented at ph_firstheld):</span>
|
|
<span class="plain">(- (child({something})) -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP26"></a><b>§26. Understanding. </b>First, asking yes/no questions.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Chapter 5 - Understanding</span>
|
|
|
|
<span class="plain">Section 1 - Asking yes/no questions</span>
|
|
|
|
<span class="plain">To decide whether player consents</span>
|
|
<span class="plain">(documented at ph_consents):</span>
|
|
<span class="plain">(- YesOrNo() -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP27"></a><b>§27. </b>Support for snippets, which are substrings of the player's command. This
|
|
is a kind of value which doesm't exist in Basic Inform.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 2 - The player's command</span>
|
|
|
|
<span class="plain">To decide if (S - a snippet) matches (T - a topic)</span>
|
|
<span class="plain">(documented at ph_snippetmatches):</span>
|
|
<span class="plain">(- (SnippetMatches({S}, {T})) -).</span>
|
|
<span class="plain">To decide if (S - a snippet) does not match (T - a topic)</span>
|
|
<span class="plain">(documented at ph_snippetdoesnotmatch):</span>
|
|
<span class="plain">(- (SnippetMatches({S}, {T}) == false) -).</span>
|
|
<span class="plain">To decide if (S - a snippet) includes (T - a topic)</span>
|
|
<span class="plain">(documented at ph_snippetincludes):</span>
|
|
<span class="plain">(- (matched_text=SnippetIncludes({T},{S})) -).</span>
|
|
<span class="plain">To decide if (S - a snippet) does not include (T - a topic)</span>
|
|
<span class="plain">(documented at ph_snippetdoesnotinclude):</span>
|
|
<span class="plain">(- (SnippetIncludes({T},{S})==0) -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP28"></a><b>§28. </b>Changing the player's command.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 3 - Changing the player's command</span>
|
|
|
|
<span class="plain">To change the text of the player's command to (T - text)</span>
|
|
<span class="plain">(documented at ph_changecommand):</span>
|
|
<span class="plain">(- SetPlayersCommand({-by-reference:T}); -).</span>
|
|
<span class="plain">To replace (S - a snippet) with (T - text)</span>
|
|
<span class="plain">(documented at ph_replacesnippet):</span>
|
|
<span class="plain">(- SpliceSnippet({S}, {-by-reference:T}); -).</span>
|
|
<span class="plain">To cut (S - a snippet)</span>
|
|
<span class="plain">(documented at ph_cutsnippet):</span>
|
|
<span class="plain">(- SpliceSnippet({S}, 0); -).</span>
|
|
<span class="plain">To reject the player's command</span>
|
|
<span class="plain">(documented at ph_rejectcommand):</span>
|
|
<span class="plain">(- RulebookFails(); rtrue; -) - in to only.</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP29"></a><b>§29. </b>Scope and pronouns.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 4 - Scope and pronouns</span>
|
|
|
|
<span class="plain">To place (O - an object) in scope, but not its contents</span>
|
|
<span class="plain">(documented at ph_placeinscope):</span>
|
|
<span class="plain">(- PlaceInScope({O}, {phrase options}); -).</span>
|
|
<span class="plain">To place the/-- contents of (O - an object) in scope</span>
|
|
<span class="plain">(documented at ph_placecontentsinscope):</span>
|
|
<span class="plain">(- ScopeWithin({O}); -).</span>
|
|
<span class="plain">To set pronouns from (O - an object)</span>
|
|
<span class="plain">(documented at ph_setpronouns):</span>
|
|
<span class="plain">(- PronounNotice({O}); -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP30"></a><b>§30. </b>The multiple object list is a data structure used in the parser when
|
|
processing commands like TAKE ALL.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 5 - The multiple object list</span>
|
|
|
|
<span class="plain">To decide what list of objects is the multiple object list</span>
|
|
<span class="plain">(documented at ph_multipleobjectlist):</span>
|
|
<span class="plain">(- LIST_OF_TY_Mol({-new:list of objects}) -).</span>
|
|
<span class="plain">To alter the multiple object list to (L - list of objects)</span>
|
|
<span class="plain">(documented at ph_altermultipleobjectlist):</span>
|
|
<span class="plain">(- LIST_OF_TY_Set_Mol({-by-reference:L}); -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP31"></a><b>§31. Message support. </b>"Unindexed" here is a euphemism for "undocumented". This is where
|
|
experimental or intermediate phrases go: things we don't want people
|
|
to use because we will probably revise them heavily in later builds of
|
|
Inform. For now, the Standard Rules do make use of these phrases, but
|
|
nobody else should. They will change without comment in the change
|
|
log.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section SR5/8/1 - Message support - Issuance - Unindexed</span>
|
|
|
|
<span class="plain">To issue score notification message:</span>
|
|
<span class="plain">(- NotifyTheScore(); -).</span>
|
|
<span class="plain">To say pronoun dictionary word:</span>
|
|
<span class="plain">(- print (address) pronoun_word; -).</span>
|
|
<span class="plain">To say recap of command:</span>
|
|
<span class="plain">(- PrintCommand(); -).</span>
|
|
<span class="plain">The pronoun reference object is an object that varies.</span>
|
|
<span class="plain">The pronoun reference object variable translates into I6 as "pronoun_obj".</span>
|
|
|
|
<span class="plain">To say pronoun i6 dictionary word:</span>
|
|
<span class="plain">(- print (address) pronoun_word; -).</span>
|
|
|
|
<span class="plain">To say parser command so far:</span>
|
|
<span class="plain">(- PrintCommand(); -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP32"></a><b>§32. Deprecated or private-API-like phrases. </b>None of these are part of Inform's public specification, and they should be
|
|
used only by extensions built in to Inform; they may change at any time.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Chapter 6 - Deprecated or private phrases - Unindexed</span>
|
|
|
|
<span class="plain">Section 1 - Spatial modelling - Unindexed</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP33"></a><b>§33. </b>These are actually sensible concepts in the world model, and could even
|
|
be opened to public use, but they're quite complicated to explain.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">To decide which object is the component parts core of (X - an object):</span>
|
|
<span class="plain">(- CoreOf({X}) -).</span>
|
|
<span class="plain">To decide which object is the common ancestor of (O - an object) with</span>
|
|
<span class="plain">(P - an object):</span>
|
|
<span class="plain">(- (CommonAncestor({O}, {P})) -).</span>
|
|
<span class="plain">To decide which object is the not-counting-parts holder of (O - an object):</span>
|
|
<span class="plain">(- (CoreOfParentOfCoreOf({O})) -).</span>
|
|
<span class="plain">To decide which object is the visibility-holder of (O - object):</span>
|
|
<span class="plain">(- VisibilityParent({O}) -).</span>
|
|
<span class="plain">To calculate visibility ceiling at low level:</span>
|
|
<span class="plain">(- FindVisibilityLevels(); -).</span>
|
|
<span class="plain">To decide which object is the touchability ceiling of (O - object):</span>
|
|
<span class="plain">(- TouchabilityCeiling({O}) -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP34"></a><b>§34. </b>These are in effect global variables, but aren't defined as such, to
|
|
prevent people using them. Their contents are only very briefly meaningful,
|
|
and they would be dangerous friends to know.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">To decide which number is the visibility ceiling count calculated:</span>
|
|
<span class="plain">(- visibility_levels -).</span>
|
|
<span class="plain">To decide which object is the visibility ceiling calculated:</span>
|
|
<span class="plain">(- visibility_ceiling -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP35"></a><b>§35. </b>This is a unique quasi-action, using the secondary action processing
|
|
stage only. A convenience, but also an anomaly, and let's not encourage
|
|
its further use.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 2 - Room descriptions - Unindexed</span>
|
|
|
|
<span class="plain">To produce a room description with going spacing conventions:</span>
|
|
<span class="plain">(- LookAfterGoing(); -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP36"></a><b>§36. </b>An ugly little trick needed because of the mismatch between I6 and I7
|
|
property implementation, and because of legacy code from the old I6 library.
|
|
Please don't touch.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">To print the location's description:</span>
|
|
<span class="plain">(- PrintOrRun(location, description); -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP37"></a><b>§37. </b>The following cries out for an enumerated kind of value, but for historical
|
|
reasons it isn't one.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">To decide if set to sometimes abbreviated room descriptions:</span>
|
|
<span class="plain">(- (lookmode == 1) -).</span>
|
|
<span class="plain">To decide if set to unabbreviated room descriptions:</span>
|
|
<span class="plain">(- (lookmode == 2) -).</span>
|
|
<span class="plain">To decide if set to abbreviated room descriptions:</span>
|
|
<span class="plain">(- (lookmode == 3) -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP38"></a><b>§38. </b>Action conversion is a trick used in the Standard Rules to simplify the
|
|
implementation of actions: it allows one action to become another one
|
|
mid-way, without causing spurious action failures. (There are better ways
|
|
to make user-defined actions convert, and some of the examples show this.)
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 3 - Action conversion - Unindexed</span>
|
|
|
|
<span class="plain">To convert to (AN - an action name) on (O - an object):</span>
|
|
<span class="plain">(- return GVS_Convert({AN},{O},0); -) - in to only.</span>
|
|
<span class="plain">To convert to request of (X - object) to perform (AN - action name) with</span>
|
|
<span class="plain">(Y - object) and (Z - object):</span>
|
|
<span class="plain">(- return ConvertToRequest({X}, {AN}, {Y}, {Z}); -).</span>
|
|
<span class="plain">To convert to special going-with-push action:</span>
|
|
<span class="plain">(- return ConvertToGoingWithPush(); -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP39"></a><b>§39. </b>The "surreptitiously" phrases shouldn't be used except in the Standard Rules
|
|
because they temporarily violate invariants for the object tree and the
|
|
light variables; the SR uses them carefully in situations where it's known to
|
|
work out all right.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 4 - Surreptitious violation of invariants - Unindexed</span>
|
|
|
|
<span class="plain">To surreptitiously move (something - object) to (something else - object):</span>
|
|
<span class="plain">(- move {something} to {something else}; -).</span>
|
|
<span class="plain">To surreptitiously move (something - object) to (something else - object) during going:</span>
|
|
<span class="plain">(- MoveDuringGoing({something}, {something else}); -).</span>
|
|
<span class="plain">To surreptitiously reckon darkness:</span>
|
|
<span class="plain">(- SilentlyConsiderLight(); -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP40"></a><b>§40. </b>These are text substitutions needed to make the capitalised lists work.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 5 - Capitalised list-writing - Unindexed</span>
|
|
|
|
<span class="plain">To say list-writer list of marked objects: (-</span>
|
|
<span class="plain">WriteListOfMarkedObjects(ENGLISH_BIT);</span>
|
|
<span class="plain">-).</span>
|
|
<span class="plain">To say list-writer articled list of marked objects: (-</span>
|
|
<span class="plain">WriteListOfMarkedObjects(ENGLISH_BIT+DEFART_BIT+CFIRSTART_BIT);</span>
|
|
<span class="plain">-).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP41"></a><b>§41. </b>This avoids "mentioned" being given to items printed only internally for
|
|
the sake of a string comparison, and not shown on screen.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 6 - Printing names - Unindexed</span>
|
|
|
|
<span class="plain">To decide if expanding text for comparison purposes:</span>
|
|
<span class="plain">(- say__comp -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP42"></a><b>§42. </b>This is a bit trickier than it looks, because it isn't always set when
|
|
one thinks it is. (And since first typing that sentence, I've forgotten
|
|
when that would be.)
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 7 - Command parsing - Unindexed</span>
|
|
|
|
<span class="plain">To decide whether the I6 parser is running multiple actions:</span>
|
|
<span class="plain">(- (multiflag==1) -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP43"></a><b>§43. </b>The antique forms "yes" and "no" are now somewhat to be regretted, with
|
|
"decide yes" and "decide no" being clearer ways to write the same thing.
|
|
But we seem to be stuck with them.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 8 - Deprecated Inform - unindexed</span>
|
|
|
|
<span class="plain">To yes</span>
|
|
<span class="plain">(documented at ph_yes):</span>
|
|
<span class="plain">(- rtrue; -) - in to decide if only.</span>
|
|
<span class="plain">To no</span>
|
|
<span class="plain">(documented at ph_no):</span>
|
|
<span class="plain">(- rfalse; -) - in to decide if only.</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP44"></a><b>§44. </b>This is convenient for debugging Inform, but for no other purpose. It
|
|
toggles verbose logging of the type-checker.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">Section 9 - Debugging Inform - Unindexed</span>
|
|
|
|
<span class="plain">To ***:</span>
|
|
<span class="plain">(- {-primitive-definition:verbose-checking} -).</span>
|
|
<span class="plain">To *** (T - text):</span>
|
|
<span class="plain">(- {-primitive-definition:verbose-checking} -).</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP45"></a><b>§45. </b>And so, at last...
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">The Standard Rules end here.</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<p class="inwebparagraph"><a id="SP46"></a><b>§46. </b>...except that this is not quite true, because like most extensions they
|
|
then quote some documentation for Inform to weave into index pages: though
|
|
here it's more of a polite refusal than a manual, since the entire system
|
|
documentation is really the description of what was defined in this
|
|
extension.
|
|
</p>
|
|
|
|
|
|
<pre class="display">
|
|
<span class="plain">---- DOCUMENTATION ----</span>
|
|
|
|
<span class="plain">Unlike other extensions, the Standard Rules are compulsorily included</span>
|
|
<span class="plain">with every work of interactive fiction made with Inform. They are described</span>
|
|
<span class="plain">throughout the documentation supplied with Inform, so no details will be</span>
|
|
<span class="plain">given here.</span>
|
|
</pre>
|
|
|
|
<p class="inwebparagraph"></p>
|
|
|
|
<hr class="tocbar">
|
|
<ul class="toc"><li><a href="S-cg.html">Back to 'Command Grammar'</a></li><li><i>(This section ends Sections.)</i></li></ul><hr class="tocbar">
|
|
<!--End of weave-->
|
|
</main>
|
|
</body>
|
|
</html>
|
|
|