Commonly Used Properties in Rooms Rooms use the common object properties short, long, and light. In addition, they also use the following special properties: exits. The exits property is a mapping whose keys are the directions the player can go and whose values are the filenames of the rooms the exit takes him to. For example: set ("exits", ([ "north" : "/d/TMI/partyroom.c" ]) ) ; would give the room one exit, north, which would take the player to the party room in the TMI domain. One can also use: add ("exits", ([ "south" : "/d/TMI/drunktank.c" ]) ) ; which would add a new exit to the existing ones. One can also use: delete ("exits/south") ; which would remove the south exit. no_vision. The no_vision property is a string which is returned when the player tries to look in the room, in place of the usual long_desc plus contents. Unlike a dark room, a no_vision room still permits a player to examine his objects and objects in the room, it just doesn't permit him to see the whole room at once. Also, torches do not clear no_vision. The usual use for this property is "The room is full of smoke and you cannot see." but you can be much more creative than that with it. item_desc. The item_desc property is a mapping whose keys are the names of things mentioned in the room description and whose values are string to be returned if the player looks at those things. This makes it possible to give descriptions to items in the room without having to clone up actual objects. For example, suppose the room did: set ("long", "This is a room with a single chair in the middle") ; set ("item_desc", ([ "chair" : "This chair is very rickety and would collapse if you sat in it." ]) ) ; Then, if a player entered the room and typed "look at chair", he would see the description of the chair, even though there is not an actual chair object in the room. item_func. The item_func property is a mapping whose keys are the names of things mentioned in the room description and whose values are functions to be called if the player looks at the item. For example, one can create the famous painting portal by doing this: set ("item_func", ([ "painting", "teleport" ]) ) ; int teleport() { < code to move the player to another room> and then, if a player enters the room and types "look at painting", the function teleport will be called and the player will be bamfed to wherever to code sends him. There are many other possible creative uses for this property. objects. The objects property is a mapping whose keys are the ids of objects and whose values are the filenames of those objects. When the room is reset, any object in the objects property which is not present will be cloned and moved to the room. This avoids having to manually write a lot of reset procedures in your rooms. For example, a room containing this code: set ("objects", ([ "orc" : "/obj/orc", "chair 2" : "/obj/chair", "chair 2" : "/obj/chair" ]) ) ; will, at reset time, bring the contents of the room up to one orc and two chairs, cloning new items as needed to make that happen. pre_exit_func. The pre_exit_func property is a mapping whose keys are the directions that a player can exit the room and whose values are functions that will be called in the room just before the player leaves. For example, if the room code contains: set ("pre_exit_func", ([ "north" : "foo" ]) ) ; then whenever a player left the room via the north exit, the function foo would be called just BEFORE the player left the room. If the function returns 1, then the player will not be allowed to leave the room. post_exit_func. The post_exit_func property is a mapping whose keys are directions and whose values are functions to be called just AFTER the player leaves the room. The only difference between pre_exit_func and post_exit_func is that the moving player is in the room sent to the leaving player. exit_msg. The exit_msg property allows you to supersede the usual "Fred leaves east" message with a special message for that room. For example, if you had a room full of mirrors, you might: set ("exit_msg", ([ "north" : "$N leaves, but the mirrors make it impossible "to know what direction he went.\n") ; then that message would be displayed whenever the player went north. If there is no exit_msg for a direction, then the default message is used, either "$N leaves $D" for a player or a wizard's custom message.