Wearable.h An Inform 6 extension by she's long gone Version 1 released July 2004 Please send all feedback to w4y795b02@sneakemail.com Contents - 1. Creating Wearables 2. NPC Support 3. Optional Verbs 4. Future Plans 5. Credit 1. Creating Wearables - Be sure to #Include the Wearable.h file between "Parser" and "Verblib". All articles of clothing should belong to the class Wearable. Wearables have a number of common properties, the most important of which are worn_by and clothing_type. Worn_by is equal to the person wearing the item, for example the player, or to nothing if it is not being worn. While you will have to set this property yourself for any items which are being worn as the game begins, the library will handle it from there on out. Clothing_type is meant to store the general location on the body the item is worn, and can take whatever value you like. My own practice is as follows: 1 = The lower body, such as pants and skirts. 2 = The upper body, chiefly shirts, but also (as we shall see) dresses. 3 = The feet. 4 = The hands. 5 = The head. The only restriction here (and it is an easily circumvented one) is that a value of 10 will cause the item to act as a burqa, covering everything already being worn. Items which share the same clothing_type value will overlap one another when worn. Here, the layer property keeps track of which items are where; this property increases the further removed from the skin an item is. Thus the first item worn will have a layer of 1; the second, of 2, and so on. When not being worn, an item's layer is 0. You will unfortunately have to set this property yourself at the beginning of a game for any items being worn at the start, but again, the library will handle it afterwards. The skirtlike property is for skirts and dresses, and allows other wearables to be put on and taken off from underneath them even while they are being worn. For a normal skirt, just set its skirtlike property the same as its clothing_type property. This allows the wearer to change underwear, for example, without taking her skirt off (if that wearer doesn't mind being a bit scandalous). A dress, however, is slightly more complicated. It can cover items in two clothing_type areas at once. Its skirtlike property, then, should not be the same as its clothing_type. Instead, it should be equal to the clothing_type of a regular skirt. Perhaps an example is in order here. Wearable skirt "skirt" with name "skirt", description "A cute little miniskirt.", clothing_type 1, skirtlike 1; Wearable dress "red dress" with name "dress", description "A ravishing red dress.", clothing_type 2, skitlike 1; Both the miniskirt and the dress would allow a pair of underwear with clothing_type 1 to be put on or taken off from underneath them. Only the dress, however, could also cover a brassiere with clothing_type 2. Note that the dress would have to be taken off before the bra could be. Once worn, a wearable's covered_by and covering properties become relevant. An item's covered_by is simply equal the item of clothing being worn directly over it (if any), and its covering propery to the item it is being worn over (again, if any). If an item is being covered, any attempt to manipulate it will generate a "You can't, because the x is in the way." message. A dress, of course, being more complicated, has a few more relevant properties. Skirt_layer is the number of items being worn under its lower half. Skirt_covering keeps track of the highest-layered item under that half. For example: Wearable dress "red dress" with name "dress", description "A ravishing red dress.", clothing_type 2, covering bra, layer 2, skitlike 1, skirt_covering underwear, skirt_layer 2; Wearable underwear "underwear" with name "underwear", description "Your faithful undies.", clothing_type 1, covered_by dress, layer 1; Wearable bra "bra" with name "bra", description "Your faithful brassiere.", clothing_type 2, covered_by dress, layer 1; There are a few more properties, which you needn't bother with and can safely ignore. Min_layer is the minimum layer an item can be worn at; in other words, it is the minimum number of items which must already be worn for it to be put on. Max_layer is just what it sounds like. You could combine these to ensure that underwear is always the first thing put on, and cannot be worn over anything else: Wearable underwear "underwear" with name "underwear", description "Your faithful undies.", clothing_type 1, max_layer 1; Wearable pants "pants" with name "pants", description "Fresh from the drycleaners.", clothing_type 1, min_layer 2; The default value for min_layer is 1, and for max_layer is 5. There is also a skirt_maxlayer, for dresses; its default value is 3. Manipulable_when_locked, if set to true, allows an item to worn or taken off even when it is locked. Thus a locket could be taken off it while not openable. This property is false by default. Gendered, while not set to any value intially, can be used to prevent an actor from putting on clothing inappropriate to his or her gender. It can be set to male, female, or neuter. For example: Wearable bra "bra" with name "bra", description "Your faithful brassiere.", clothing_type 2, gendered female; If a male player attempts to wear it, he will receive the message "That's for girls." Finally, the attributes -clothing- and -worn- are effectively obsolete, and are included only for purposes of compatibility. They can safely be removed from the Library and Wearable.h. 2. NPC Support - Having an NPC put on or take off an article of clothing is fairly easy. If the player is giving an order, it is sufficient to call WearSub() or DisrobeSub(), and then return true. If the NPC is acting independently, call something like WearSub(shirt, jane). 3. Optional Verbs - The file WearVerb.h includes four optional verbs: tuck, buckle, zip, and button. They are at this point fairly undeveloped, and can be used as you like. 4. Future Plans - 1. Implementing some sort of sizing system for clothing, so that the player doesn't wear clothes intended (for example) for children. 2. Bulky clothing, which only allows clothing of a minimum size to be worn over it. This is currently implemented in a very minimal way. 3. Socially ranked clothing, so that nobody wears clothes inappropriate to their caste. 5. Credit - Several of the routines used--CheckLayer, CheckArea, and CheckAreaLow--were directly inspired by Timothy Groves' additions to Clothes.h. The DescribeClothes routine was, as I recall, lifted with some alteration from Adam Cadre's I-0 source.