9.3. Clothing

| Chapter 9: Props: Food, Clothing, Money, Toys, Books, Electronics |

| 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

Hayes 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.

44
| Example Get Me to the Church on Time Using kinds of clothing to prevent the player from wearing several pairs of trousers at the same time. |
WI

234
| Example Bogart Clothing for the player that layers, so that items cannot be taken off in the wrong order, and the player's inventory lists only the clothing that is currently visible. |
WI

241
| Example What Not To Wear A general-purpose clothing system that handles a variety of different clothing items layered in different combinations over different areas of the body. |
WI

"What Not To Wear" Section 1 - Overlying and Underlying We start by borrowing some of the same ideas from the Bogart example, but we're also going to make a kind called "garment-element". This kind will include both garments (objects of clothing) and body parts (things that can be covered by clothing); using it allows us to restrict the way our underlying and overlying relations apply, which will make them a bit faster at run-time. A garment-element is a kind of thing. Underlying relates various garment-elements to various garment-elements with fast route-finding. The verb to underlie (it underlies, they underlie, it is underlying, it is underlaid) implies the underlying relation. The verb to be under implies the underlying relation. Check taking off: if the noun underlies something (called the impediment) which is worn by the player, say "[The impediment] is in the way." instead. Carry out taking off: now the noun is not underlaid by anything. Report taking off something: say "You are now wearing [a list of uppermost things worn by the player]." instead. Definition: a garment-element is uppermost if it is not under something opaque. Here we've expanded on the previous ideas of 'uppermost' because it is possible for an upper layer to reveal what lies beneath: a tie, a clear plastic trenchcoat, an open-knit sweater, etc. We'll make such items transparent. Before taking off something which underlies something which is worn by the player: while the noun underlies something (called the impediment) which is worn by the player: say "(first removing [the impediment])[command clarification break]"; silently try taking off the impediment; if the noun underlies the impediment, stop the action. Overlying relates various garment-elements to various garment-elements. The verb to overlie (it overlies, they overlie, it is overlying) implies the overlying relation. Covering relates a garment-element (called A) to a garment-element (called B) when the number of steps via the overlying relation from A to B is greater than 0. The verb to cover (it covers, they cover, it is covering, it is covered) implies the covering relation. Before wearing something when a garment which covers the noun is worn by the player: while the player wears a garment (called the impediment) which covers the noun: say "(first removing [the impediment])[command clarification break]"; silently try taking off the impediment; if the player is wearing the impediment, stop the action. Carry out wearing: repeat with hidden item running through things worn by the player: if the noun covers the hidden item, now the hidden item underlies the noun. Instead of looking under something which is worn by the player: if something (called the underwear) underlies the noun, say "You peek at [the underwear]. Yup, still there."; otherwise say "Just you in there." Instead of taking inventory: say "You're carrying [a list of things carried by the player][if the player wears something]. You are wearing [a list of uppermost garments worn by the player][end if]." Section 2 - Regional Coverage Here we draw in the idea that different clothes go over different areas of the body, and that they should be in competition with each other only if both sets of clothes belong at the same level over the same body area. Before wearing something: let N be the layering depth of the noun; repeat with item running through things worn by the player: if the layering depth of the item is N and the item covers a body-part which is covered by the noun: say "(first taking off [the item])[command clarification break]"; silently try taking off the item; if the player wears the item, stop the action. This may seem like overkill, but it allows us to create garments that cover different subsets of the body -- pants and shirt vs. a dress, for instance. To decide what number is the layering depth of (chosen garment - a thing): let N be 0; if the chosen garment covers a body-part (called base): let N be the number of steps via the overlying relation from the chosen garment to the base; decide on N. To help with modeling, we'll give everyone body parts, broken down according to their relevance to clothing: A body-part is a kind of garment-element. A torso, a seat, a head, pair of legs, and pair of feet are kinds of body-part. If we wanted to allow gloves, we might put in hands as well; but this is enough for now. One head is part of every person. One torso is part of every person. One pair of legs is part of every person. One pair of feet is part of every person. One seat is part of every person. And now we make some categories of clothing: A garment is a kind of garment-element. A garment can be transparent. A pair of pants, a pair of underpants, a foundation garment, a pair of socks, a pair of shoes, a jacket, a hat, a dress, and a shirt are kinds of garment. The plural of pair of pants is pairs of pants. The plural of pair of underpants is pairs of underpants. The plural of pair of socks is pairs of socks. The plural of pair of shoes is pairs of shoes. A pair of pants, a pair of underpants, a foundation garment, a pair of socks, a pair of shoes, a jacket, a hat, a dress, and a shirt are usually wearable. When play begins: now every pair of socks overlies every pair of feet; now every pair of shoes overlies every pair of socks; now every pair of underpants overlies every seat; now every pair of pants overlies every pair of underpants; now every foundation garment overlies every torso; now every jacket overlies every shirt; now every jacket overlies every dress; now every hat overlies every head; now every dress overlies every pair of underpants; now every dress overlies every foundation garment. Section 2 - The Scenario The Dressing Room is a room. The player carries some capris, some jeans, a corset, a plunge bra, a thong, boy-shorts, black satin D'Orsay pumps, brown leather boots, a camisole, a cocktail dress, a bolero, a cashmere shrug, a sheer wrap, and a linen tunic. The woolly socks are a pair of socks. The D'Orsay pumps and the brown leather boots are pairs of shoes. The thong and the boy-shorts are pairs of underpants. The capris and the jeans are pairs of pants. The tunic is a shirt. The camisole, the corset, and the plunge bra are foundation garments. The cocktail dress is a dress. The bolero, the cashmere shrug, and the sheer wrap are jackets. The shrug and the wrap are transparent. Test me with "wear capris / wear jeans / i / wear thong / i / wear dress / wear corset / wear dress / i / wear wrap / i / wear boots / wear pumps / i".

325
| Example Hays Code Clark Gable in a pin-striped suit and a pink thong. |
WI

54
| Example Being Prepared A kind for jackets, which always includes a container called a pocket. |
WI

319
| Example Some Assembly Required Building different styles of shirt from component sleeves and collars. |
WI

Previous | Contents | Next