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

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

"Being Prepared" A jacket is a kind of thing. A jacket is always wearable. A pocket is a kind of container. A pocket is part of every jacket. The carrying capacity of a pocket is always 2. After examining a jacket: let target be a random pocket which is part of the noun; say "[The target] contains [a list of things in the target]." Now we've created the rules that will govern any specific jackets we might happen to put in our game: each one will always have one pocket, which will be able to contain no more than two things. The description of "a list of things" is text with a list, which we will learn about further in a few sections. Next we might want to create the environment and an actual example of the jacket kind: Tent is a room. "A dome made of two flexible rods and a lot of bright green ripstop nylon. It bills itself as a one-man tent, but you'd call it a two-dwarf tent: there is no way to arrange yourself on its square floor so that you can stretch out completely." The hoodie is a jacket. "Your hoodie is balled up in the corner." The description of the hoodie is "Both elbows are stained from yesterday's entrenching project." The hoodie's pocket contains a Swiss army knife and a folded map. The hoodie is in the Tent. Notice that, since Inform has created a pocket for the hoodie, we can now refer to it by name in our source, giving it any additional properties we need to define. Here we simply put a few items into it. The player wears a whistle. The description of the whistle is "To frighten bears." Test me with "x hoodie / get hoodie / get knife / get map / i / put hoodie in pocket / put whistle in pocket / put map in pocket / put knife in pocket / i". Notice that Inform automatically refuses to put the hoodie into its own pocket: as a default, a container cannot contain something of which it is itself a part.

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

Previous | Contents | Next