Chapter 9: Props: Food, Clothing, Money, Toys, Books, Electronics
§9.1. Food; §9.2. Bags, Bottles, Boxes and Safes; §9.3. Clothing; §9.4. Money; §9.5. Dice and Playing Cards; §9.6. Reading Matter; §9.7. Painting and Labeling Devices; §9.8. Simple Machines; §9.9. Televisions and Radios; §9.10. Telephones; §9.11. Clocks and Scientific Instruments; §9.12. Cameras and Recording Devices
![]() | Contents of The Inform Recipe Book |
![]() | Chapter 8: Vehicles, Animals and Furniture |
![]() | Chapter 10: Physics: Substances, Ropes, Energy and Weight |
![]() | Indexes of the examples |
§9.1. Food
Inform provides an either/or property called "edible" and action, "eating", for consuming edible things:
The lardy cake is edible. After eating the lardy cake, say "Sticky but delicious."
One of Inform's rules is that a person can only eat what he or she is holding - normally realistic, but it does prevent, say, eating a cherry off the tree. It's possible to override this: see Lollipop Guild. Delicious, Delicious Rocks, on the other hand, adds a sanity check which prevents the player from automatically taking inedible things only to be told they can't be eaten.
Inform does not normally simulate taste or digestion, but to provide foods with a range of flavours, see Would you...?; to make eating different foods affect the player differently, see Stone, or for the extreme case of poisoning foods, Candy. In MRE, hunger causes the player problems unless he regularly finds and eats food.
See Liquids for things to drink
See Dispensers and Supplies of Small Objects for a pizza buffet table from which the player may take all the slices he wants
|
|
|
A thing can have a rule as a property, if we like. Here we are going to allow the player to make a soup whose effects will depend on its ingredients. Each ingredient will have its own "food effect" rule, to be followed when the food is eaten. Note that there are other, slightly less cumbersome ways to do the same thing -- we will see in a few sections in the chapter on object-based rulebooks that we could make a "food effects rulebook" and then write a number of rules such as "food effects rule for carrots" or "food effects rule for the stone". Nonetheless, we demonstrate rules-as-properties here for the sake of thoroughness. So:
And now to provide some particular foods:
And the following is a relatively unimportant nicety:
|
|
A thing can have a rule as a property, if we like. Here we are going to allow the player to make a soup whose effects will depend on its ingredients. Each ingredient will have its own "food effect" rule, to be followed when the food is eaten. Note that there are other, slightly less cumbersome ways to do the same thing -- we will see in a few sections in the chapter on object-based rulebooks that we could make a "food effects rulebook" and then write a number of rules such as "food effects rule for carrots" or "food effects rule for the stone". Nonetheless, we demonstrate rules-as-properties here for the sake of thoroughness. So:
And now to provide some particular foods:
And the following is a relatively unimportant nicety:
|
|