

  Installing your own virtual world.
  ----------------------------------


  First create a directory called 'virtual' in your home directory.
  After that copy an example file from /examples/virtual/virtual_server.c
  in some of your directories. Modify the server and place it under
  filename /players/foo/virtual/server.c. Create all the directories
  you have defined in your virtual server, also create an object I
  have called 'universum' as defined in server code. This Universum
  object then contains all your virtual rooms when they are created.
  For simplicity its code could be like this:

  void
  create() {}

 You need not create any other objects or files at this point.
 Compile your server and if it comes out without any errors then
 your world server is installed.


 NOTE: Never compile your universum object when your world is working
       and players are on your area because it will cause them to be
       destroyed. Instead of that use the reboot facility explained
       in chapter 3.


  server.c
  --------

 
  The example server contains many defined values for variables.
  The meaning of those variables is explained here:

  virtual_home: This variable should contain a directory for your
                world files and directories.

  terra_home:   The directory for your terrain types is in this variable.

  maps_home:    A directory for your own maps.

  rooms_home:   A directory for your virtual rooms. This directory must
                always be one of the subdirectories of your virtual 
                directory.

  descs_home:   Your room specific descriptions will be in this directory.

  terra_cfg:    Variable defines your terrain type configuration file.

  obj_cfg:      Your predefined objects are configured in this file.

  map_cfg:      Your maps are defined in this file.

  virtual_save: The configuration is saved in this file.

  universum:    The file path of your universum object.

  memory:       The amount of maps held in memory simultaniously.

  tdesc_x:      Width of your terrain descriptor on map.


  Configuring your world.
  ----------------------

 
  As you noticed there are three configuration files. These files are
  ordinary text files with no code in them. The purpose of these files
  is to tell the server where can all different objects be found.
  Each file has its own syntax of presenting information:


 terra_cfg: <descriptor>:<terrain file>
             :
             .

 obj_cfg:   <place on map>:<number of objects>:<object>:<function>:<arg>
             :
             .

 map_cfg:   <map file>:<x1>,<y1>,<x2>,<y2>
             :
             .


 where: <descriptor> is a string of characters amount of tdesc_x.
                     this argument describes one pixel on your map and
                     it identifies a terrain type.
       
        <terrain file> is a filename in your terra_home directory.

        <place on map> identifies the coordinates on map in a string
                       type of "X_Y" where X is x coordinate and Y is
                       y coordinate of the room.

        <number of objects> is amount of defined objects cloned.

        <object> is a full filename of the object to be cloned.

        <function> defines a function to be called after cloning
                   the object defined. This argument is optional.

        <arg> is argument for the function. It is optional and can't
              exist without a function defined.

        <map file> is your map filename in your maps_home directory.

        <x1>...  are the upper left and lower right corner coordinates
                 of the map.

 Examples:

    terra_cfg:  x:swamp
                f:forest
                m:mountain
                z:desert

    obj_cfg:    3_2:3:/players/tron/orc
                3_2:1:/players/tron/giant
                4_1:1:/players/tron/door:set_all:1#1#56#3#55#

    map_cfg:    dark_forest:0,0,9,9
                light_forest:10,0,18,9

   
    Some noticeable points: You can define terrain descriptors longer
                           than just one character with tdesc_x.

                           You can define objects to same room on
                           different lines and give functions and
                           arguments as well.

                           The coordinates of the maps are not normally
                           arranged but the origo (0, 0) is in the upper
                           left corner of the map and not in the lower
                           left like you might assume. So a move to south
                           would make y-coordinate 1 and a move to east
                           would also make x-coordinate 1. etc. You can
                           see that you can combine different maps 
                           together by arranging the coordinates so that
                           the maps make a seamless combined area.

                           Do not use characters ':' or '@' in your
                           object filenames or in any parts of the
                           defined arguments because it messes up the
                           parser which is not very intelligent. 
                           


  Maps
  ----


  Maps are located in your maps_home directory. The maps consist of
  defined terrain types. If the map contains other characters they are
  not counted as rooms. You can define your terrain types in a 
  configuration file as presented earlier.

  example map:     xxxxxxxx
                   xxfffzzz
                   xfffffzz
                   fffffffz
                   mfffffmm
                   mmmmffmm
                   mmmmmmmm

  Noticeable points: This map contains only terraintypes defined as
                     earlier. In this case every character represents
                     a room.

                     When you draw a map in a file, try to make sure
                     there are no extra lines or blank spaces after
                     each line because the map is read as whole
                     without any checks for its size. This way 
                     everything is quicker and saves memory. Also be
                     sure that the area you have defined for the map
                     really is the size of the map, definately not 
                     larger than the map because it can cause errors.
                     Maybe in later versions of this system it is checked
                     but not yet.



  Terrain types.
  --------------

  
  Terrain types are room objects that represent one specific terrain.
  It contains all the featores that possibly relate to that terrain
  type. It could be mountains, it could be water, caves, villages or
  anything the coder wants to create.

  A terrain type room is very similar to a normal room. The only and
  biggest execption is that it really can represent numerous rooms.
  This is one thing that has to be kept in mind. Even though this is
  restricting the coder to make all rooms different it saves a lot of
  work when you need big areas. I have tried to create some chance for
  the rooms to be different by adding the specific description option.
  You have defined a directory for these descriptions in descs_home
  variable in your server. This is discussed later.

  Coding a terrain type starts with including an atomic terrain room:

   #include <virtual_room.h>

 This room is compatible with room.h with some changes:

   create_room() is called create_virtual()
   reset_room()  is called reset_virtual()
   add_exit()    is called add_virtual_exit()

   DO NOT CALL THE OLD FUNCTIONS!
   
 There also are some extra functions to control virtual rooms:

   set_virtual_exits()

   add_random_object()
   set_random_objects()

   set_random_desc()

 Examples:

   add_exit("north", 0, -1);

   x coordinate is 0 and y is -1. These coordinates are relative meaning
   that now you move -1 steps in y axis and 0 in your x azis from your
   current position. Coordinates 0, 1 would move you south, -1, 0 to
   west, 1, 1 to south east etc.

   set_virtual_exits( (["north": ({0, -1}), "south": ({0, 1}) ]) );

   If you want to set up all the directions at once then you can send
   a mapping as argument.

   add_random_object("1:12:/players/tron/orc:set_long:dangerous orc");

   Number 1 is the amount of objects, 12 is the chance to load 1
   objects that are /players/tron/orc type. After cloning orc gets
   a function call to set_long with argument. These last two parts are
   optional. Random objects are cloned only when the room is created
   and not any time after that so they won't return in reset.

   add_random_objects( ({ x1, x2, x3 }) );

   Here x1, x2 and x3 represent the kind of strings add_randon_object
   receives as argument.

  set_random_desc( ({ x1, x1, x2 }) );

  Here x1, x2 and x3 are description strings. One of them will be
  selected as room description randomly when room is created.

  See more about coding a terrains types from /examples/virtual
  directory.


  Room specific descriptions.
  ---------------------------


  You have defined your description directory in descs_home variable in
  the server code. This directory contains room specific descriptions.
  
  The rooms specific description overrides the random description set
  in the terrain type code. How is this done? Set your filenames with the
  coordinates in format X_Y where X is x-coordinate and Y is y-coordinate.
  
  Example:  12_5

  Now when player enters the room in coordinates 12, 5 it will show the
  description written in file called '12_5' in your description directory.
  If there is no description set for the room it will show the random
  description.


//Tron
