changeset 775:fad358ddb46f

Updated LOC-format documentation.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 01 Jun 2009 05:20:08 +0000
parents 8645c41bddd1
children 1e71e6ee06e2
files README.loc
diffstat 1 files changed, 38 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/README.loc	Mon Jun 01 05:05:39 2009 +0000
+++ b/README.loc	Mon Jun 01 05:20:08 2009 +0000
@@ -1,26 +1,47 @@
 MapUtils '.loc' file format documentation
 =========================================
-File MUST start with line:
-# MapUtils LOC file (version 2.0)
+CHANGES FROM v2.x
+-----------------
+Following important changes were implemented in transition from
+fileformat v2 to v3:
 
-Processing software may check against the version number to see if they
+ * Records are no longer line-based, but can span multiple lines.
+ * String fields can have escaped sequences inside them.
+ * Name field can now contain optional alternative names,
+   separated by pipe ('|'). First name, is still used as the
+   primary "key", however.
+
+
+GENERAL FORMAT DESCRIPTION
+--------------------------
+A properly formatted loc-file MUST start with line:
+
+# MapUtils LOC file (version 3.0)
+
+Processing software MAY check against the version number to see if they
 are compatible with the format. Any backwards-incompatible changes
 will result in change of the major version digit.
 
-Rest of the format is rather simplistic:
+Rest of the format is as follows:
 
- * One location per line.
- * Lines end with a linefeed (\n) character.
+ * Location record starts with a number describing the X-coordinate.
+ * Records can span multiple lines (line can be continued by ending
+   with a slash character '\').
+ * Records end with a linefeed (\n) character.
  * Empty lines (this includes lines with whitespace only) are IGNORED.
- * Lines starting with hash (#) character are considered comments and
-   are thus IGNORED. Processing software MAY preserve and add comments,
-   if wished.
+ * Lines where the first non-whitespace character is a hash (#), are
+   considered comments and are thus IGNORED. Processing software MAY
+   preserve and add comments, if wished.
+ * String-type fields can contain ESCAPED sequences (escape character is
+   slash '\'), which MUST be  parsed into literals.
+   Example: foo\;bar would be parsed to "foo;bar"
 
-Each line has divided to fields 8 fields via semicolons (;). Fields MAY
+Each record is divided to fields 8 fields via semicolons (;). Fields MAY
 contain extra whitespace padding on both sides (left and right), which
-MUST be trimmed. Each location line has following fields:
+SHOULD be trimmed by the parser. Each record consists of following fields:
 
-X;Y;flags;location name;creators;timestamp;URL;freeform
+       X;Y;flags;location name(s);creator(s);timestamp;URL;freeform
+
 
 The fields are as follows: (REQ = field is required, OPT = field can be
 left empty)
@@ -28,9 +49,10 @@
  * [REQ] X (horizontal) and Y (vertical) coordinates of the location
    with origo (0,0) being in upper left corner of the map.
 
- * [REQ] Location name: The name acts as UNIQUE identifier, but there
-   are exceptions: locations marked with invisible flag (-) may share
-   the same location identifier.
+ * [REQ] Location name(s): The first name acts as UNIQUE identifier, but
+   there are exceptions: locations marked with invisible flag (-) may
+   share the same location identifier. Additional alternative names can
+   be specified, separated by pipe character ('|').
 
  * [REQ] Flags: Contains information about the marker's type, etc:
    First (non-whitespace) character MUST be a number [0-3], which describes
@@ -48,6 +70,7 @@
      'G' = Guild
      'P' = Player guild/secret society
      'M' = Monster
+     'F' = Regional Fort
 
    Special flags:
      '-' = Location is "invisible". Practically means that some operations