Chapter 17, Cont.
Section 17.12 is This/that.
This just refers to a shortcut way of using slashes to indicate multiple meanings:
Understand "reach underneath/under/beneath [something]" as looking under.
This is shorthand for:
Understand "reach underneath [something]" or "reach under [something]" or "reach beneath [something]" as looking under.
I tend to use the second format more than the first, except specifically if there is a new action with several possible propositions.
You might also want ‘nothing’ to be an option. That’s done with two hyphens: --
Understand "reach underneath/under/beneath/-- [something]" as looking under.
Unfortunately, you can’t use a slash for the first word in a command. (At least, I always get errors when doing so).
I should say I haven’t actually updated to Inform 10, since I’m in the middle of a big project. Do you think I should? I have time to fix things…
Section 17.13 is New tokens
I’ve never used this section before, but it looks really powerful.
It seems like it’s mainly just a macro/function/shorthand for stuff that you repeat often in understand statements.
Understand "beneath/under/by/near/beside/alongside/against" or "next to" or "in front of" as "[beside]".
Understand "on/in/inside" or "on top of" as "[within]".
Example 3.10 is Lies:
Understand "beneath/under/by/near/beside/alongside/against" or "next to" or "in front of" as "[beside]".
Understand "on/in/inside" or "on top of" as "[within]".
Understand "lie down" as lying down.
Understand "lie down [within] [something]" as entering.
Understand "lie [beside] [something]" or "lie down [beside] [something]" as lying near.
Section 17.14 is Tokens can produce values
This section is worded in a way that I get confused, but it says you can do this:
Colour is a kind of value. The colours are red, green and blue. Understand "colour [a colour]" or "[a colour] shade" as "[tint]"
But not that:
Understand "colour [a colour]" or "[something]" as "[tint]".
So when defining new tokens (again, something I have never done), you can make it match any given value in a kind of value, but have to be consistent in the kind used.
Anyone used these new tokens before? They seem useful, I just never knew about them or felt intimidated when I did.
Section 17.15 is Understanding things by their properties.
I’ve used this one a ton! This is like when you want ‘open’ to refer to an open door and ‘closed’ to a closed door.
In fact, for many years I didn’t know how to make ‘understand’ conditional at all, so my games are built to work around that.
Anyway, here’s how it works:
The china pot can be unbroken or broken. The china pot is unbroken.
Understand the unbroken property as describing the pot.
After dropping the china pot:
say "Crack!";
now the china pot is broken;
now the printed name of the pot is "broken pot".
This lets the player use the terms ‘unbroken’ or ‘broken’ to refer to the pot, as needed. You can add synonyms for properties:
Understand "shattered" or "cracked" or "smashed" as broken. Understand "pristine" as unbroken.
I’m not sure if you can do the opposite, like if you have a weird property name, if there’s a way to exclude its use (but if it’s weird enough, no one would ever guess it anyway).
What I didn’t know are that there are two ways of doing this:
Understand the broken property as describing a flowerpot.
Understand the broken property as referring to a flowerpot.
In ‘referring to’, you can only use the adjective when its in front of part of the name of the flowerpot itself.
Example 311 is Aspect:
An aspect ratio is a kind of value. 16:9 specifies an aspect ratio.
A television is a kind of device. A television has an aspect ratio. Understand the aspect ratio property as referring to a television. Understand "European standard" as 16:9.
In my own game, I use this ‘understand as describing’ stuff twice:
The frozen-target can be broken or unbroken. Understand the broken property as describing the frozen-target. Understand "broken" as broken .
and later on for a two markers that are identical outside of their colors.
Whew, there are a lot more examples in this section!
Example 313 is Channel 1:
A television is a kind of device. A television has a number called the channel. Understand the channel property as referring to a television. Understand "channel" as a television.
Understand "tune [something] to [number]" or "change channel of [something] to [number]" as changing the channel of it to.
Check changing the channel of something to:
if the noun is not a television, say "[The noun] cannot be tuned to a channel." instead.
Carry out changing the channel of something to:
now the channel of the noun is the number understood.
Report changing the channel of something to:
say "You tune [the noun] to channel [number understood]."
Example 314 (pi!) is Terracottissima:
A flowerpot can be unbroken or broken. After dropping an unbroken flowerpot: say "Crack!"; now the noun is broken. Understand the broken property as describing a flowerpot.
Before printing the name of a broken flowerpot, say "broken ". Before printing the name of an unbroken flowerpot: if a flowerpot is broken, say "unbroken ".
Before printing the plural name of a broken flowerpot, say "broken ". Before printing the plural name of an unbroken flowerpot: if a flowerpot is broken, say "unbroken ".
Example 315 is Peers:
A title is a kind of value. The titles are Baron, Viscount, Earl, Marquess, Duke and Prince.
A peer is a kind of man. A peer has a title. A peer is usually a Baron. Before printing the name of a peer, say "[title] ". Understand the title property as describing a peer.
The House of Lords is a room. Maltravers, Pollifax, Omnium and St Vincent are peers in the House of Lords. Omnium is a Duke. St Vincent is an Earl.
Ennobling is an action applying to one thing and one title.
Check ennobling:
if the noun is the player, say "The Sovereign is the fountain of honour, and may not be ennobled." instead;
if the noun is not a peer, say "Commoners should remain so." instead;
if the title of the noun is the title understood, say "But that is his title already." instead;
if the title of the noun is greater than the title understood, say "As he is already of the rank of [title of the noun], any such letters patent are liable to be deemed invalid, following the precedent of the Buckhurst Peerage Case (1876). Best not." instead.
Carry out ennobling:
now the title of the noun is the title understood.
Report ennobling:
say "'Whereas Our Parliament for arduous and urgent affairs concerning Us the state and defence of Our United Kingdom and the Church is now met at Our City of Westminster We strictly enjoining Command you upon the faith and allegiance by which you are bound to Us that the weightness of the said affairs and imminent perils considered (waiving all excuses) you be at the said day and place personally present with Us and with the said Prelates Great Men and Peers to treat and give your counsel upon the affairs aforesaid And this as you regard Us and Our honour and the safety and defence of the said Kingdom and Church and dispatch of the said affairs in nowise do you omit Witness Ourself at Westminster the Fifth day of November in the 43rd year of Our Reign,' you say, with unpunctuated serenity. The new [noun] bows stiffly."
Example 316 is Channel 2
This example is like the other channel example but has features like using tokens:
Understand "[number]" or "channel [number]" as "[channel]".
Example 317 is Terracottissima Maxima:
A flowerpot is a kind of thing. A flowerpot has a text called pattern. Understand the pattern property as describing a flowerpot. The printed name of a flowerpot is usually "[pattern] flowerpot". The printed plural name of a flowerpot is usually "[pattern] flowerpots".
The Herb Garden is a room. In the Herb Garden is a flowerpot with pattern "blue willow". In the Herb Garden is a flowerpot with pattern "striped". In the Herb Garden is a flowerpot with pattern "striped".
It mentions that using text properties in this way (which I have done) is essentially the same as using values, except that texts can be more complex (to be explored in the future, it says).
Example 318 is Tilt 1:
This has stuff like cutting out part of the player’s command (something I don’t think we’ve seen so far):
After reading a command:
if the player's command includes "of [suit]":
while the player's command includes "of":
cut the matched text;
repeat through the Table of Value Names:
while the player's command includes topic entry:
replace the matched text with value entry.
[This allows Inform to understand "ace", "deuce", "king", etc., as numerical ranks.]
and has some fancy action redefinitions:
Understand the commands "take" and "carry" and "hold" and "get" and "drop" and "throw" and "discard" as something new.
Understand "take [text]" or "get [text]" or "drop [text]" as a mistake ("Here, you only draw and discard. Nothing else matters at the moment.").
Understand "draw" or "draw card" or "draw a card" as drawing. Drawing is an action applying to nothing. The drawing action has an object called the card drawn.
Finally, onto 17.16! ‘Understand things by their relations’.
I don’t think I’ve used this before. This lets you refer to things by things they contain, or are part of, or any other relationship.
Hmmm, pretty neat! Could be useful if an item can get passed from person to person, like a coin, so you can refer to ‘so and so’s coin’.
A box is a kind of container. Understand "box of [something related by containment]" as a box.
The Toyshop is a room. The red box is a box in the Toyshop. Some crayons are in the red box.
and now TAKE BOX OF CRAYONS will work, because CRAYONS matches against “[something related by containment]” for the red box - or it does for as long as the crayons are there.
To reverse a relation:
A box is a kind of container. Understand "box in [something related by reversed containment]" as a box.
The Toyshop is a room. The crate and the hammock are in the Toyshop. In the crate is a box. In the hammock is a box.
Example 319 is Cinco:
The taco shell is an edible thing in the Fundraiser. It is a portable container. It has carrying capacity 1.
Understand "[something related by containment] taco" as the taco.
Rule for printing the name of the taco shell while not inserting or removing:
if the taco contains something (called filling), say "[filling] taco";
otherwise say "taco shell";
omit contents in listing.
The player carries shredded beef. It is edible.
The taking action has an object called source (matched as "from").
Setting action variables for taking:
now source is the holder of the noun.
Report taking something from the taco shell:
say "You gingerly pick [the noun] out of the taco shell." instead.
Example 320 is Puncak Jaya:
A ghost is a kind of person. A man-ghost is a kind of ghost. A man-ghost is always male. A woman-ghost is a kind of ghost. A woman-ghost is always female.
Representation relates one ghost to one person. The verb to represent means the representation relation.
One man-ghost represents every man. One woman-ghost represents every woman.
Indication relates a ghost (called X) to a person (called Y) when X represents Y and Y is not visible.
Understand “[something related by indication]” as a ghost.
When play begins:
now every ghost is in the concept-repository.
Instead of doing something to a ghost:
say “You seem to have left [a random person which is represented by the noun] behind.”
Example 321 is Whither?
This lets you refer to a door as ‘east door’ or ‘west door’ or whatever, depending on which side of it we are on.
The initial appearance of a door is usually "Nearby [an item described] leads [if the other side of the item described is visited][direction of the item described from the location] to [other side of the item described][otherwise][direction of the item described from the location][end if]."
Direction-relevance relates a door (called X) to a direction (called Y) when the direction of X from the location is Y. The verb to be directionally-relevant to means the direction-relevance relation.
Understand "[something related by direction-relevance] door" as a door.
Section 322 is Claims Adjustment
A photograph is a kind of thing. 36 photographs are in the film roll.
Appearance relates one thing to various photographs. The verb to be shown by means the appearance relation.
The description of a photograph is usually "It shows [a random thing which is shown by the item described]."
Understand "of [something related by reversed appearance]" as a photograph.
This uses the ‘random thing’ trick, where you describe something uniquely and then say ‘a random thing’ and it always picks that thing.
Section 17.17 is Context: understanding when
This is conditional understanding! I’m using it for the first time with my current game.
Understand "mix [colour] paint" as mixing paint when the location is the Workshop.
Understand "rouge" as red when the make-up set is visible.
We can’t use ‘the noun’ or ‘the second noun’ or ‘the number understood’, because those are defined in a different stage of action processing.
A convenient option:
Understand "your" as a thing when the item described is held by the person asked.
We are now introduced to the ‘privately-named’ concept:
The secret document is a privately-named thing in the drawer.
The printed name of the secret document is "[if the secret document is handled]secret document[otherwise]dusty paper".
Understand "dusty" and "paper" as the secret document.
Understand "secret" and "document" as the secret document when the secret document is handled.
After taking the secret document for the first time: say "Heavens! It is the secret document!"
I can never remember which has a hyphen out of ambiguously plural, plural named and privately named.
Privately-named just gets rid of the ‘main’ inform name you gave an object so that players can’t type it in. It becomes more useful the larger your game (invaluable in Cragne Manor).
Only rooms, things, directions, and regions can be privately or publicly-named. If you want an object you created to have it that’s not one of those for, you have to say something like this:
A concept is a kind of object. A concept can be privately-named or publicly-named. A concept is usually publicly-named.
(Privately-named is a property which only affects how Inform creates the object, and it can’t usefully be given or taken away during play. “Understand … when …” is the way to change names during play.)
Example 323 is Quiz Show, which adds a special mode when guessing stuff:
Answer mode is a truth state that varies.
Current state is a text that varies.
Guessing is an action applying to one topic.
Understand "[text]" as guessing when answer mode is true.
Every turn when the player is in the lab:
if a random chance of 3 in 5 succeeds:
choose a random row in the Table of Dates of Statehood;
say "Sam asks you, 'In what year was [state entry] admitted into the Union?'";
now current state is state entry;
now answer mode is true.
Table of Dates of Statehood
State | Topic | Comment |
---|---|---|
“Florida” | “1845” | “March 3rd” |
“Delaware” | “1787” | “December 7th” |
“Hawaii” | “1960” | “July 4th” |
Example 324 is Bibliophilia:
Understand "examine [text]" as examining as a book when the player is in the Reading Room. Understand "look up [text]" as examining as a book when the player is in the Reading Room.
Examining as a book is an action applying to one topic.
Carry out examining as a book:
say "You can't find any such text."
Instead of examining as a book a topic listed in the Table of Book Titles:
say "[description entry][paragraph break]"
Table of Book Titles
topic | title | description |
---|---|---|
“Reading Greek Death” or “reading/greek/death” or “greek death” | “Reading Greek Death” | “A dense orange paperback treatise on the development of Greek eschatology.” |
“TAPA/Transactions/134-2” | “TAPA 134-2” | “Transactions of the American Philological Association from 2004.” |
“Oxford Classical Dictionary” or “OCD/dictionary/classical/oxford” | “Oxford Classical Dictionary” | “A hefty reference with short articles on everything from Greek meter to ancient cosmetics.” |
“Collected Dialogues of Plato” or “Plato/dialogues/hamilton/cairns” | “Collected Dialogues of Plato” | “All the Platonic dialogues – some, admittedly, in rather tired translations – but still a useful single volume, ed. Edith Hamilton and Huntington Cairns.” |
“Adobe Illustrator CS User Guide” or “user guide” or “adobe illustrator” or “adobe/illustrator/cs/user/guide” | “Adobe Illustrator CS User Guide” | “Hello, how did this get here? A suspiciously familiar name is scribbled inside the front cover…” |
Example 17.18 is Changing the meaning of pronouns
Inform automatically keeps track of IT, HIM, HER, and THEM. Occasionally, you want to change these pronouns manually, usually when the text prominently mentions an object the player hasn’t interacted with or if the game swaps in one object for another that the player will think is the old object. You just type this:
set pronouns from the key;
set pronouns from Bunny;
and that sets the appropriate pronoun.
(I remember having to do this in Dialog, too, which has its own built-in function for it).
Example 325 is Pot of Peturnias:
At 9:01 am:
move the broken flower pot to the location;
say "Quite unexpectedly, a flower pot falls from the sky and breaks open on the ground. Good thing you weren't standing six inches to the left.";
set pronouns from the broken flower pot.
Example 17.19 is Does the player mean…
This is a useful thing that just ranks stuff in disambiguation checks.
The Champs du Mars is a room. The great Eiffel Tower is here. "The great Tower stands high over you." The souvenir model Eiffel Tower is here. "Comparatively tiny is the souvenir version."
Does the player mean taking the great Eiffel Tower: it is very unlikely.
This makes it so if the player types GET TOWER, instead of getting this message:
Which do you mean, the great Eiffel Tower or the souvenir model Eiffel Tower?
You get this one:
(the souvenir model Eiffel Tower)
Taken.
The rankings are as follows:
it is very likely
it is likely
it is possible
it is unlikely
it is very unlikely
You can be as specific as you like:
Does the player mean doing something with the cursed dagger of Thog: it is very unlikely.
Does the player mean doing something with the cursed dagger of Thog when the player is hypnotized: it is likely.
Does the player mean throwing the can of shoe polish at the shoe polish vending machine: it is likely.
Does the player mean tying the noun to the noun: it is very unlikely.
This isn’t a miracle worker though. For instance:
Does the player mean throwing the can of shoe polish at the tree: it is likely.
may not work if the player types THROW POLISH AT TREE and POLISH is ambiguous, because when the parser is trying to understand POLISH, it hasn’t yet seen to the end of the command and realised that the second noun will be the tree; so the second noun is unset and the rule won’t match.
Apparently ‘inserting it into’, ‘removing it from’, and ‘putting it on’, checks things in the opposite order.
Example 326 is Masochism Deli:
The plural of potato is potatoes. A potato is a kind of thing. A potato is edible.
Temperature is a kind of value. The temperatures are hot and cold. A potato has a temperature. A potato is usually cold.
Understand the temperature property as describing a potato. Before printing the name of a potato (called subject): say "[temperature of subject] ". Before printing the plural name of a potato (called subject): say "[temperature of subject] ".
Does the player mean dropping a hot potato which is carried by the player: it is very likely.
Does the player mean taking a cold potato which is not carried by the player: it is very likely.
The player carries three potatoes.
When play begins: now a random potato is hot.
Section 17.20 is Multiple Action Processing
This is how to handle commands involving ‘ALL’. There are two phrases involved:
First is multiple object list
, which just gives a list of objects (but somehow isn’t a regular list?). For a single object, this list is empty; it’s either 0 or plural with nothing in between.
You can change the list as so:
alter the multiple object list to
I’ve never been brave enough to try this.
This is one of those sections which is pretty incomprehensible and has no real examples, so let’s see if the examples come to the rescue!
Example 327 is The Best Till Last:
A multiple action processing rule when the action name part of the current action is the burning it with action (this is the orderly burn rule):
let L be the multiple object list;
let dull list be a list of objects;
let fun list be a list of objects;
repeat with item running through L:
if the burn description of the item is "":
add item to dull list;
else:
add item to fun list;
let F be the dull list;
add fun list to F;
alter the multiple object list to F.
Okay, so this seems to confirm that you can do regular list processing with this list.
Example 328 is Western Art HIstory 305
Understand "examine [things]" as examining.
A painting is a kind of thing. A painting is usually fixed in place. Understand “painting” as a painting. Understand “paintings” as the plural of painting.
The painting-collective is a thing. The printed name of the painting-collective is "paintings". The description of the painting-collective is "There's [a list of visible paintings]."
A multiple action processing rule when the current action is examining (this is the examine kinds rule):
let L be the multiple object list;
let F be L;
let the painting count be 0;
repeat with item running through L:
if the item is a painting:
increment the painting count;
remove the item from F;
if the painting count is greater than one:
add the painting-collective to F;
alter the multiple object list to F.
Section 17.21 is Understanding Mistakes, something I think I may have used once but only rarely.
This is where you want to recognize a command but show that it’s not a real action. They don’t process the ‘every turn’ rules, I think.
You make a mistake as so:
Understand "act" as a mistake.
But this doesn’t print anything, so add a message with this:
Understand "act" as a mistake ("To join the actors, you have to adopt a role in the play! Try PLAY HAMLET or similar.").
or restrict to a special location:
Understand "act" as a mistake ("To join the actors, you have to adopt a role in the play! Try PLAY HAMLET or similar.") when the location is the Garden Theatre.
or catch a wider variety of words:
Understand "act [text]" as a mistake ("To join the actors, you have to adopt a role in the play! Try PLAY HAMLET or similar.") when the location is the Garden Theatre.
It suggests using mistakes for beta testing:
Understand "* [text]" as a mistake ("Noted.").
It mentions that mistakes don’t handle things like ‘topic understood’ or ‘noun’ or ‘the noun’ very well.
Example 329 is Query:
Understand "who" or "what" or "when" or "where" or "why" or "how" or "who's" or "what's" or "when's" or "where's" or "why's" or "how's" as "[query]".
Understand "[query] [text]" as a mistake ("[story title] understands commands, such as '[command prompt]examine [a random thing that can be seen by the player]', but not questions. For more instructions, type HELP.").
Example 330 is The Gorge at George:
Understand "talk to [someone]" as a mistake ("To start a conversation, try to ASK [the noun] ABOUT something or TELL [the noun] ABOUT something.").
Example 331 is Hot Glass looks like Cold Glass:
This provides an alternative way to write helpful error messages:
After reading a command:
if the player wears the goggles, make no decision;
if the player's command includes "[heat]":
say "Without the IR goggles on, you cannot tell hot things from cold at sight.";
rule succeeds.
Finally, 17.22 is Precedence:
In inform processing, the more specific lines are checked before more general ones.
Understand "employ [a door]" as opening.
Understand "employ [an open door]" as entering.
So for an open door, the second line fires; for other doors, the first line fires.
Why is it like this? Here’s an example:
Understand "on/in/inside" or "on top of" as "[within]".
Here Inform puts “on top of” before “on/in/inside”, since otherwise only the “on” of “on top of” will be recognised.
Inform tries commands with a single noun before nouns with multiple nouns. So in the following, the first command is given precedence:
Understand "put [something preferably held] on" as wearing.
Understand "put [other things] on/onto [something]" as putting it on.
Example 332 is Some Assembly Required:
Before cutting something which is worn by the player:
try taking off the noun.
Instead of cutting something when something is part of the noun:
say "You cut up [the noun], snipping off [a list of things which are part of the noun].";
now every thing which is part of the noun is in the holder of the noun.
Instead of cutting something which is part of something:
say "You carefully snip [the noun] free.";
now the player carries the noun.
Definition: a thing is removable if it is part of something. Understand "cut [removable thing]" as cutting.
The idea here is that there are multiple identical things in the room, and if one is ‘removable’, it is selected before others that have the same name.
Example 333 (nice number and about 100 away from the final example) is Lakeside Living.
Definition: a fluid container is empty if the current volume of it is 0.0 fl oz. Definition: a fluid container is full if the current volume of it is the fluid capacity of it.
Understand the command "fill" as something new.
Understand "fill [fluid container] with/from [full liquid source]" as filling it with. Understand "fill [fluid container] with/from [fluid container]" as filling it with.
This gives preference to full containers.
Great chapter! About half of it is things that are absolutely vital to Inform and the other half are arcane things that terrify me.
The next chapter is the largest, and one that I have never even begun to attempt: activities. I’ve never known what I was doing when messing with activities, I just copied examples word for word with eyes closed.
Since it’s so long and since Spring Thing processing will be happening, I’ll be splitting it up into several smaller chapters. Thanks!