Rooms continued. ________________ This file explains a few other things that you can do with rooms such as : search, property, add_exit, remove_exit and items. Also some of the other principles shown in the example at the end would be well worth understanding. There is also now the ability to add footprints to a room and the functions involved will listed later on. set_property( ({"no_xxx", ..}) ) : Sets up a property of your room. Some examples are : no_fight, no_steal, no_magic, etc. set_items( ({"xxx", "xxxx", ..}) ): Introduces an item in your room. When players look at the first argument (the object in your room) the second argument (its description) is returned. add_exit (dest,dir) : Adds an exit in your room. The first argument is the room to which the player can now move. The second argument is what they have to type to get there. remove_exit (dir) : Opposite to add_exit, the arguments work in the same way. remove_exit (dest) or remove_exit(dest, dir) search(str) : A function you can set at the end of your file, this is called when a player searches in your room. The argument is what the player has tried to search. EXAMPLE: inherit "room/room"; reset(arg) { ::reset(); if (arg) return; set_short("The transit room"); set_long("This is the transit room. On a panel before you are three buttons.\n" + "The room is filled with a strange aura of magic, yet its a magic that you have\n" + "never seen before. You suspect that normal magic will not work here.\n" + "An archway to the south leads to the Endoplasmatorium.\n"); set_property( ({"no_magic"}) ); set_outdoors(0); /* inside */ set_light(1); set_dest_dir( ({"room/city/endo", "south" }) ); set_items ( ({ "panel", "The panel has a blue button, a yellow button and a green button", "blue", "You examine the blue button. You catch the smell of salt air...", "yellow", "You examine the yellow button. For an instant you feel very parched...", "green", "You examine the green button. Just for an instant you hear wind through the trees..." }) ); } init() { ::init(); add_action("button"); add_verb("push"); add_action("button"); add_verb("press"); } move(str) { if (query_verb() == "west"){ write ("The portal to the west collapses.\n"); remove_exit ("west"); } if (query_verb() == "north"){ write ("The portal to the north blows away.\n"); remove_exit ("north"); } if (query_verb() == "east"){ write ("The portal to the east implodes.\n"); remove_exit ("room/city/endo", "east"); } return ::move(str); } button(str) { notify_fail("Which button would you like to press ?\n"); if (str == "blue") { write ("You press the blue button.\n"); write ("A magical portal forms on the west wall.\n"); add_exit ("room/jetty", "west"); return 1; } if (str == "yellow") { write ("You press the yellow button.\n"); write ("A magical portal shimmers out of the north wall.\n"); add_exit ("room/dh6", "north"); return 1; } if (str == "green") { write ("You press the green button.\n"); write ("A magical portal grows to the east.\n"); add_exit ("room/vr8", "east"); return 1; } return 0; } search(str) { write ("You search around for awhile, and discover that the walls are not quite real...\n"); return 1; } This programming example exist presently in '/open/workroom.c'. FOOTPRINTS:- ~~~~~~~~~~~~ Footprint code is now in room/room so that if you want footprints all you have to do is call the function "set_prints(X)" where X = can have 2 values :- X = 1 footprints are on and whenever anyone leaves the room footprints will be left behind. X = 0 footprints will be disabled, and any footprints that are currently in the room will be switched off and removed. Other functions that use footprints :- query_prints() returns 1 if footprints are active in the room. query_prints_status() returns 0 if no footprints, 1 if one set of prints and 2 if there are 2 or more prints. query_prints_short() returns a string containing the shout discription of the footprints. query_prints_long() returns a string containing the long discription of the footprints. clean_prints() will remove all footprints from the room. A few things to note:- ~~~~~~~~~~~~~~~~~~~~~~ - Footprints will disappear after 5 minutes. - Footprints will not appear if the room is outside and it is raining heavily, or the wind is blowing strong. If there are already footprints on the ground then those prints will be removed. - Footprints users the function exit() to find out when people leave the room. If you want to use footprints and also use this function then be sure to include the line "::exit(str);" where str if the argument passed into the function. - As exit() is called when anyone leaves the room by any means. footprints will show a slightly different discription when someone teleports out of the room. - For examples of this code in action please refer to /doc/example/fp_room.c for an example of a room that uses footprints, and broom.c in the same directory for an example of a broom that will remove footprints from a room.