foundationI_fluffos_v1/
foundationI_fluffos_v1/bin/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/ChangeLog.old/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/Win32/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/compat/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/compat/simuls/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/include/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/clone/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/command/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/data/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/etc/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/include/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/inherit/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/inherit/master/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/log/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/single/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/single/tests/compiler/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/single/tests/efuns/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/single/tests/operators/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/u/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/tmp/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/windows/
foundationI_fluffos_v1/lib/
foundationI_fluffos_v1/lib/cmds/ambassador/
foundationI_fluffos_v1/lib/cmds/database/
foundationI_fluffos_v1/lib/cmds/soul/
foundationI_fluffos_v1/lib/daemon/include/
foundationI_fluffos_v1/lib/daemon/save/
foundationI_fluffos_v1/lib/daemon/services/
foundationI_fluffos_v1/lib/daemon/soul/
foundationI_fluffos_v1/lib/doc/build/
foundationI_fluffos_v1/lib/doc/build/room/
foundationI_fluffos_v1/lib/doc/build/virtual/
foundationI_fluffos_v1/lib/doc/driver/
foundationI_fluffos_v1/lib/doc/efun/
foundationI_fluffos_v1/lib/doc/etc/
foundationI_fluffos_v1/lib/doc/help/creator/
foundationI_fluffos_v1/lib/doc/help/hm/
foundationI_fluffos_v1/lib/doc/help/user/
foundationI_fluffos_v1/lib/doc/lpc/basic/
foundationI_fluffos_v1/lib/doc/lpc/data_types/
foundationI_fluffos_v1/lib/doc/lpc/etc/
foundationI_fluffos_v1/lib/doc/lpc/intermediate/
foundationI_fluffos_v1/lib/doc/lpc/types/
foundationI_fluffos_v1/lib/doc/mudlib/
foundationI_fluffos_v1/lib/doc/mudlib/features/
foundationI_fluffos_v1/lib/domains/Examples/etc/
foundationI_fluffos_v1/lib/domains/Examples/room/
foundationI_fluffos_v1/lib/domains/Examples/virtual/
foundationI_fluffos_v1/lib/domains/Examples/virtual/exaA/
foundationI_fluffos_v1/lib/domains/Examples/virtual/exaB/
foundationI_fluffos_v1/lib/domains/Examples/weapon/
foundationI_fluffos_v1/lib/domains/Standard/
foundationI_fluffos_v1/lib/domains/Standard/pools/
foundationI_fluffos_v1/lib/domains/Standard/std/
foundationI_fluffos_v1/lib/domains/Standard/xtra/
foundationI_fluffos_v1/lib/include/
foundationI_fluffos_v1/lib/news/
foundationI_fluffos_v1/lib/secure/cfg/
foundationI_fluffos_v1/lib/secure/cmds/adm/
foundationI_fluffos_v1/lib/secure/cmds/ambassador/
foundationI_fluffos_v1/lib/secure/cmds/mortal/
foundationI_fluffos_v1/lib/secure/etc/
foundationI_fluffos_v1/lib/secure/etc/approval/
foundationI_fluffos_v1/lib/secure/etc/elections/
foundationI_fluffos_v1/lib/secure/etc/mudlib/
foundationI_fluffos_v1/lib/secure/etc/quests/
foundationI_fluffos_v1/lib/secure/save/daemon/
foundationI_fluffos_v1/lib/secure/save/postal/d/descartes/
foundationI_fluffos_v1/lib/secure/save/users/d/
foundationI_fluffos_v1/lib/secure/std/
foundationI_fluffos_v1/lib/std/obj/
foundationI_fluffos_v1/lib/std/room/
foundationI_fluffos_v1/lib/std/user/
foundationI_fluffos_v1/lib/std/virtual/
foundationI_fluffos_v1/old/
foundationI_fluffos_v1/win32/
		   Nightmare IV Basic Room Tutorial
		 Written by Descartes of Borg 940901
			Last Modified: 940901

This document describes how to build a room under the Nightmare IV
Mudlib.  The document assumes that you have read LPC Basics and thus
have a basic understanding of what a function is and what a variable
is.  If you do not understand that much, please mail
borg@nightmare.imaginary.com with specific questions about what you do
not understand.

I.  The simplest room.
This is the simplest room you can actually get away with.  Note that
it is not the sort of room which actually should go into the game,
since it leads nowhere.

****
#include <std.h>

inherit ROOM;

void create() {
    room::create();
    set_short("an empty room");
    set_long("This is a very empty room!  You have nowhere to go!");
}
****

Yes.  If you write a file with only this in it (pretend it is
"/realms/descartes/test.c"), and then you type "goto /realms/descartes/test",
you will end up in a room with no exits and "This is a very empty
room!  You have nowhere to go!" as a description.  If you are in brief
mode, you will see "an empty room" for the description.

What does the most basic room consist of?  Well, the first line is
called a pre-processor directive.  It basically takes the file
"/adm/include/std.h" and dumps it right into your file at the line
where you included it.  Why would you do that?  Because std.h has a
pre-processor directive in it that looks like this:

#define ROOM    "/std/room"

When it sees that, it knows that everywhere it sees the expression
ROOM, it should replace it with the expression "/std/room".  You do
this in case the location of the standard room object should ever
change.  If I suddenly moved /std/room.c to /lib/room.c (which I might
do some day), then I would change the define in std.h  And your room
would never break!.

The third line:

inherit ROOM;

therefore looks like:

inherit "/std/room";

after the pre-processor is done with it (a more detailed explanation
of the LPMud pre-processor is in the intermediate textbook).  This
line is very important.  It is what makes a room a room.  Inside the
file /std/room.c are a bunch of files which do fun room things and
they are already written for you so that you do not have to write them
yourself just to make a stupid room.  When you "inherit" /std/room,
you are inheriting all of the functionality that /std/room has.

The final part of the room is a function you define called create().
create() gets called in every object the first time the object is
referenced in the game.  create() allows you to set the object up with
the values it needs to begin with.  In this case, the room needs to
have descriptions.  So you set it up with the descriptions (however
dull they are here) that it is to have.

Inside create(), you have three lines:
The first calls the function create() in /std/room.  That object you
inherited, has some business it needs to take care of as well when the
object is first loaded up.  But since you wrote your own create()
function, its create() function cannot be called, *unless* you
specifically reference it.  So:

    room::create();

says to call the function create() in the inherited object known as
room (objects are known by the last part of their file names).
The rest of the create() function sets up descriptions.  set_short()
is the description people see when they are in brief mode.  set_long()
sets the description they will see when in verbose mode.

Of course, all rooms are going to be more complicated than this.  You
will want to give people places to go and you will want to give them
things to do.  Not to mention adding other things in the room with
which they can interact.

II. A real room

At this point, you should understand the minimal components for any
room.  If you understand that well, it is time to dive into coding a
functioning room.  A minimal functioning room might look like this:

****
#include <std.h>

inherit ROOM

void create() {
    room::create();
    set_properties( ([ "light" : 2, "indoors" : 1 ]) );
    set_short("a cramped room");
    set_long("You are in a cramped room with no furnishings.
      "You see an exit to the north.");
    add_item("exit", "An open doorway without a door leading outside.");
    add_exit("north", "/realms/descartes/outside");
}
****

Notice that this room has barely anything the simple room does not,
yet it is infinitely better.  Why?  Because a player can actually *do*
things inside the room.  First of all, you have the line:

    set_properties( ([ "light" : 2, "indoors" : 1 ]) );

This sets the basic values for your room's properties.  In this case,
your room has a light value of 2 and an indoors value of 1, meaning
that the room is in fact an indoors room.  Light values can extend
between +5 for utterly way-too brightm to -5 meaning supernaturally
dark.  2 is average indoor lighting.  Indoor property simply is 1 if
the room is indoors, or 0 if it is an outdoors room.

The next different thing is a tedious, yet perhaps the most important
part of good room building.  Placing items for people to look at to
get visual representations of the room.  In this example, any time a
player types "look at exit", they will see the description "An open
doorway without a door leading outside.".  It is very important to
describe anything which might be in view in the room.  A good general
rule is to describe every noun you use.

Finally, this room has an exit.  Any time a player in the room types
"go north", they will move to the room "/realms/descartes/outside",
and thus no longer be in this room.

That is all there is to building your basic room.  Of course, you
cannot get away with building an entire area consisting only of rooms
with nice descriptions, items, and other places to go.  If you
understand everything presented in here, then perform the following
tasks as a check, then move on to the IntermediateRooms document.

III. Exercises
Build a garden room which has an exit to the north that leads to
Krasna Square (/domains/standard/square).  You should describe flowers
and vegitables in the garden both in the long description and
specifically in the items.  Naturally the room is outdoors.

If you feel you have created a realistic room given the knowledge
presented in this document, then move on to the Intermediate document.