dw_fluffos_v2/
dw_fluffos_v2/fluffos-2.9-ds2.05/
dw_fluffos_v2/fluffos-2.9-ds2.05/ChangeLog.old/
dw_fluffos_v2/fluffos-2.9-ds2.05/Win32/
dw_fluffos_v2/fluffos-2.9-ds2.05/compat/
dw_fluffos_v2/fluffos-2.9-ds2.05/compat/simuls/
dw_fluffos_v2/fluffos-2.9-ds2.05/include/
dw_fluffos_v2/fluffos-2.9-ds2.05/testsuite/
dw_fluffos_v2/fluffos-2.9-ds2.05/testsuite/clone/
dw_fluffos_v2/fluffos-2.9-ds2.05/testsuite/command/
dw_fluffos_v2/fluffos-2.9-ds2.05/testsuite/data/
dw_fluffos_v2/fluffos-2.9-ds2.05/testsuite/etc/
dw_fluffos_v2/fluffos-2.9-ds2.05/testsuite/include/
dw_fluffos_v2/fluffos-2.9-ds2.05/testsuite/inherit/
dw_fluffos_v2/fluffos-2.9-ds2.05/testsuite/inherit/master/
dw_fluffos_v2/fluffos-2.9-ds2.05/testsuite/log/
dw_fluffos_v2/fluffos-2.9-ds2.05/testsuite/single/
dw_fluffos_v2/fluffos-2.9-ds2.05/testsuite/single/tests/compiler/
dw_fluffos_v2/fluffos-2.9-ds2.05/testsuite/single/tests/efuns/
dw_fluffos_v2/fluffos-2.9-ds2.05/testsuite/single/tests/operators/
dw_fluffos_v2/fluffos-2.9-ds2.05/testsuite/u/
dw_fluffos_v2/fluffos-2.9-ds2.05/tmp/
dw_fluffos_v2/fluffos-2.9-ds2.05/windows/
dw_fluffos_v2/lib/
dw_fluffos_v2/lib/binaries/cmds/
dw_fluffos_v2/lib/binaries/cmds/creator/
dw_fluffos_v2/lib/binaries/cmds/living/
dw_fluffos_v2/lib/binaries/cmds/player/
dw_fluffos_v2/lib/binaries/d/admin/obj/
dw_fluffos_v2/lib/binaries/d/liaison/
dw_fluffos_v2/lib/binaries/global/virtual/
dw_fluffos_v2/lib/binaries/global/virtual/setup_compiler/
dw_fluffos_v2/lib/binaries/obj/handlers/autodoc/
dw_fluffos_v2/lib/binaries/obj/handlers/terrain_things/
dw_fluffos_v2/lib/binaries/obj/misc/
dw_fluffos_v2/lib/binaries/obj/misc/buckets/
dw_fluffos_v2/lib/binaries/obj/monster/
dw_fluffos_v2/lib/binaries/obj/reactions/
dw_fluffos_v2/lib/binaries/obj/reagents/
dw_fluffos_v2/lib/binaries/secure/cmds/creator/
dw_fluffos_v2/lib/binaries/secure/master/
dw_fluffos_v2/lib/binaries/std/
dw_fluffos_v2/lib/binaries/std/dom/
dw_fluffos_v2/lib/binaries/std/effects/object/
dw_fluffos_v2/lib/binaries/std/guilds/
dw_fluffos_v2/lib/binaries/std/languages/
dw_fluffos_v2/lib/binaries/std/races/
dw_fluffos_v2/lib/binaries/std/room/
dw_fluffos_v2/lib/binaries/std/room/basic/
dw_fluffos_v2/lib/binaries/std/shops/
dw_fluffos_v2/lib/binaries/std/shops/inherit/
dw_fluffos_v2/lib/binaries/www/
dw_fluffos_v2/lib/cmds/guild-race/
dw_fluffos_v2/lib/cmds/guild-race/crafts/
dw_fluffos_v2/lib/cmds/guild-race/other/
dw_fluffos_v2/lib/cmds/playtester/
dw_fluffos_v2/lib/cmds/playtester/senior/
dw_fluffos_v2/lib/d/admin/
dw_fluffos_v2/lib/d/admin/log/
dw_fluffos_v2/lib/d/admin/mapper/31-10-01/mapmaker/event/
dw_fluffos_v2/lib/d/admin/meetings/
dw_fluffos_v2/lib/d/admin/obj/
dw_fluffos_v2/lib/d/admin/room/we_care/
dw_fluffos_v2/lib/d/admin/save/
dw_fluffos_v2/lib/d/dist/
dw_fluffos_v2/lib/d/dist/mtf/
dw_fluffos_v2/lib/d/dist/pumpkin/
dw_fluffos_v2/lib/d/dist/pumpkin/chars/
dw_fluffos_v2/lib/d/dist/pumpkin/desert/
dw_fluffos_v2/lib/d/dist/pumpkin/gumboot/
dw_fluffos_v2/lib/d/dist/pumpkin/hospital/
dw_fluffos_v2/lib/d/dist/pumpkin/inherit/
dw_fluffos_v2/lib/d/dist/pumpkin/map/
dw_fluffos_v2/lib/d/dist/pumpkin/plain/
dw_fluffos_v2/lib/d/dist/pumpkin/pumpkin/
dw_fluffos_v2/lib/d/dist/pumpkin/save/
dw_fluffos_v2/lib/d/dist/pumpkin/squash/
dw_fluffos_v2/lib/d/dist/pumpkin/terrain/
dw_fluffos_v2/lib/d/dist/pumpkin/woods/
dw_fluffos_v2/lib/d/dist/start/
dw_fluffos_v2/lib/d/learning/TinyTown/buildings/
dw_fluffos_v2/lib/d/learning/TinyTown/map/
dw_fluffos_v2/lib/d/learning/TinyTown/roads/
dw_fluffos_v2/lib/d/learning/add_command/
dw_fluffos_v2/lib/d/learning/arms_and_weps/
dw_fluffos_v2/lib/d/learning/chars/
dw_fluffos_v2/lib/d/learning/cutnpaste/
dw_fluffos_v2/lib/d/learning/examples/npcs/
dw_fluffos_v2/lib/d/learning/examples/player_houses/npcs/
dw_fluffos_v2/lib/d/learning/examples/terrain_map/basic/
dw_fluffos_v2/lib/d/learning/functions/
dw_fluffos_v2/lib/d/learning/handlers/
dw_fluffos_v2/lib/d/learning/help_topics/npcs/
dw_fluffos_v2/lib/d/learning/help_topics/objects/
dw_fluffos_v2/lib/d/learning/help_topics/rcs_demo/
dw_fluffos_v2/lib/d/learning/help_topics/rooms/
dw_fluffos_v2/lib/d/learning/help_topics/rooms/crowd/
dw_fluffos_v2/lib/d/learning/help_topics/rooms/situations/
dw_fluffos_v2/lib/d/learning/items/
dw_fluffos_v2/lib/d/learning/save/
dw_fluffos_v2/lib/d/liaison/
dw_fluffos_v2/lib/d/liaison/NEWBIE/doc/
dw_fluffos_v2/lib/d/liaison/NEWBIE/save/oldlog/
dw_fluffos_v2/lib/db/
dw_fluffos_v2/lib/doc/
dw_fluffos_v2/lib/doc/creator/
dw_fluffos_v2/lib/doc/creator/autodoc/include/reaction/
dw_fluffos_v2/lib/doc/creator/autodoc/include/ritual_system/
dw_fluffos_v2/lib/doc/creator/autodoc/include/talker/
dw_fluffos_v2/lib/doc/creator/autodoc/include/terrain_map/
dw_fluffos_v2/lib/doc/creator/autodoc/obj/baggage/
dw_fluffos_v2/lib/doc/creator/autodoc/obj/clock/
dw_fluffos_v2/lib/doc/creator/autodoc/obj/clothing/
dw_fluffos_v2/lib/doc/creator/autodoc/obj/cont_save/
dw_fluffos_v2/lib/doc/creator/autodoc/obj/corpse/
dw_fluffos_v2/lib/doc/creator/autodoc/obj/money/
dw_fluffos_v2/lib/doc/creator/autodoc/obj/monster/
dw_fluffos_v2/lib/doc/creator/autodoc/obj/scabbard/
dw_fluffos_v2/lib/doc/creator/autodoc/obj/service_provider/
dw_fluffos_v2/lib/doc/creator/autodoc/obj/state_changer/
dw_fluffos_v2/lib/doc/creator/autodoc/obj/wand/
dw_fluffos_v2/lib/doc/creator/autodoc/std/book_dir/
dw_fluffos_v2/lib/doc/creator/autodoc/std/key/
dw_fluffos_v2/lib/doc/creator/autodoc/std/learning/
dw_fluffos_v2/lib/doc/creator/autodoc/std/map/
dw_fluffos_v2/lib/doc/creator/autodoc/std/race/
dw_fluffos_v2/lib/doc/creator/autodoc/std/weapon_logic/
dw_fluffos_v2/lib/doc/creator/files/
dw_fluffos_v2/lib/doc/creator/policy/
dw_fluffos_v2/lib/doc/creator/room/
dw_fluffos_v2/lib/doc/effects/
dw_fluffos_v2/lib/doc/ideas/
dw_fluffos_v2/lib/doc/known_command/
dw_fluffos_v2/lib/doc/lpc/basic_manual/
dw_fluffos_v2/lib/doc/lpc/intermediate/
dw_fluffos_v2/lib/doc/new/add_command/
dw_fluffos_v2/lib/doc/new/handlers/
dw_fluffos_v2/lib/doc/new/living/
dw_fluffos_v2/lib/doc/new/living/race/
dw_fluffos_v2/lib/doc/new/living/spells/
dw_fluffos_v2/lib/doc/new/player/
dw_fluffos_v2/lib/doc/new/room/guild/
dw_fluffos_v2/lib/doc/new/room/outside/
dw_fluffos_v2/lib/doc/new/room/storeroom/
dw_fluffos_v2/lib/doc/object/
dw_fluffos_v2/lib/doc/playtesters/
dw_fluffos_v2/lib/doc/policy/
dw_fluffos_v2/lib/doc/weapons/
dw_fluffos_v2/lib/global/handlers/
dw_fluffos_v2/lib/global/virtual/setup_compiler/
dw_fluffos_v2/lib/include/
dw_fluffos_v2/lib/include/cmds/
dw_fluffos_v2/lib/include/effects/
dw_fluffos_v2/lib/include/npc/
dw_fluffos_v2/lib/include/shops/
dw_fluffos_v2/lib/net/daemon/chars/
dw_fluffos_v2/lib/net/inherit/
dw_fluffos_v2/lib/net/intermud3/
dw_fluffos_v2/lib/net/intermud3/services/
dw_fluffos_v2/lib/net/obj/
dw_fluffos_v2/lib/net/save/
dw_fluffos_v2/lib/net/smnmp/
dw_fluffos_v2/lib/net/snmp/
dw_fluffos_v2/lib/obj/amulets/
dw_fluffos_v2/lib/obj/b_day/
dw_fluffos_v2/lib/obj/examples/
dw_fluffos_v2/lib/obj/food/alcohol/
dw_fluffos_v2/lib/obj/food/chocolates/
dw_fluffos_v2/lib/obj/food/fruits/
dw_fluffos_v2/lib/obj/food/meat/
dw_fluffos_v2/lib/obj/food/nuts/
dw_fluffos_v2/lib/obj/food/seafood/
dw_fluffos_v2/lib/obj/food/vegetables/
dw_fluffos_v2/lib/obj/fungi/
dw_fluffos_v2/lib/obj/furnitures/artwork/
dw_fluffos_v2/lib/obj/furnitures/bathroom/
dw_fluffos_v2/lib/obj/furnitures/beds/
dw_fluffos_v2/lib/obj/furnitures/cabinets/
dw_fluffos_v2/lib/obj/furnitures/chairs/
dw_fluffos_v2/lib/obj/furnitures/chests/
dw_fluffos_v2/lib/obj/furnitures/clocks/
dw_fluffos_v2/lib/obj/furnitures/crockery/
dw_fluffos_v2/lib/obj/furnitures/cupboards/
dw_fluffos_v2/lib/obj/furnitures/cushions/
dw_fluffos_v2/lib/obj/furnitures/fake_plants/
dw_fluffos_v2/lib/obj/furnitures/lamps/
dw_fluffos_v2/lib/obj/furnitures/mirrors/
dw_fluffos_v2/lib/obj/furnitures/outdoor/
dw_fluffos_v2/lib/obj/furnitures/safes/
dw_fluffos_v2/lib/obj/furnitures/shelves/
dw_fluffos_v2/lib/obj/furnitures/sideboards/
dw_fluffos_v2/lib/obj/furnitures/sofas/
dw_fluffos_v2/lib/obj/furnitures/stoves/
dw_fluffos_v2/lib/obj/furnitures/tables/
dw_fluffos_v2/lib/obj/furnitures/wardrobes/
dw_fluffos_v2/lib/obj/handlers/
dw_fluffos_v2/lib/obj/handlers/autodoc/
dw_fluffos_v2/lib/obj/jewellery/anklets/
dw_fluffos_v2/lib/obj/jewellery/bracelets/
dw_fluffos_v2/lib/obj/jewellery/earrings/
dw_fluffos_v2/lib/obj/jewellery/misc/
dw_fluffos_v2/lib/obj/jewellery/necklaces/
dw_fluffos_v2/lib/obj/jewellery/rings/
dw_fluffos_v2/lib/obj/media/
dw_fluffos_v2/lib/obj/misc/buckets/
dw_fluffos_v2/lib/obj/misc/jars/
dw_fluffos_v2/lib/obj/misc/papers/
dw_fluffos_v2/lib/obj/misc/player_shop/
dw_fluffos_v2/lib/obj/misc/shops/
dw_fluffos_v2/lib/obj/misc/traps/
dw_fluffos_v2/lib/obj/monster/
dw_fluffos_v2/lib/obj/monster/godmother/
dw_fluffos_v2/lib/obj/monster/transport/
dw_fluffos_v2/lib/obj/plants/inherit/
dw_fluffos_v2/lib/obj/potions/
dw_fluffos_v2/lib/open/boards/
dw_fluffos_v2/lib/save/autodoc/
dw_fluffos_v2/lib/save/bank_accounts/
dw_fluffos_v2/lib/save/boards/frog/
dw_fluffos_v2/lib/save/books/bed_catalog/
dw_fluffos_v2/lib/save/creators/
dw_fluffos_v2/lib/save/mail/
dw_fluffos_v2/lib/save/mail/p/
dw_fluffos_v2/lib/save/soul/data/
dw_fluffos_v2/lib/save/tasks/
dw_fluffos_v2/lib/save/vaults/
dw_fluffos_v2/lib/secure/cmds/lord/
dw_fluffos_v2/lib/secure/config/
dw_fluffos_v2/lib/secure/items/
dw_fluffos_v2/lib/secure/player/
dw_fluffos_v2/lib/soul/
dw_fluffos_v2/lib/soul/i/
dw_fluffos_v2/lib/soul/j/
dw_fluffos_v2/lib/soul/k/
dw_fluffos_v2/lib/soul/o/
dw_fluffos_v2/lib/soul/q/
dw_fluffos_v2/lib/soul/to_approve/
dw_fluffos_v2/lib/soul/u/
dw_fluffos_v2/lib/soul/v/
dw_fluffos_v2/lib/soul/wish_list/
dw_fluffos_v2/lib/soul/y/
dw_fluffos_v2/lib/soul/z/
dw_fluffos_v2/lib/std/creator/
dw_fluffos_v2/lib/std/effects/
dw_fluffos_v2/lib/std/effects/attached/
dw_fluffos_v2/lib/std/effects/external/
dw_fluffos_v2/lib/std/effects/fighting/
dw_fluffos_v2/lib/std/effects/other/
dw_fluffos_v2/lib/std/environ/
dw_fluffos_v2/lib/std/guilds/
dw_fluffos_v2/lib/std/hospital/
dw_fluffos_v2/lib/std/house/
dw_fluffos_v2/lib/std/house/onebedhouse/
dw_fluffos_v2/lib/std/house/onebedhut/
dw_fluffos_v2/lib/std/house/tworoomflat/
dw_fluffos_v2/lib/std/languages/
dw_fluffos_v2/lib/std/liquids/
dw_fluffos_v2/lib/std/nationality/
dw_fluffos_v2/lib/std/nationality/accents/
dw_fluffos_v2/lib/std/nationality/accents/national/
dw_fluffos_v2/lib/std/nationality/accents/regional/
dw_fluffos_v2/lib/std/npc/goals/
dw_fluffos_v2/lib/std/npc/goals/basic/
dw_fluffos_v2/lib/std/npc/goals/misc/
dw_fluffos_v2/lib/std/npc/inherit/
dw_fluffos_v2/lib/std/npc/plans/
dw_fluffos_v2/lib/std/npc/plans/basic/
dw_fluffos_v2/lib/std/outsides/
dw_fluffos_v2/lib/std/races/shadows/
dw_fluffos_v2/lib/std/room/basic/topography/
dw_fluffos_v2/lib/std/room/controller/
dw_fluffos_v2/lib/std/room/controller/topography/
dw_fluffos_v2/lib/std/room/furniture/games/
dw_fluffos_v2/lib/std/room/furniture/inherit/
dw_fluffos_v2/lib/std/room/inherit/carriage/
dw_fluffos_v2/lib/std/room/inherit/topography/
dw_fluffos_v2/lib/std/room/punishments/
dw_fluffos_v2/lib/std/room/topography/area/
dw_fluffos_v2/lib/std/room/topography/iroom/
dw_fluffos_v2/lib/std/room/topography/milestone/
dw_fluffos_v2/lib/std/shadows/
dw_fluffos_v2/lib/std/shadows/attached/
dw_fluffos_v2/lib/std/shadows/curses/
dw_fluffos_v2/lib/std/shadows/disease/
dw_fluffos_v2/lib/std/shadows/fighting/
dw_fluffos_v2/lib/std/shadows/room/
dw_fluffos_v2/lib/std/shops/controllers/
dw_fluffos_v2/lib/std/shops/objs/
dw_fluffos_v2/lib/std/shops/player_shop/
dw_fluffos_v2/lib/std/shops/player_shop/office_code/
dw_fluffos_v2/lib/std/socket/
dw_fluffos_v2/lib/www/
dw_fluffos_v2/lib/www/external/autodoc/
dw_fluffos_v2/lib/www/external/java/telnet/Documentation/
dw_fluffos_v2/lib/www/external/java/telnet/Documentation/images/
dw_fluffos_v2/lib/www/external/java/telnet/examples/
dw_fluffos_v2/lib/www/external/java/telnet/tools/
dw_fluffos_v2/lib/www/pics/
dw_fluffos_v2/lib/www/secure/creator/
dw_fluffos_v2/lib/www/secure/editors/
dw_fluffos_v2/lib/www/secure/survey_results/
dw_fluffos_v2/win32/
<html><!-- #BeginTemplate "/Templates/Body Text.dwt" -->
<head>
<title> Discworld Documentation </title>
</head>
<body bgcolor="#ffffff" TEXT="#000030" LINK="#4a529c" VLINK="#b57339">
<table width="75%" border="0">
  <tr>
    <td><font face="arial,helvetica"><img align=left src="http://discworld.imaginary.com/external//pics/dw4.gif"></font></td>
    <td><font face="arial,helvetica">
      <h2>Discworld Documentation:</h2>
      <h2>LPC for Dummies</h2>
      </font> 
      <p><font size="+1"><!-- #BeginEditable "Title" --><font size="+1"><b>Tutorial 
  Answers </b></font><!-- #EndEditable --></font></p>
      <p><i>N.B - This is a work in progress... a living document if you like. 
        If it appears to be dead when you view it, don't worry. It's most likely 
        just playing possum.</i></p>
      <p>Comments on these chapters and tutorials can be e-mailed to <a href="mailto:drakkos@cableinet.co.uk">Drakkos.</a></p>
    </td>
  </tr>
</table>
<br>
<!-- #BeginEditable "Body" --> 

<p><hr>
<code>QUESTION ONE: </code> 
<blockquote> 
  <p><i>"A plural for objects is automatically created when the object is setup. 
    We've already looked at how set_main_plural() can be used to change the default 
    way the mud pluralises our object. Using add_plural(), demonstrate how we 
    can add further plurals to an NPC." </i></p>
</blockquote>
<p>Add plural can be used in the same way we've already seen with add_adjective. 
  We simply pass in the plural, or an array containing multiple plurals, in the 
  setup of our npc. So if we wanted to add, say, porridges and greys as plurals 
  (which we wouldn't, unless we speak like Gollum, my preciousss), we would use 
  the line: 
<blockquote> 
  <p><code>add_plural(({"greys", "porridges"})). </code></p>
</blockquote>
<p>We would mainly use add_plural when we're coding an item that may have several 
  correct pluralisations. Since the MUD will only add one plural as standard, 
  we use add_plural() to make sure all the bases are covered. <br>
  <br>
<hr>
<p><code>QUESTION TWO: </code>
<blockquote> 
  <p><i>"It's possible to make an NPC auto attack any players who enter the room. 
    Using set_aggressive(), how would we do this?" </i></p>
</blockquote>
<p>Set_aggressive takes a single integer argument of one, two or zero. If we pass 
  in one as an argument, then the NPC becomes aggressive and will attack all players 
  who enter its environment. If we pass it in as two, then the NPC will attack 
  all players, and all NPCs who enter the environment. Passing in zero as an argument 
  will make the NPC passive. So to make our NPC attack players, we use the line: 
<blockquote> 
  <p><code>set_aggressive(1); </code></p>
</blockquote>
<p>In the setup of the NPC. 
<br>
<hr>
<code><br>
QUESTION THREE: </code> 
<blockquote> 
  <p><i>"We can provide our NPC with some cash by using the adjust_money() command. 
    How would we do this to provide our NPC with two Ankh-Morpork dollars and 
    fifty Ankh-Morpork pence?" </i></p>
</blockquote>
<p>Adjust money allows us to modify the NPC's purse. It takes two arguments, the 
  first being the number of coins, and the second being the type of coins. We 
  can get a list of valid types of coin by doing 'call query_valid_types() /obj/handlers/money_handler'. 
  Somewhere in the list that appears are the two types of coin we're interested 
  in: "Ankh-Morpork pence", "Ankh-Morpork dollar", So, we want to give our NPC 
  two dollars: 
<blockquote> 
  <p><code>adjust_money(2, "Ankh-Morpork dollar"); </code></p>
</blockquote>
<p>And fifty pence: 
<blockquote> 
  <p><code>adjust_money(50, "Ankh-Morpork pence"); </code></p>
</blockquote>
<p>We put this wherever we want our NPC to get the money. In most cases, we'll 
  put it into the setup() of our NPC.<br>
  <br>
<hr>
<p><code>QUESTION FOUR: </code>
<blockquote> 
  <p><i>"Discworld being a magical place, it's not unusual for areas to have high 
    levels of background magic. How would you use the set_background_enchant() 
    function to give a room some ambient, residual magic?" </i></p>
</blockquote>
<p>The function set_background_enchant takes a single integer as an argument, 
  and sets the ambient background magic of the room as that value. The line in 
  setup would look like: 
<blockquote> 
  <p><code>set_background_enchant (100); </code></p>
</blockquote>
<p>Which would give the background magic level to those who can sense octarine 
  as: There is the residual taste of magic in this place Higher values, obviously, 
  mean a greater level of background magic. 
<br>
<hr>
<br>
<code>QUESTION FIVE: </code> 
<blockquote> 
  <p><i>"Add_alias() can also be used on rooms to add additional labels for exits. 
    Demonstrate how you can alias exits to synonyms using this function." </i></p>
</blockquote>
<p>Add_alias takes two arguments. The first being the alias, or aliases to apply 
  to an exit, the second being the exit itself. For example: 
<blockquote> 
  <p><code>add_exit ("north", "/oh/some/room", "road"); </code></p>
</blockquote>
<p>We can then allow people to go north by typing 'Bing' or 'Bong' by using: 
<blockquote> 
  <p><code>add_alias ("bing", "north"); <br>
    add_alias ("bong", "north"); </code></p>
</blockquote>
<p>Or combining the two into one call by passing in an array as the first argument: 
<blockquote> 
  <p><code>add_alias (({"bing", "bong"}), "north"); </code></p>
</blockquote>
<p>We can use add_alias to make odd exits somewhat more forgiving, as well as 
  to be flexible with regards to conventional exits. <br>
  <br>
<hr>
<br>
<code> QUESTION SIX: </code> 
<blockquote> 
  <p><i>"Some rooms are, obviously, larger than others. Demonstrate how we can 
    make a room larger or smaller using the set_room_size() function." </i></p>
</blockquote>
<p>Inside rooms have a default size of ten cubic units, a unit being roughly equivalent 
  to a foot. So a normal inside room will be 10' by 10' by 10'. 
<p>We can change the size of a room by using the set_room_size() function. This 
  takes a single argument, which may either be an integer specifying the size 
  of the room, or an array consisting of the three dimensions. 
<p>If the argument is a single value, then the dimensions are assumed to be equal 
  in all directions... in other words, the room is cubic. If we pass in an array, 
  it takes the form ({north-south radius, east-west radius, up-down radius}). 
  So we could use: 
<blockquote> 
  <p><code>set_room_size (20); </code></p>
</blockquote>
<p>To make a room of twenty cubic units, or: 
<blockquote> 
  <p><code>set_room_size (({20, 10, 10})); </code></p>
</blockquote>
<p>To make a room that has a radius of 20 going north to south, a radius of 10 
  going from east to west, and a radius of 10 going up and down. 
<br>
<hr>
<code><br>
QUESTION SEVEN: </code> 
<blockquote> 
  <p><i>"load_chat() allows for special character strings to be passed in which 
    are later expanded. The help file for expand_string() details the codes for 
    this. If passing in a command as 'emote swings $mposs$ hips.' will be expanded 
    as 'The grey blob swings his hips.', what would we pass in to get: </i></p>
  <p><i>a) The capitalised name of a random living object in the room <br>
    b) The pronoun (he/she/it) of an object attacking our NPC <br>
    c) The short description of a random object in the NPC's inventory." </i></p>
</blockquote>
<p>We enclose our special case string between two $ symbols. This indicates to 
  the output processing code that we want to treat the text between the symbols 
  as special. The first character after the first dollar determines which object 
  we're referring to: 
<blockquote> 
  <p><code>m - The NPC itself<br>
    l - A random living object in the NPC's room <br>
    o - A random object in the inventory of the NPC <br>
    a - A random object in the NPC's attacker list, if one exists. </code></p>
</blockquote>
<p>We then follow this immediately with the information we want to access about 
  the object: name - We want the name of the object 
<blockquote> 
  <p><code>cname - We want the capitalised name <br>
    gender - We want the gender string <br>
    poss - We want the possessive string <br>
    obj - We want the objective string <br>
    pronoun - We want the pronoun string <br>
    gtitle - We want the guild title </code></p>
</blockquote>
<p>We also have ashort, possshort, theshort, and oneshort, and these call the 
  relevant short() function on the NPC. 
<p>So, for the cases we have above, we want: 
<blockquote> 
  <p><code>a) $lcname$ (l - random living, cname - capitalised name) <br>
    b) $apronoun$ (a - random attacker, pronoun - pronoun string) <br>
    c) $ooneshort$ (o - random object, oneshort - the short of the object) </code></p>
</blockquote>
<p>These functions can be used in load_chat and load_a_chat in place of a specific 
  reference, for example: 
<blockquote> 
  <p><code>load_chat(20,({ <br>
    &nbsp;&nbsp;&nbsp;&nbsp;1 , ": fiddles with $ooneshort$.",<br>
    </code><code>}));</code> </p>
</blockquote>
<hr>
<p><code>QUESTION EIGHT: </code>
<blockquote> 
  <p><i>"If we pass in an array as action to be executed as a part of add_respond_to_with(), 
    the NPC will randomly perform one of the commands. How would you write an 
    add_respond_to_with to make an NPC say either 'bing' or 'bong' when the player 
    says hello?" </i></p>
</blockquote>
<p>When the action to be performed as a result of an add_respond_to_with is an 
  array, then the NPC will randomly pick one of the elements of the array to execute. 
  Again, these elements take the form of commands to be executed by the NPC, so 
  we'd have: </p>
<blockquote> 
  <p><code>add_respond_to_with(({ "@say",({"hello"}), }), <br>
    &nbsp;&nbsp;&nbsp;&nbsp; ({"say Bing.", "say Bong"})); </code></p>
</blockquote>
<p>Which would give two random reactions to a player saying hello. 
<br>
<hr>
<br>
<code>QUESTION NINE: </code> 
<blockquote> 
  <p><i>"An NPC will execute a story of sorts it a load_chat action is passed 
    in as an array. How would we define a load_chat to make our NPC perform three 
    actions, one after the other, in order?" </i></p>
</blockquote>
<p>Again, we can achieve this simply by passing in the command as an array. Unlike 
  add_respond_to_with, the load_chat() will execute each of these commands in 
  turn, at intervals dictated by the chat frequency. So if we had: </p>
<blockquote> 
  <p><code>load_chat(20,({ 2, ({"' Hello.", <br>
    &nbsp;&nbsp;&nbsp;&nbsp; "' There.", <br>
    &nbsp;&nbsp;&nbsp;&nbsp; "' I'm talking in.", <br>
    &nbsp;&nbsp;&nbsp;&nbsp; "'Slow.", <br>
    &nbsp;&nbsp;&nbsp;&nbsp; "'Motion"}),<br>
    &nbsp;&nbsp;&nbsp;&nbsp; 1, "' Bwah-ha-ha!", }) ); </code></p>
</blockquote>
<p>And our leetle NPC executed the first action (the story array), we'd get:
<blockquote> 
  <p> <code>Our NPC says: Hello. <br>
    Our NPC says: There. <br>
    Our NPC says: I'm talking in. <br>
    Our NPC says: Slow. <br>
    Our NPC says: Motion. </code></p>
</blockquote>
<p>Each element of the story array would be executed before the NPC performed 
  any other random chats.<br>
  <br>
<hr>
<p> <code>QUESTION TEN:</code>
<blockquote> 
  <p> <i>"We've shown above how to move an object into a room. If we had a physical 
    object, such as a sword or a chest, how would it be possible to add the object 
    to a room without it appearing in the inventory line? Add_hidden_object() 
    may prove useful." </i></p>
</blockquote>
<p>Add_hidden_object() adds an object as hidden to a room. Pretty obvious stuff, 
  yes! But it still bears some further explanation. It takes a single object argument, 
  the argument being the object reference we want to add to the room. It moves 
  the object to the room and makes it invisible with regards to the inventory 
  line of the room. It can still be looked at, touched, smelled, kissed, fondled, 
  etc, etc, as normal. Any commands associated with the item can still be used 
  as if the item was there normally. The only difference is that the item will 
  not be shown along with any other physical objects in the room. 
<p>To take an example, let's say we have an item located at /w/your_name/clever_item. 
  We want to move this into our room, so we do: 
<blockquote> 
  <p><code>object ob = clone_object ("/w/your_name/clever_item"); <br>
    ob->move (this_object()); </code></p>
</blockquote>
<p>And then we enter our room, to see: 
<blockquote> 
  <p><code>This is a very cool room, with lots of cool things. More cool things 
    than you could shake a particularly cool stick at! <br>
    There are two obvious exits: east and southwest. <br>
    A clever item is here. <br>
    <br>
    > look clever item <br>
    It's very clever! </code></p>
</blockquote>
<p>But say we don't want that... we want our item to be invisible. So instead, 
  we do: 
<blockquote> 
  <p><code>object ob = clone_object ("/w/your_name/clever_item"); <br>
    add_hidden_object (ob); </code></p>
</blockquote>
<p>And we get: 
<blockquote> 
  <p><code>This is a very cool room, with lots of cool things. More cool things 
    than you could shake a particularly cool stick at! <br>
    There are two obvious exits: east and southwest. </code></p>
  <p><code>>look clever item <br>
    It's very clever! </code></p>
</blockquote>
<p>So although our item does not appear in the inventory line, it is still in 
  the room. 
<br>
<hr>
<br>
<code>QUESTION ELEVEN </code> 
<blockquote> 
  <p><i>"Modify exit is an extremely useful function in room coding, Have a read 
    of the helpfile and see if you can work out the code to <br>
    a) Change the exit message of a player so that it would appear as "<name> 
    staggers off to the <direction>". <br>
    b) Change an exit so that it does not appear in the list of obvious exits 
    in a room." </i></p>
</blockquote>
<p>We've already discussed modify exit a little in tutorial four. This is just 
  an expansion of what we discussed there. In this case, for the first we use 
  the "exit mess" type. The value we pass in after that uses the special character 
  code $N, which is replaced by the name of the object taking the exit. $F and 
  $T are replaced with the from direction, and the to direction respectively. 
  So we'd use a modify exit that looks like: 
<blockquote> 
  <p><code>modify_exit("east", ({"exit mess", <br>
    &nbsp;&nbsp;&nbsp;&nbsp; "$N stagger$s off to the $T."})); </code></p>
</blockquote>
<p>Remember the stagger$s thing is a pluralisation code... it will appear as 'staggers' 
  for one object taking the exit, and 'stagger' if two objects take the exit: 
<blockquote> 
  <p><code>Drakkos Wyrmstalker staggers off to the east. <br>
    Drakkos Wyrmstalker and Draktest stagger off to the east. </code></p>
</blockquote>
<p>The second part of this exercise is achieved by using the "obvious" type. Again, 
  we use it as above. We pass in a 1 if we want the exit to be obvious... in other 
  words, we want it to appear in the list of obvious exits. We pass in a 0 if 
  we want it to be hidden: </p>
<blockquote> 
  <p><code>modify_exit("east", ({"obvious", 0})); </code></p>
</blockquote>
<p>Remember that we can combine all of our modify_exit statements into a single 
  line of code, like so: </p>
<blockquote> 
  <p><code>modify_exit("east", ({"exit mess", "$N stagger$s off to the $T.", &nbsp;&nbsp;&nbsp;&nbsp; 
    "obvious", 0})); </code></p>
</blockquote>
<p>Which is equivalent to both of the previous modify_exits. <br>
  <br>
<hr>
<br>
<code>QUESTION TWELVE </code> 
<blockquote> 
  <p><i>"We can give NPCs access to guild commands using the add_known_command 
    function. Using this and an add_combat_action, show how we can make an NPC 
    crush and strike at an enemy, should they have an appropriate weapon." </i></p>
</blockquote>
<p>Add_known_command takes a single string as an argument, and that string is 
  the name of the command. The command must exist as a part of /cmds/guild-race, 
  however, or it will not be added. In our setup(), we would have the following 
  lines to provide our NPC with access to the crush and strike commands: 
<blockquote> 
  <p><code>add_known_command ("crush"); <br>
    add_known_command ("strike"); </code></p>
</blockquote>
<p>Then, we add a combat action to our NPC as we've done before: 
<blockquote> 
  <p><code>add_combat_action(25, "beat_them",(: do_whack :)); </code></p>
</blockquote>
<p>And then a function to handle the actual crushing or striking: 
<blockquote> 
  <p><code>void do_whack(object attacker, object target) { <br>
    &nbsp;&nbsp;&nbsp;&nbsp; if (target == this_object()) { <br>
    &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; return; <br>
    &nbsp;&nbsp;&nbsp;&nbsp; } <br>
    &nbsp;&nbsp;&nbsp;&nbsp; if (sizeof (this_object()->query_holding())) { <br>
    &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; switch (random (2)) { <br>
    &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 
    case 0: <br>
    &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 
    do_command ("crush " + file_name (target) <br>
    &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 
    + " with weapon"); <br>
    &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 
    break; <br>
    &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 
    default: <br>
    &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 
    do_command ("strike " + file_name (target) <br>
    &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 
    + " with weapon"); <br>
    &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 
    break; <br>
    &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; } <br>
    &nbsp;&nbsp;&nbsp;&nbsp; } <br>
    } </code></p>
</blockquote>
<p>Then, we give our NPC an appropriate weapon in its setup(), and tell it to 
  hold it: 
<blockquote> 
  <p><code>ARMOURY->request_item ("sledgehammer", 100); <br>
    init_equip(); </code></p>
</blockquote>
<p>And voila! We have an NPC ready to beat some excrement out of its foes wif 
  a big hammer. Whee! 
<!-- #EndEditable --> 
<p>
<hr>
<center><font size="-1"><a href="/login.html">Discworld MUD</a>'s world wide web pages.<br>brought to you by<br>
  <strong>Cut Me Own Throat Dibbler's <a href="/sausages.html">Sensational Sausages</a>;&nbsp;buy 
  one while they are hot.</strong> <br>
<hr>Lost?  Try Discworld's <a href="/">home page</a>.</font></center><font size="-1"><i><a href="mailto:drakkos@cableinet.co.uk"><font size="-2">Mail Drakkos!</font></a></i>
</font>
</body>
<!-- #EndTemplate --></html>