18.1 Introduction
There are several routines in an Infocom games that specialize in describing locations and objects which are an essential part of any game. “Learning ZIL” mentions DESCRIBE-ROOM and DESCRIBE-OBJECTS, but there are also DESCRIBE-OBJECT, PRINT-CONT, and later PRINT-CONTENTS which complete the needed routines to display an object and its contents. For example, LOOK would call DESCRIBE-ROOM and DESCRIBE-OBJECTS with the verbose argument set. Other commands, like INVENTORY or LOOK-INSIDE, would call PRINT-CONT on the WINNER or PRSO, respectively.
18.2 PRINT-CONT
- Arguments: Object or Room number, Verbose flag, LEVEL number
- Returns: TRUE if there is some descriptive output, FALSE if none given
PRINT-CONT will describe the contents of the objects contained in the given object or room. The routine will first describe each object by display the string in the FDESC (First DESCription) property of the object. Any object that also can be seen inside (using SEE-INSIDE? predicate) will have PRINT-CONT recursively called on it. If the routine is being used to display the inventory of the WINNER’s possession, it will skip the display of the FDESC’s of all the objects. PRINT-CONT will then see if a special header (such as “You are carrying:” or “The <object> contains: “) needs to be displayed by seeing. This is done when an inventory is requested or the objects have already been “touched”. This also needs to be the first text displayed for that particular routine call. PRINT-CONT will then call DESCRIBE-OBJECT on each object to have it described. If any of these objects are an integral part of another object, then PRINT-CONT is called recursively on this integral object to see if anything else can be described. Once all the objects are checked again, PRINT-CONT will also see if the WINNER is in a vehicle and if that vehicle is part of the contents of the original requested object. If so, then PRINT-CONT will be called on that vehicle. While a verbose flag argument can be passed, it is never used. The LEVEL argument determines the indent of the descriptive text uses spaces from the IDENTS table (maximum of 5). As the routine does further recursion, the level number increases along with the corresponding indent.
18.3 DESCRIBE-OBJECT
- Arguments: Object or Room number, Verbose flag, LEVEL number
- Returns: TRUE if extra descriptive output given from internal objects, FALSE if none given
DESCRIBE-OBJECT will try to display a descriptive text about an object using the FDESC (if the object is untouched) or LDESC. If neither is available, a generic description is given, “There is a” for level 0 or “A” for all other levels. If the WINNER is also in a vehicle, then a clarifying “(in the room)” is given to remind the WINNER that the object is NOT in the vehicle. Also any objects that have visible contents will be also called with PRINT-CONT to display the contents of that object. Againa, the Verbose flag is not used in the routine but passed to PRINT-CONT if it is called.
18.4 DESCRIBE-OBJECTS
- Arguments: Verbose flag
- Returns: TRUE if there is some descriptive output, FALSE if none given
DESCRIBE-OBJECTS will try to display a descriptive text for all the objects in the current location (HERE). It will not display a description of the location itself. If that location is not lit, the routine will return with the error message “I can’t see anything in the dark.” If any objects do exist in the current location, DESCRIBE-OBJECTS will call PRINT-CONT with this location and the current VERBOSE level if one is not given. Return values are the same as PRINT-CONT.
18.5 DESCRIBE-ROOM
- Arguments: TRUE (if called by LOOK action)
- Returns: TRUE if room description given, FALSE if too dark to give description
DESCRIBE-ROOM will initially check if the room is dark, displaying a too-dark error message if it is. The routine will then display the room name and decide if a further descriptions should be given. If it was not called by a LOOK command or SUPERBRIEF is SET, then no further description is given. If the WINNER is in a vehicle which is also in the room, the routine will indicate that with the clarifying “(You are in the <vehicle>.)”. DESCRIBE-ROOM will then check if the Verbose flag is set, or the room is untouched. Either situation would have the routine try to call the room’s ACTION routine with M-LOOK to provide a description. If this fails, the room’s LDESC string will be used if possible. If a room is untouched, then that room’s TOUCHBIT will be set.
18.6 PRINT-CONTENTS
- Arguments: Object number
- Returns: TRUE
PRINT-CONTENTS was added with Sorcerer-R6 to quickly display a list of objects in a room or container. The object names would be separated by commas and “and”, if necessary. If only one object was listed, then IT-OBJECT would be updated with that object.
18.7 Update: DESCRIBE-ROOM
Zork 2 added a new RARG (M-FLASH or $04) on a room’s ACTION routine even if verbose is clear (minimal output). This allows a room to display important information even if the room was already touched or verbose is clear. It also added a final call to the WINNER’s vehicle’s ACTION with M-LOOK (if in a vehicle) when describing the current location.
No comments:
Post a Comment