[CODE] [LIB] World file parsing

From: d. hall (dhall@APK.NET)
Date: 08/20/97


This is food for thought and discussion.

Although I voiced the opinion that human readable world files are less
important when OLC is predominant (and I still hold that opinion), I have
worked on making the world files a little more sane to read, since I don't
plan on making OLC work any time soon.

Here is a preliminary setup of what the world file will look like.  The
database code is quite long and I'm not using stock circle structures.
I'll see about extracting the functions out, if interest warrants, although
I don't think people want to scrap their world files.  I have only modified
world files so far, objects and mobiles are next.

I do need to modularize and abstract the source quite a bit more.

The semi-colon's are important, since I've turned to reading in a stream
fashion instead of using line based parsing.  The syntax I have attempted
to keep consistant.

Notice I've kept the "descriptions" within a option-list format, instead of
having one large string.  This is to improve readability, and make editors
like emacs within perl-mode or cc-mode indent correctly. =)

<define type> "<keyword list/name>" <virtual/index number> {
   option-name value;
   option-list {
     list-item;
     list-item;
   }
}

Sample Zone file.

zone "Astral Plane" 12 {
   read-access { all };
   write-access { none };
   debug-level 1;
   update-interval 0;

   room "Chamber of Voices" 1201 {
      sector-type 15;
      room-flags "nomagic godroom";
      description {
         "      You stand within a large crystal sphere, floating amidst the\n";
         "astral wind.  As the spiritual waves slowly ebb and flow across\n";
         "the surface of the sphere, you feel an inner calm surround you.\n";
      }
      direction "north streams" 0 {
         description {
            "Within the streams of astral current you can see several spheres\n";
            "randomly floating about.\n";
         }
         exit-flags "none";
         key-number -1;
         room-link 1202;
      }
      edesc "sphere crystal" {
         "Although translucent, the prismatic surface of the crystal appears\n";
         "to waver into and out of existance.\n";
      }
   }
}

d.


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST