Postures by Emily Short Search for other extensions by this author Approved for the Public Library

Versions

Download version 3/150415For Inform 7 6L38

Links

Description

Postures defines three postures -- seated, standing, and reclining -- and allows pieces of furniture to specify which postures are possible and preferred when the player is on those furnishings. Version 3 offers minor updates, mostly to improve the documentation.

Tags world-model

Documentation

Postures defines three postures -- seated, standing, and reclining -- and allows pieces of furniture to specify which postures are possible and preferred when the player is on those furnishings. Chapter: Postures and Furniture Section: Possible Postures Each piece of furniture comes with a range of possible postures, which can be expressed with the posture-permission relation: as in The bunk bed allows seated and reclining. This definition would say that we're allowed to sit or lie down on the bunk bed, but not to stand up on it. Player attempts to >STAND ON BUNK BED will be rejected with "You can't take that position on the bunk bed." Section: Preferred Postures In addition to permitted postures, furniture can have a "preferred" posture: it's possible to stand on a chair, but we're more likely to sit on it. Preferred postures are used to guess what the player means if he types >GET ON BUNK BED without naming a posture. To set a preferred posture, we would write, e.g., The posture of the bunk bed is reclining. Or for an entire kind of furniture, A chair is a kind of supporter. Every chair allows seated and standing. The posture of a chair is usually seated. Section: Entering and Leaving Furniture If an actor attempts to leave an enterable object, his posture is automatically returned to "standing"; if he enters something without setting a posture explicitly, as in >GET ON SOFA the actor's posture will automatically be set to the default posture for that piece of furniture (sitting, in this case). Section: Defining New Furniture To make use of the features of Postures, we may define pieces of furniture like so: A chair is a kind of supporter. A chair is always enterable. Every chair allows seated and standing. A chair is usually seated. Section: Rooms and Postures Rooms cannot enter into the posture-allowing relation. However, rooms can be set as "posture-friendly" (you can lie or sit down on the ground in those rooms) and "posture-unfriendly" (no lying down or sitting allowed). By default, they are posture-friendly. This feature determines whether a player can take postures other than standing while in a room (that is, not on a piece of furniture). Suppose the player types >LIE DOWN without naming where he wants to lie down. If the room is posture-friendly, he will lie down in the location. If it's posture-unfriendly, the game will look for an available piece of furniture that allows reclining (ideally one whose preferred posture is reclining) and try to lie on that, instead. Example: * Muddy Lawn - A room where the player can't sit on the ground, plus a folding chair, a safer-to-sit-on driveway, and the ubiquitous guinea-pig Clark. Include Postures by Emily Short. A chair is a kind of supporter. A chair is always enterable. Every chair allows seated and standing. The posture of a chair is usually seated. The Muddy Lawn is a posture-unfriendly room. West of the Muddy Lawn is the Driveway. Clark is a man in the Muddy Lawn. A persuasion rule: persuasion succeeds. The Muddy Lawn contains a folding chair. The description of the folding chair is "Made of metal and plastic, and intended for outdoor use." The folding chair is a chair. The folding chair is portable. Test me with "lie on chair / sit on chair / stand on chair / stand up / exit / sit down / look / stand up / lie down / sit on chair / west / east / Clark, sit on chair / Clark, stand / Clark, sit down / Clark, stand / Clark, lie down / Clark, stand / Clark, lie on chair / Clark, stand on chair / Clark, west / west / Clark, sit / sit / Clark, east / east / get chair / west / drop chair / sit down / get up / sit on chair".