Inform 7 Home Page / Documentation
Since we prefer not to simulate burnt skin, and it is unsporting to kill a player outright merely for touching a hot object, heat is mostly used as a reason why something cannot be picked up at a given moment. This very basic puzzle is demonstrated in Grilling.
With the naked eye, it is not always easy to detect what is too hot to touch - a point made in both Masochism Deli, where the only solution is to keep picking up potatoes until one doesn't burn, and in Hot Glass Looks Like Cold Glass, where infrared goggles turn the scales.
If a hot object is not to be touched, will it stay hot forever? It might well, if it is a steak on an electric grill, but not if it is a recently-baked apple pie sitting on a window-sill. Entropy simulates the gradual return of temperature to equilibrium.
See Electricity and Magnetism for items which shouldn't be touched because they are hot in a different way
|Start of Chapter 10: Physics: Substances, Ropes, Energy and Weight|
|Back to §10.8. Fire|
|Onward to §10.10. Magic (Breaking the Laws of Physics)|
Descriptions of objects can be used in "Instead" rules: we can not only say "Instead of taking the steak", but also "Instead of taking something" or "Instead of taking something which is on the grill".
That last rule is useful if, for example, we want to prevent the player from interacting with anything on a specific supporter:
The Patio is a room. The Patio contains a grill and an ice chest. The ice chest contains a cold beer. On the grill are a steak and a hot dog.
Instead of taking something which is on the grill:
say "'Hey, you'll burn yourself,' says Mom."
We could just as easily adapt this rule to affect a container: "Instead of taking something which is in the ice chest," for example.
Note also that in older versions of Inform, the pattern "get all from..." was treated differently from "get steak", and had to be accounted for separately. This is no longer the case; this instead of taking... rule will handle all the phrasings which the player might use to try to acquire this object.
Heat is a kind of value. The heats are frosty, cold, cool, room temperature, warm, hot, and scalding. Everything has a heat. The heat of a thing is usually room temperature.
repeat with item running through things which are not in an insulated container:
if the heat of the item is greater than room temperature, now the heat of the item is the heat before the heat of the item;
if the heat of the item is less than room temperature, now the heat of the item is the heat after the heat of the item.
Definition: a container is insulated if it is closed and it is opaque.
The vacuum thermos is an opaque closed openable container carried by the player. In the vacuum thermos is a frosty thing called an ice cube.
if the heat of the ice cube is greater than cold:
if the ice cube is visible, say "The ice cube melts! 'HA ha,' says Maxwell, in a very unsporting, some might say demonic, way.";
now the ice cube is nowhere.
Equilibrium is a room. "A perfectly smooth chamber sealed from the outside world. You can't at this moment work out where the exit is, though possibly that is just because the lighting is so very very even and diffuse. And doesn't come from anywhere that you can see, either."
Maxwell is a man in Equilibrium. "Maxwell perches awkwardly on a stool across from you[if Maxwell has something], holding [a list of things carried by Maxwell][end if]." He is carrying a box of Chinese food. The Chinese food is scalding. "A discarded [item described] lies on the floor." The description of Maxwell is "He has the faintly peevish look of one who has not been properly fed."
Every turn when Maxwell has the food:
if the heat of the Chinese food is greater than warm, say "Maxwell takes a bite, and swears.";
if the heat of the Chinese food is warm, say "Maxwell eats as fast as he can, enjoying the food while it's at just the right temperature.";
if the heat of the Chinese food is less than warm:
say "Maxwell sadly stabs at his leftovers with a chopstick, but does not try to eat any more.";
move the food to the location.
Test me with "z / z / open thermos / close thermos / open thermos".
Here the player has several potatoes; we would like to make him more likely to drop the hot one, and more likely to pick up the cold one, all else being equal. At the same time, we want to phrase our rules so that they don't make the player try to take something he's already holding, or drop something he isn't.
The Masochism Deli is a room. "Recent restructurings of corporate policy restrict the 'lunch hour' to exactly thirty-two minutes, which means that no one has time to go out. Instead, you and your coworkers eat here, in the company's very own themed lunch room."
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.
After dropping a hot potato:
say "The guy from Cube B sneers at your lack of potato-holding stamina."
Test me with "inventory / drop potato / g / g / get potato / g / i / get potato".
Hot Glass Looks Like Cold Glass
Suppose we have a situation where the player is allowed to talk about the heat of an object only if he's properly equipped to detect it.
Heat is a kind of value. The heats are hot, warm, room temperature, and cold. A thing has a heat.
Understand the heat property as referring to a thing when the player wears the infrared goggles.
The Test Kitchen is a room. "Your own personal lab, ready for scrupulously scientific recipe research. You hope. The previous three runs of this did not go well." The pair of infrared goggles is carried by the player. The description is "A pair of head-mounted IR goggles which look very foolish when worn." The goggles are wearable.
A glass dish is a kind of container. A glass dish is transparent. Three room temperature glass dishes are on the counter. Two hot glass dishes are on the counter. Two cold glass dishes are on the counter. The counter is scenery in the Test Kitchen.
Instead of doing something other than examining to a hot glass dish:
say "Ow! Crikey! You swear, and Claudia makes a sympathetic hiss. 'You're going to have a mark from that for sure,' she comments.";
decrease the score by 2.
Instead of doing something when a hot glass dish is the second noun:
say "You brush [the second noun], and wince, but manage to conceal that from Claudia.";
decrement the score.
Before printing the name of a glass dish when the player wears the goggles: say "[heat] "
Before printing the plural name of a glass dish when the player wears the goggles: say "[heat] "
So far, so good. Now, what if the player tries to GET HOT DISH when the goggles are off? "You can't see any such thing." doesn't seem like quite the right response: he can see such a thing. He just doesn't know which it is.
We could go on to write a mistake rule that would scold the player for trying "get [heat] [text]" when not wearing the goggles. The problem is that this would not cover any other phrasing of the command, nor would it account for all the many other things the player might try to do with an object specified by heat.
What we really want is to catch all instances of the player using the property name when not allowed to do so; and for this purpose we can borrow a trick from the chapter on Activities:
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.";
Claudia is a woman in the Test Kitchen. "Your assistant Claudia stands by with [a list of things carried by Claudia]." The description of Claudia is "Infinitely patient and a very good stenographer. She is studiously avoiding giving you any sort of look that might be construed as mocking." Claudia carries a notepad, a brined chicken breast, a blowtorch, and a cup of heavy cream.
Instead of asking Claudia for something which is carried by Claudia:
move the second noun to the player;
say "'Check, [second noun],' repeats Claudia, in the tone of one who has seen too many medical dramas. She does hand it over, though."
Instead of asking Claudia for something:
say "She clears her throat faintly and glances at [the second noun], as though to say that it's not hers to give."
Test me with "get all / drop all / look / wear goggles / look / ask claudia for cream / put cream in hot dish / put cream in cold dish / remove goggles / get hot dish".