Clothing

I was wondering how i could make a clothing system, so that the player could could wear clothing and then when they examine themselves or look in a mirror, the top layer of clothing is reflected.

I am also trying to work out how to stop the player from wearing multiple items of the same type of clothing. So they cant put on four shirts and five pairs of trousers and so on.

I have managed to construct a very poor implementation of stopping the multiple clothing, but i would prefer something better.

[code]Slot is a kind of value. The slots are head,torso and neck.
Clothing is a kind of thing. Clothing is always wearable. Clothing has a slot.

A necklace is a kind of clothing. The slot of a necklace is neck.
A shirt is a kind of clothing. The slot of clothing is torso.

The collar is a necklace. The collar is in the town.
The pendant is a necklace. The pendant is worn by the player.

check wearing:
repeat with item running through things worn by the player:
if the slot of the noun is the slot of the item:
try taking off the item;
if the item is worn by the player, stop the action;
try wearing the noun instead.
[/code]
Any and all ideas are apprciated.

The documentation provides a couple examples of clothing systems; the most powerful, which I think covers everything you have mentioned wanting, is called “What Not to Wear”. You can find it (and the other related examples, and some discussion) in the Recipe Book under the section Chapter 9: Props: Food, Clothing, Money, Toys, Books, Electronics > Clothing. See

inform7.com/learn/man/Rdoc70.html

if you’d like to look at it online.