§9.3. Clothing
A person can wear any (portable) thing which has the "wearable" property. (This property seldom needs to be quoted because it is deduced automatically from sentences like "Trevor wears a red hat.")
In most traditional IF, clothing is only used when it is exceptional in some way. That is, we ignore the three to eight different garments most people are wearing at any given time - the everyday clothes which people wear without thinking about them - and only simulate the unexpected extras: a borrowed jaunty red hat, a radiation-proof space suit, and so on.
These unusual garments turn up only occasionally in play and usually one at a time, so Inform does not normally provide rules to restrict how much or little is worn, or in what unlikely combinations. Get Me to the Church on Time categorises clothing by body area (trousers for lower body, shirts for upper); Bogart by layer, distinguishing underwear from outer garments. What Not To Wear combines both into a general-purpose system adequate for most kinds of clothing situations.
See Kitchen and Bathroom for a simple mirror implementation, which could be adapted to reflect what the player is currently wearing
Hays Code is a somewhat stripped down version.
Clothes are normally single things which have no function other than display and concealment, but Being Prepared gives them pockets which act as containers, and Some Assembly Required allows clothes to be stitched together from pieces of cloth.
![]() | Start of Chapter 9: Props: Food, Clothing, Money, Toys, Books, Electronics |
![]() | Back to §9.2. Bags, Bottles, Boxes and Safes |
![]() | Onward to §9.4. Money |
|
|
|
|
|
We have two things to keep track of with our layering clothing: what currently is covering something else; and what can cover something else. This implementation goes for a fairly simple treatment, assuming that each item of clothing will completely conceal those beneath it, and that we are not implementing entire sets of shirts, jackets, etc. But it will do for a demonstration.
First we make our relation to represent what *is* underneath another item:
And now we prevent taking a lower layer off before the thing that is worn over it:
That covers order of clothing removal, but we also want to restrict what can be worn on top of what else. This time we need Inform to have some idea of what customarily can be layered on top of what other clothing:
With these definitions, we can say that a jacket should go over a shirt and a shirt over an undershirt (say), and then Inform will know that a jacket will cover both shirt and undershirt.
Notice that our inventory only describes the things that the player can see as the upper layer of clothing.
If we further wanted to prevent the player from taking off clothes in inappropriate places, we might add something like this:
|
|
We have two things to keep track of with our layering clothing: what currently is covering something else; and what can cover something else. This implementation goes for a fairly simple treatment, assuming that each item of clothing will completely conceal those beneath it, and that we are not implementing entire sets of shirts, jackets, etc. But it will do for a demonstration.
First we make our relation to represent what *is* underneath another item:
And now we prevent taking a lower layer off before the thing that is worn over it:
That covers order of clothing removal, but we also want to restrict what can be worn on top of what else. This time we need Inform to have some idea of what customarily can be layered on top of what other clothing:
With these definitions, we can say that a jacket should go over a shirt and a shirt over an undershirt (say), and then Inform will know that a jacket will cover both shirt and undershirt.
Notice that our inventory only describes the things that the player can see as the upper layer of clothing.
If we further wanted to prevent the player from taking off clothes in inappropriate places, we might add something like this:
|