-
Notifications
You must be signed in to change notification settings - Fork 0
Content:Land File Format
Land File Format is the format used for defining lands. It is a text-based format that includes map data and map population data. The map data is easy to edit because it resembles the actual map that it defines. The population data and meta data are easy to edit because they are in plain text. Files that are in Land File Format are referred to as LND files throughout this wiki.
A LND file consists of several lines of data in a file with the extension '.lnd'. The data is split into several sections. The first section is the header, which consists of one line. All other sections are made up of a variable number of lines. The number of lines that each section takes up in a file is defined in the file's header section. After the header is the map section. Following this is the portal section. Following this is the entities section.
Some sections contain areas where a value type is used. For these areas, certain data types are used.
- String - The value is a sequence of any character except for the ';' character.
- Integer - The value is a sequence of numerical characters.
- Point - The value is exactly two integers separated by a comma. The first integer is the x-coordinate and the second integer is the y-coordinate.
- Dimension - The value is exactly two integers separated by a comma. The first integer is the width and the second integer is the height.
The header section is the first line of a LND file. It consists of several declarations of the form key=value separated by the semicolon character ';'. There are several keys that must have a value defined for them in the header:
- name - The name of the land. The value must be a string.
- start - The position of the player start. The value must be a point.
- size - The size of the map. The value must be a dimension.
- portals - The number of portals in the map. The value must be an integer that matches the number of lines in the portals section.
- entities - The number of entities in the map. The value must be an integer that matches the number of lines in the entities section.
The map section is as many lines long as the land's height. Each line represents a real line of tiles, and each character in each line represents one tile in the land. Each character must refer to a defined tile; for a list of tiles defined by the built-in content pack, see the page Content:Tile Definition File.
The portals section contains several lines that define the portals in the land. Each line defines one portal. Each line consists of a series of four values separated by the semicolon character ';'. The purpose of each value is listed below:
- 1st value - The position of the portal. This value must be a point.
- 2nd value - The name of the portal. This value must be a string that refers to a defined portal; for a list of portals defined by the built-in content pack, see the page Content:Portal Definition File.
- 3rd value - The position of the place that stepping on the portal transports entities to. This value must be a point.
- 4th value - The name of the land that the destination is in. This value must be a string that refers to the name of a land inside of the same world as this land. It can be the name of the land defined by the LND file containing this portal definition.
The entities section contains several lines that define the entities in the land. Each line defines one entity. Each line consists of a series of three values separated by the semicolon character ';'. The purpose of each value is listed below:
- 1st value - The start position of the entity. This value must be a point.
- 2nd value - The name of the entity. This value must be a string that refers to the name of a defined entity; for a list of entities defined by the built-in content pack, see the page Content:Entity Definition File.
- 3rd value - The level of the entity. This value must be an integer.
name=Sample Map;start=1,1;size=29,27;portals=2;entities=4
#############################
#...........................#
#...........................#
#...........................#
#...........................#
#...........................#
#.................######....#
#.................#..#.#....#
#.................#..#.#....#
#...........................#
#############################
1,7;teleporter;10,7;Sample Map
1,6;teleporter;10,7;Sample Map
9,4;slime;4
9,5;slime;2
9,6;slime;1
9,7;slime;8
The following lands are provided by the world described in the default content pack:
myrkah.lnd