We must not forget a couple of tiny details in the café room:
-.. code-block:: inform6
+.. code-block:: inform
Object food "Benny's snacks" cafe
with name 'food' 'pastry' 'pastries' 'sandwich' 'sandwiches' 'snack'
And a not-so-trivial object:
-.. code-block:: inform6
+.. code-block:: inform
Object coffee "cup of coffee" benny
with name 'cup' 'of' 'coffee' 'steaming' 'cappuccino'
There's not a lot about the toilet room and its contents, though there
will be some tricky side effects:
-.. code-block:: inform6
+.. code-block:: inform
Room toilet "Unisex toilet"
with description
mentioned in the room's description to aid players in their dressing
duties.
-.. code-block:: inform6
+.. code-block:: inform
Appliance light_switch "light switch" toilet
with name 'light' 'switch',
course, set or clear it manually like any other attribute, with the
``give`` statement:
-.. code-block:: inform6
+.. code-block:: inform
give self on;
and check if a ``switchable`` object is on or off with the test:
-.. code-block:: inform6
+.. code-block:: inform
if (light_switch has on) ...
A ``switchable`` object is OFF by default. However, you’ll notice that
the has line of the object definition includes ``~on`` :
-.. code-block:: inform6
+.. code-block:: inform
has switchable ~on;
Surely that’s saying "not-on"? Surely that's what would have happened
anyway if the line hadn't mentioned the attribute at all?
-.. code-block:: inform6
+.. code-block:: inform
has switchable;
object to account for this. A couple of lines in the after property will
suffice:
-.. code-block:: inform6
+.. code-block:: inform
after [ ks;
Unlock:
routines``" of our game -- after the ``Initialise`` routine, for
instance -- include the following lines:
-.. code-block:: inform6
+.. code-block:: inform
[ InScope person;
if (person == player && location == thedark && real_location == toilet) {
So the test:
-.. code-block:: inform6
+.. code-block:: inform
if (person == player && location == thedark && real_location == toilet) ...
have ``moved``. Here is the reworked ``InScope`` routine. There are a
couple of new concepts to look at:
-.. code-block:: inform6
+.. code-block:: inform
[ InScope person item;
if (person == player && location == thedark && real_location == toilet) {
dark rooms (well, the only dark room in the game *is* the toilet, but we
are trying to provide a general rule).
-.. todo::
+ :samp:`objectloop (variable) {statement};`
- Lots of italicized typewriter stuff here...
+is a loop statement, one of the four defined in Inform. A loop statement is
+a construct that allows you to run several times through a statement (or a
+statement block). ``objectloop`` performs the :samp:`{statement}` once for
+every object defined in the (``variable``) . If we were to code:
-.. code-block:: inform6
+ :samp:`objectloop (item) {statement};`
- objectloop (variable) statement;
+then the :samp:`{statement}` would be executed once for each object in the
+game. However, we want to perform the statement only for those objects
+whose parent object is the same as the player's parent object: that is, for
+objects in the same room as the player, so we instead code:
-is a loop statement, one of the four defined in Inform. A loop statement
-is a construct that allows you to run several times through a statement
-(or a statement block). ``objectloop`` performs the ``statement`` once
-for every object defined in the (``variable``) . If we were to code:
+ :samp:`objectloop (item in parent(player)) {statement};`
-.. code-block:: inform6
+What is the actual :samp:`{statement}` that we'll repeatedly execute?
- objectloop (item) statement;
-
-then the ``statement`` would be executed once for each object in the
-game. However, we want to perform the statement only for those objects
-whose parent object is the same as the player's parent object: that is,
-for objects in the same room as the player, so we instead code:
-
-.. code-block:: inform6
-
- objectloop (item in parent(player)) statement;
-
-What is the actual ``statement`` that we'll repeatedly execute?
-
-.. code-block:: inform6
+.. code-block:: inform
if (item has moved)
PlaceInScope(item);
This leaves us the clothing items themselves, which will require a few
tailored actions. Let's see first the ordinary garments of John Covarth:
-.. code-block:: inform6
+.. code-block:: inform
Object clothes "your clothes"
with name 'ordinary' 'street' 'clothes' 'clothing',
into ordinary clothes. So now we are dealing with a Captain Fate in full
costume:
-.. code-block:: inform6
+.. code-block:: inform
Object costume "your costume"
with name 'captain' 'captain^s' 'fate' 'fate^s' 'costume' 'suit',
lines to the ``Initialise`` routine to make sure that the player does
not start the game naked:
-
-
-
-.. rubric:: Footnotes
-
-.. [#dark]
-
- We're alluding here to the Classical concept of mimesis. In an
- oft-quoted essay from 1996, Roger Giner-Sorolla wrote: "I see
- successful fiction as an imitation or 'mimesis' of reality, be it
- this world's or an alternate world's. Well-written fiction leads the
- reader to temporarily enter and believe in the reality of that world.
- A crime against mimesis is any aspect of an IF game that breaks the
- coherence of its fictional world as a representation of reality."
-
-.. code-block:: inform6
+.. code-block:: inform
[ Initialise;
#Ifdef DEBUG; pname_verify(); #Endif; ! suggested by pname.h
check for errors when using his library, and he tells us how to use it.
So we include the suggested lines into our ``Initialise`` routine:
-.. code-block:: inform6
+.. code-block:: inform
#Ifdef DEBUG; pname_verify(); #Endif;
"William Tell", to write our customised messages and assign them to
``deadflag`` values greater than 2.
-.. code-block:: inform6
+.. code-block:: inform
[ DeathMessage;
if (deadflag == 3) print "Your secret identity has been revealed";
of things. We have already seen that we need a verb CHANGE. We'll make
it really simple:
-.. code-block:: inform6
+.. code-block:: inform
[ ChangeSub;
if (noun has pluralname) print "They're";
``Give`` action in the orders property handles every input not already
specified:
-.. code-block:: inform6
+.. code-block:: inform
orders [;
Give:
Not so. The library grammar that deals with ASK BENNY FOR... is this
(specifically, the last line):
-.. code-block:: inform6
+.. code-block:: inform
Verb 'ask'
* creature 'about' topic -> Ask
undefined input from the player. We need to extend the existing ASK
grammar:
-.. code-block:: inform6
+.. code-block:: inform
Extend 'ask'
* creature 'for' topic -> AskFor;
talk a little more about compilation and debugging, and send you off
into the big wide world of IF authorship.
+
+.. rubric:: Footnotes
+
+.. [#dark]
+
+ We're alluding here to the Classical concept of mimesis. In an
+ oft-quoted essay from 1996, Roger Giner-Sorolla wrote: "I see
+ successful fiction as an imitation or 'mimesis' of reality, be it
+ this world's or an alternate world's. Well-written fiction leads the
+ reader to temporarily enter and believe in the reality of that world.
+ A crime against mimesis is any aspect of an IF game that breaks the
+ coherence of its fictional world as a representation of reality."
+