This is an old revision of the document!
Apparel in LibEcho is defined as anything that a Person can wear. This includes clothing, jewelry, and perhaps even naughty toys in some cases.
The Apparel system also provides the Wardrobe and WornApparel classes, which is a special subclasses of GeneralInventory that only deal with Apparel. Wardrobe is a lightly modified GeneralInventory that modifies the sorting implementation to make it more clothing-specific (although it can still contain any PersistentObject, non Apparel objects will all be lumped into the “Other” category). WornApparel is used by the Person classes to track what a Person is wearing, and provides the auto-removal functionality mentioned above.
In general, you may use a Wardrobe interchangeably with a GeneralInventory with the InventoryUI macro. For the wearing and removing of Apparel by a Person, however, a modified version (ApparelUI) is provided. The left-hand inventory provided to ApparelUI should always be a Person (not a WornApparel, but the higher-level Person object that is dressing/undressing). The right-hand inventory should always be a Wardrobe.
: Document how WornApparel and Wardrobe interact as far as items technically remaining in the Wardrobe while they are worn by a Person.
An article of Apparel may occupy one or more ClothingSlots. This prevents a character from wearing a dozen coats at the same time, for example. A shirt would occupy ClothingSlot.TORSO and a pair of pants would occupy ClothingSlot.LEGS. A dress would occupy both ClothingSlot.TORSO and ClothingSlot.LEGS. The ClothingSlots occupied by an article of clothing are baked into the GenericApparel subclasses, but you may derive your own subclasses to define new types of Apparel, or override the default ClothingSlots in your object defaults JS file.
When a Person wears a particular article of Apparel, any currently worn articles that occupy the same ClothingSlots are removed. This prevents the player from equipping, say, 10 pairs of underpants at the same time.
Certain ClothingSlots can cover other ClothingSlots, concealing them. This allows a Person to, for example, hide some racy underpants under their normal clothes, or a whole racy outfit under a long coat. The details of what covers what and how are below.
In general, you probably needn't ever worry about ClothingSlots. If you just define your specific articles of Apparel using the various Apparel subclasses, all of the ClothingSlot magic will be taken care of for you well, magically.
ClothingSlot is an enumeration that describes what “slots” an article of Apparel occupies on a Person when worn. Only one article of Apparel may occupy a particular ClothingSlot.
Boxers, briefs, panties, etc.
Bras and such; T-shirts should use TORSO.
Socks and hosiery.
Shirts and tops.
Pants, skirts, and bottoms; Socks and hosiery should use UNDERLEGS
Shoes. Socks and hosiery should use UNDERLEGS.
Coats and shawls.
Gloves.
Hats and helmets.
Earrings. Something like earmuffs probably should use HEAD.
Necklaces and ties.
Bracelets, watches.
Rings.
A couple of generic Apparel types are provided. GenericApparel provides a bare-bones Apparel implementation from which which all other Apparel types are derived. GenericMenswear and GenericWomenswear provide implementations which reference the potential wearer's femininity stat to determine whether or not they can be worn, and provide some default adjustments to that stat (currently unimplemented).
Articles of Apparel may be given various properties.
The “long” and/or “tall” properties interact with the ClothingSlots, providing additional concealment. For example, a turtleneck sweater might be “tall”, concealing the neck as well as anything worn beneath it on the torso. A “long” coat occupying ClothingSlot.OVER would conceal the legs as well as the torso.
The “low” property currently only applies to items occupying ClothingSlot.TORSO, and will reveal what is worn on ClothingSlot.UNDERSHIRT, unless that item is also “low”. A low-cut off-shoulder top revealing a tank top or bra worn beneath it, for example.
The “transparent” property will cause an article of Apparel to reveal whatever is worn beneath it regardless. A fishnet top or translucent wraparound, for example.
The “thin” property is used to denote tight-fitting articles of Apparel made with thin fabric. A tight-fitting t-shirt, for example. The articles of apparel worn below will “show an outline” through this article of Apparel, and will be listed with their genericName when looking at a Person, without showing the specific details of the item below. For example, wearing a “pink polka-dot bra” beneath a “tight red t-shirt” will list in descriptions as “a tight red t-shirt and a bra (printing through the tight red t-shirt),” rather than specifically as a “pink polka-dot bra”.
Unless you are actually extending the library, you probably don't need to use any of these GenericApparel classes. If you are just using the library in your game, you're probably better off using the specific Apparel classes.
However, if you need to create an article of Apparel that does not easily fit into any of the specific types, one of the generic types may be useful to you.
This is the generic Apparel type from which all other Apparel is derived. PersistentObjects that specify this type in their defaults must also explicitly provide a ClothingSlots field and all genericName properties.
Several specific Apparel types are provided, which ought to cover most use-cases, simplifying the structure of the defaults files.